From: H.J. Lu Date: Tue, 8 Nov 2022 22:46:25 +0000 (-0800) Subject: ld: Always output local symbol for relocatable link X-Git-Tag: gdb-13-branchpoint~533 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1db13039a7c410e89f00e379fe874d8532385e41;p=thirdparty%2Fbinutils-gdb.git ld: Always output local symbol for relocatable link PR ld/29761 * elflink.c (elf_link_output_symstrtab): Don't skip local symbol in SEC_EXCLUDE section for relocatable link. --- diff --git a/bfd/elflink.c b/bfd/elflink.c index 019ac302905..4ef07394160 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -9997,7 +9997,8 @@ elf_link_output_symstrtab (void *finf, if (name == NULL || *name == '\0' - || (input_sec->flags & SEC_EXCLUDE)) + || (!bfd_link_relocatable (flinfo->info) + && (input_sec->flags & SEC_EXCLUDE))) elfsym->st_name = (unsigned long) -1; else {