Skip to content

Commit 508cb32

Browse files
committed
cmd/link: more cleanups for visibility hidden symbol handling
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 <[email protected]> Run-TryBot: Cherry Mui <[email protected]> Reviewed-by: Than McIntosh <[email protected]>
1 parent 4d716e4 commit 508cb32

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

src/cmd/link/internal/ld/data.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func (st *relocSymState) relocsym(s loader.Sym, P []byte) {
215215
rst = ldr.SymType(rs)
216216
}
217217

218-
if rs != 0 && ((rst == sym.Sxxx && !ldr.AttrVisibilityHidden(rs)) || rst == sym.SXREF) {
218+
if rs != 0 && (rst == sym.Sxxx || rst == sym.SXREF) {
219219
// When putting the runtime but not main into a shared library
220220
// these symbols are undefined and that's OK.
221221
if target.IsShared() || target.IsPlugin() {

src/cmd/link/internal/s390x/asm.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@ func adddynrel(target *ld.Target, ldr *loader.Loader, syms *ld.ArchSyms, s loade
111111
if targType == sym.SDYNIMPORT {
112112
ldr.Errorf(s, "unexpected R_390_PCnn relocation for dynamic symbol %s", ldr.SymName(targ))
113113
}
114-
// TODO(mwhudson): the test of VisibilityHidden here probably doesn't make
115-
// sense and should be removed when someone has thought about it properly.
116-
if (targType == 0 || targType == sym.SXREF) && !ldr.AttrVisibilityHidden(targ) {
114+
if targType == 0 || targType == sym.SXREF {
117115
ldr.Errorf(s, "unknown symbol %s in pcrel", ldr.SymName(targ))
118116
}
119117
su := ldr.MakeSymbolUpdater(s)

src/cmd/link/internal/x86/asm.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,7 @@ func adddynrel(target *ld.Target, ldr *loader.Loader, syms *ld.ArchSyms, s loade
147147
if targType == sym.SDYNIMPORT {
148148
ldr.Errorf(s, "unexpected R_386_PC32 relocation for dynamic symbol %s", ldr.SymName(targ))
149149
}
150-
// TODO(mwhudson): the test of VisibilityHidden here probably doesn't make
151-
// sense and should be removed when someone has thought about it properly.
152-
if (targType == 0 || targType == sym.SXREF) && !ldr.AttrVisibilityHidden(targ) {
150+
if targType == 0 || targType == sym.SXREF {
153151
ldr.Errorf(s, "unknown symbol %s in pcrel", ldr.SymName(targ))
154152
}
155153
su := ldr.MakeSymbolUpdater(s)

0 commit comments

Comments
 (0)