]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: more cleanups for visibility hidden symbol handling
authorCherry Mui <cherryyz@google.com>
Fri, 6 May 2022 20:05:06 +0000 (16:05 -0400)
committerCherry Mui <cherryyz@google.com>
Tue, 10 May 2022 18:37:58 +0000 (18:37 +0000)
CL 404296 removes the hidden visibility checks, but a few of them
were left. Remove them as well.

Change-Id: Idbcf37429709c91403803d32684239d398e43543
Reviewed-on: https://go-review.googlesource.com/c/go/+/404303
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/s390x/asm.go
src/cmd/link/internal/x86/asm.go

index 8d1a81ed1d17fa91bf6f4634ba093a1422f34acf..0e16fe5495dc547c7c9f12d7f2aa042a686dc39b 100644 (file)
@@ -215,7 +215,7 @@ func (st *relocSymState) relocsym(s loader.Sym, P []byte) {
                        rst = ldr.SymType(rs)
                }
 
-               if rs != 0 && ((rst == sym.Sxxx && !ldr.AttrVisibilityHidden(rs)) || rst == sym.SXREF) {
+               if rs != 0 && (rst == sym.Sxxx || rst == sym.SXREF) {
                        // When putting the runtime but not main into a shared library
                        // these symbols are undefined and that's OK.
                        if target.IsShared() || target.IsPlugin() {
index f26b3f3cf2efb788f775cb056e231941091e6b63..482b3c8e693f509de1f8abbeb15e57f6fb32d0ab 100644 (file)
@@ -111,9 +111,7 @@ func adddynrel(target *ld.Target, ldr *loader.Loader, syms *ld.ArchSyms, s loade
                if targType == sym.SDYNIMPORT {
                        ldr.Errorf(s, "unexpected R_390_PCnn relocation for dynamic symbol %s", ldr.SymName(targ))
                }
-               // TODO(mwhudson): the test of VisibilityHidden here probably doesn't make
-               // sense and should be removed when someone has thought about it properly.
-               if (targType == 0 || targType == sym.SXREF) && !ldr.AttrVisibilityHidden(targ) {
+               if targType == 0 || targType == sym.SXREF {
                        ldr.Errorf(s, "unknown symbol %s in pcrel", ldr.SymName(targ))
                }
                su := ldr.MakeSymbolUpdater(s)
index 5f6bcfb8b1abf0c6d374148e4aefa10bfe2413d4..3a33201fd9403e65e9f0186599130cdbc179d0dd 100644 (file)
@@ -147,9 +147,7 @@ func adddynrel(target *ld.Target, ldr *loader.Loader, syms *ld.ArchSyms, s loade
                if targType == sym.SDYNIMPORT {
                        ldr.Errorf(s, "unexpected R_386_PC32 relocation for dynamic symbol %s", ldr.SymName(targ))
                }
-               // TODO(mwhudson): the test of VisibilityHidden here probably doesn't make
-               // sense and should be removed when someone has thought about it properly.
-               if (targType == 0 || targType == sym.SXREF) && !ldr.AttrVisibilityHidden(targ) {
+               if targType == 0 || targType == sym.SXREF {
                        ldr.Errorf(s, "unknown symbol %s in pcrel", ldr.SymName(targ))
                }
                su := ldr.MakeSymbolUpdater(s)