public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* gc-sections fix
@ 2004-04-30  9:40 Alan Modra
  2004-04-30 10:53 ` Eric Botcazou
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2004-04-30  9:40 UTC (permalink / raw)
  To: binutils

Now that we're doing gc-sections on apps linked with dynamic libs, we
need to be prepared to handle indirect syms.

bfd/ChangeLog
	* elflink.c (elf_gc_mark): Follow indirect and warning syms.

Index: bfd/elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.66
diff -u -p -r1.66 elflink.c
--- bfd/elflink.c	21 Apr 2004 07:14:15 -0000	1.66
+++ bfd/elflink.c	30 Apr 2004 08:39:08 -0000
@@ -8173,6 +8173,9 @@ elf_gc_mark (struct bfd_link_info *info,
 	      || ELF_ST_BIND (isym[r_symndx].st_info) != STB_LOCAL)
 	    {
 	      h = sym_hashes[r_symndx - extsymoff];
+	      while (h->root.type == bfd_link_hash_indirect
+		     || h->root.type == bfd_link_hash_warning)
+		h = (struct elf_link_hash_entry *) h->root.u.i.link;
 	      rsec = (*gc_mark_hook) (sec, info, rel, h, NULL);
 	    }
 	  else

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: gc-sections fix
  2004-04-30  9:40 gc-sections fix Alan Modra
@ 2004-04-30 10:53 ` Eric Botcazou
  2004-04-30 12:26   ` Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Botcazou @ 2004-04-30 10:53 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 390 bytes --]

> Now that we're doing gc-sections on apps linked with dynamic libs, we
> need to be prepared to handle indirect syms.

Ah!, yes :-)

It also occured to me that I didn't update the docs with my initial patch.

Ok for mainline?


ld/ChangeLog:

2004-04-30  Eric Botcazou <ebotcazou@act-europe.fr>

	* ld.texinfo (--gc-sections): Remove restriction for 
	dynamic linking.
	

-- 
Eric Botcazou

[-- Attachment #2: gc_sections_doc.diff --]
[-- Type: text/x-diff, Size: 852 bytes --]

Index: ld.texinfo
===================================================================
RCS file: /cvs/src/src/ld/ld.texinfo,v
retrieving revision 1.109
diff -u -r1.109 ld.texinfo
--- ld.texinfo	21 Apr 2004 06:08:47 -0000	1.109
+++ ld.texinfo	30 Apr 2004 10:37:51 -0000
@@ -1145,9 +1145,9 @@
 @itemx --gc-sections
 Enable garbage collection of unused input sections.  It is ignored on
 targets that do not support this option.  This option is not compatible
-with @samp{-r}, nor should it be used with dynamic linking.  The default
-behaviour (of not performing this garbage collection) can be restored by
-specifying @samp{--no-gc-sections} on the command line.
+with @samp{-r}. The default behaviour (of not performing this garbage
+collection) can be restored by specifying @samp{--no-gc-sections} on
+the command line.
 
 @cindex help
 @cindex usage

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

* Re: gc-sections fix
  2004-04-30 10:53 ` Eric Botcazou
@ 2004-04-30 12:26   ` Alan Modra
  2004-05-01 11:07     ` Eric Botcazou
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2004-04-30 12:26 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: binutils

On Fri, Apr 30, 2004 at 12:47:58PM +0200, Eric Botcazou wrote:
> 	* ld.texinfo (--gc-sections): Remove restriction for 
> 	dynamic linking.

OK.  Incidentally, the --gc-sections problem showed up as a gcc
testsuite failure on powerpc64-linux, gcc.dg/special/gcsec-1.c.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: gc-sections fix
  2004-04-30 12:26   ` Alan Modra
@ 2004-05-01 11:07     ` Eric Botcazou
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Botcazou @ 2004-05-01 11:07 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

> OK.  Incidentally, the --gc-sections problem showed up as a gcc
> testsuite failure on powerpc64-linux, gcc.dg/special/gcsec-1.c.

Thanks for fixing the regression.

-- 
Eric Botcazou

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

end of thread, other threads:[~2004-05-01 11:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-30  9:40 gc-sections fix Alan Modra
2004-04-30 10:53 ` Eric Botcazou
2004-04-30 12:26   ` Alan Modra
2004-05-01 11:07     ` Eric Botcazou

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).