public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] fix "--gc-sections doesn't work on Linux/x86"
@ 2003-04-18 23:42 Julien LEMOINE
  0 siblings, 0 replies; 4+ messages in thread
From: Julien LEMOINE @ 2003-04-18 23:42 UTC (permalink / raw)
  To: binutils

 This patch fix problem with --gc-sections, in fact the test 
'elf_hash_table (info)->dynamic_sections_created' was always true,     
since dynamic_sections is set to true (by elf_link_create_dynamic_sections )
before elf_gc_sections call.

The full bug report is available at :
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=182910

Best Regards.
-- 
Julien LEMOINE / SpeedBlue

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

* Re: [PATCH] fix "--gc-sections doesn't work on Linux/x86"
  2003-04-19 11:41 ` Alan Modra
@ 2003-04-19 20:43   ` Julien LEMOINE
  0 siblings, 0 replies; 4+ messages in thread
From: Julien LEMOINE @ 2003-04-19 20:43 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

* Alan Modra <amodra@bigpond.net.au> [2003-04-19 21:11:12 +0930]:

> No, we really can't safely garbage collect sections when dynamic
> sections are involved in the link.

Thanks for your answer, I did not know it.

Best Regards.
-- 
Julien LEMOINE / SpeedBlue

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

* Re: [PATCH] fix "--gc-sections doesn't work on Linux/x86"
  2003-04-18 23:48 Julien LEMOINE
@ 2003-04-19 11:41 ` Alan Modra
  2003-04-19 20:43   ` Julien LEMOINE
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2003-04-19 11:41 UTC (permalink / raw)
  To: Julien LEMOINE; +Cc: binutils

On Sat, Apr 19, 2003 at 01:48:35AM +0200, Julien LEMOINE wrote:
>    if (!get_elf_backend_data (abfd)->can_gc_sections
> -      || info->relocateable || info->emitrelocations
> -      || elf_hash_table (info)->dynamic_sections_created)
> +      || info->relocateable || info->emitrelocations)
> +    //      || elf_hash_table (info)->dynamic_sections_created)
>      return TRUE;

No, we really can't safely garbage collect sections when dynamic
sections are involved in the link.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: [PATCH] fix "--gc-sections doesn't work on Linux/x86"
@ 2003-04-18 23:48 Julien LEMOINE
  2003-04-19 11:41 ` Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: Julien LEMOINE @ 2003-04-18 23:48 UTC (permalink / raw)
  To: binutils

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

ooops. I forgot to attach patch, sorry.

Best Regards.
-- 
Julien LEMOINE / SpeedBlue


[-- Attachment #2: binutils-gc.patch --]
[-- Type: text/plain, Size: 905 bytes --]

diff -bBdNrw -U5 binutils-2.13.90.0.18.orig/bfd/elflink.h binutils-2.13.90.0.18/bfd/elflink.h
--- binutils-2.13.90.0.18.orig/bfd/elflink.h	2003-01-21 19:21:32.000000000 +0100
+++ binutils-2.13.90.0.18/bfd/elflink.h	2003-04-17 00:09:34.000000000 +0200
@@ -7849,12 +7849,12 @@
   asection * (*gc_mark_hook)
     PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *,
 	     struct elf_link_hash_entry *h, Elf_Internal_Sym *));
 
   if (!get_elf_backend_data (abfd)->can_gc_sections
-      || info->relocateable || info->emitrelocations
-      || elf_hash_table (info)->dynamic_sections_created)
+      || info->relocateable || info->emitrelocations)
+    //      || elf_hash_table (info)->dynamic_sections_created)
     return TRUE;
 
   /* Apply transitive closure to the vtable entry usage info.  */
   elf_link_hash_traverse (elf_hash_table (info),
 			  elf_gc_propagate_vtable_entries_used,

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

end of thread, other threads:[~2003-04-19 20:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-18 23:42 [PATCH] fix "--gc-sections doesn't work on Linux/x86" Julien LEMOINE
2003-04-18 23:48 Julien LEMOINE
2003-04-19 11:41 ` Alan Modra
2003-04-19 20:43   ` Julien LEMOINE

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