https://sourceware.org/bugzilla/show_bug.cgi?id=34312
--- Comment #6 from Sourceware Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by H.J. Lu <[email protected]>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f85ff0c4bced98c61c8ac90e0bf96cc59c257a0b commit f85ff0c4bced98c61c8ac90e0bf96cc59c257a0b Author: H.J. Lu <[email protected]> Date: Wed Jun 24 08:09:56 2026 +0800 gas/ELF: Allow local symbol with non-protected visibility In the source code extracted from glibc: extern void _dl_sysinfo_int80 (void) __attribute__ ((visibility ("hidden"))); asm (".text\n\t" ".type _dl_sysinfo_int80,@function\n" "_dl_sysinfo_int80:\n\t" "int $0x80;\n\t" "ret"); uintptr_t foo () { return (uintptr_t) _dl_sysinfo_int80; } _dl_sysinfo_int80 is a local function, but it is defined in an asm statement. Since it is referenced in C, it is declared as hidden, which leads to an assembler warning: Warning: local symbol `_dl_sysinfo_int80' has non-default visibility Symbol binding and visiblity are orthogonal. One is for link-editing, the other for runtime linking. In principle, all combinations are "okay" (if questionable), and have obvious implementations. But it's only that specific combination STB_LOCAL+STV_PROTECTED that is explicitely made ill-formed in the spec (despite it being also obviously implementable). Warning on that combination can be done on the grounds of following the spec. But no other combination is so spelled out, so there's no basis for trying to disallow them. Partially revert: commit c4150acbda1b3ce0602f79cbb7700b39e577be7e Author: Jan Beulich <[email protected]> Date: Fri May 8 11:45:04 2026 +0200 gas/ELF: warn upon non-default visibility of local symbols and update elf_adjust_symtab to only warn local symbol with protected visibility. binutils/ PR gas/34312 * testsuite/binutils-all/localize-hidden-1.l: Adjusted. * testsuite/binutils-all/nm-ver.s: Revert commit c4150acbda1. gas/ PR gas/34312 * config/obj-elf.c (elf_adjust_symtab): Allow local symbol with non-protected visibility. * testsuite/gas/elf/visibility.l: Adjusted. * testsuite/gas/i386/tlsnopic.s: Revert commit c4150acbda1. ld/ PR gas/34312 * testsuite/ld-aarch64/ifunc-21.s: Revert commit c4150acbda1. * testsuite/ld-aarch64/ifunc-21.s: Likewise. * testsuite/ld-tic6x/shlib-1.rd: Likewise. * testsuite/ld-tic6x/shlib-1.s: Likewise. * testsuite/ld-tic6x/shlib-1b.rd: Likewise. * testsuite/ld-tic6x/shlib-1r.dd: Likewise. * testsuite/ld-tic6x/shlib-1r.rd: Likewise. * testsuite/ld-tic6x/shlib-1rb.dd: Likewise. * testsuite/ld-tic6x/shlib-1rb.rd: Likewise. * testsuite/ld-tic6x/shlib-noindex.rd: Likewise. * testsuite/ld-tic6x/static-app-1.rd: Likewise. * testsuite/ld-tic6x/static-app-1b.rd: Likewise. * testsuite/ld-tic6x/static-app-1r.dd: Likewise. * testsuite/ld-tic6x/static-app-1r.rd: Likewise. * testsuite/ld-tic6x/static-app-1rb.dd: Likewise. * testsuite/ld-tic6x/static-app-1rb.rd: Likewise. Signed-off-by: H.J. Lu <[email protected]> -- You are receiving this mail because: You are on the CC list for the bug.
