]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gas/ELF: warn upon non-default visibility of local symbols
authorJan Beulich <jbeulich@suse.com>
Fri, 8 May 2026 09:45:04 +0000 (11:45 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 8 May 2026 09:45:04 +0000 (11:45 +0200)
commitc4150acbda1b3ce0602f79cbb7700b39e577be7e
tree67b7bd7e99d75f06acd32b342d6416a94433ede0
parent695e1cb7f1e6158e113f6022a57083b82ff5ef54
gas/ELF: warn upon non-default visibility of local symbols

The spec explicitly precludes STB_LOCAL together with STV_PROTECTED (and,
implicity, STV_HIDDEN or STV_INTERNAL), so we better wouldn't entirely
silently write out symbols violating this.

LoongArch's tc_symbol_new_hook() simply needs dropping. If FAKE_LABEL_NAME
symbols can end up global, marking them hidden would need doing elsewhere.
There not being a need to make any testsuite adjustments suggests though
that this won't normally (ever?) happen.

A couple of testcases then also need adjustment.
23 files changed:
binutils/testsuite/binutils-all/localize-hidden-1.d
binutils/testsuite/binutils-all/localize-hidden-1.l [new file with mode: 0644]
binutils/testsuite/binutils-all/nm-ver.s
gas/config/obj-elf.c
gas/config/tc-loongarch.h
gas/testsuite/gas/elf/visibility.l
gas/testsuite/gas/elf/visibility.s
gas/testsuite/gas/i386/tlsnopic.s
ld/testsuite/ld-aarch64/ifunc-21.s
ld/testsuite/ld-tic6x/shlib-1.rd
ld/testsuite/ld-tic6x/shlib-1.s
ld/testsuite/ld-tic6x/shlib-1b.rd
ld/testsuite/ld-tic6x/shlib-1r.dd
ld/testsuite/ld-tic6x/shlib-1r.rd
ld/testsuite/ld-tic6x/shlib-1rb.dd
ld/testsuite/ld-tic6x/shlib-1rb.rd
ld/testsuite/ld-tic6x/shlib-noindex.rd
ld/testsuite/ld-tic6x/static-app-1.rd
ld/testsuite/ld-tic6x/static-app-1b.rd
ld/testsuite/ld-tic6x/static-app-1r.dd
ld/testsuite/ld-tic6x/static-app-1r.rd
ld/testsuite/ld-tic6x/static-app-1rb.dd
ld/testsuite/ld-tic6x/static-app-1rb.rd