public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] ld: Always output local symbol for relocatable link
@ 2022-11-08 22:50 H.J. Lu
  2022-11-09  1:00 ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2022-11-08 22:50 UTC (permalink / raw)
  To: binutils

	PR ld/29761
	* elflink.c (elf_link_output_symstrtab): Don't skip local symbol
	in SEC_EXCLUDE section for relocatable link.
---
 bfd/elflink.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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
     {
-- 
2.37.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ld: Always output local symbol for relocatable link
  2022-11-08 22:50 [PATCH] ld: Always output local symbol for relocatable link H.J. Lu
@ 2022-11-09  1:00 ` Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2022-11-09  1:00 UTC (permalink / raw)
  To: H.J. Lu; +Cc: binutils

On Tue, Nov 08, 2022 at 02:50:30PM -0800, H.J. Lu via Binutils wrote:
> 	PR ld/29761
> 	* elflink.c (elf_link_output_symstrtab): Don't skip local symbol
> 	in SEC_EXCLUDE section for relocatable link.

OK.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-09  1:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-08 22:50 [PATCH] ld: Always output local symbol for relocatable link H.J. Lu
2022-11-09  1:00 ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).