From edd1273b841050e96d9ddd937fc00c0eebe10f1b Mon Sep 17 00:00:00 2001 From: "Paul E. Murphy" Date: Mon, 19 Sep 2022 16:48:49 -0500 Subject: cmd/link: refactor usage of SymLocalentry helper functions PPC64 ELFv2 uses the st_other field of a symbol to specify an offset from the global entry point to its local entry point. Similarly, some values (i.e 1) may also require additional linker support which is missing today. For now, generate an error if we encounter unsupported local entry values on PPC64, and update the Localentry values to use bytes, not 32b instruction words. Similarly, ELFv2 1.5 also updates the wording of values 2-6. They now map to a specific number of bytes. Change-Id: Id1b71c3b0fea982bdcfb7eac91d9f93e04ae43f9 Reviewed-on: https://go-review.googlesource.com/c/go/+/431876 TryBot-Result: Gopher Robot Reviewed-by: Cherry Mui Run-TryBot: Paul Murphy Reviewed-by: Dmitri Shuralyov --- src/cmd/link/internal/loader/loader.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/cmd/link/internal/loader/loader.go') diff --git a/src/cmd/link/internal/loader/loader.go b/src/cmd/link/internal/loader/loader.go index c2baa20d8d..40ad950fe5 100644 --- a/src/cmd/link/internal/loader/loader.go +++ b/src/cmd/link/internal/loader/loader.go @@ -1562,13 +1562,12 @@ func (l *Loader) SetSymPkg(i Sym, pkg string) { l.symPkg[i] = pkg } -// SymLocalentry returns the "local entry" value for the specified -// symbol. +// SymLocalentry returns an offset in bytes of the "local entry" of a symbol. func (l *Loader) SymLocalentry(i Sym) uint8 { return l.localentry[i] } -// SetSymLocalentry sets the "local entry" attribute for a symbol. +// SetSymLocalentry sets the "local entry" offset attribute for a symbol. func (l *Loader) SetSymLocalentry(i Sym, value uint8) { // reject bad symbols if i >= Sym(len(l.objSyms)) || i == 0 { -- cgit v1.3