[RFC PATCH] Enabling ld -r ELF .stab/.stabstr optimization
Earl Chew
earl_chew@agilent.com
Thu Sep 26 02:50:00 GMT 2002
Here is a patch to enable .stab/.stabstr optimization in the presence
of ld -r. This patch was generated against binutils-2.10.1 --- sorry
the baseline is a little dated, but that's what I'm running.
* bfd/elflink.h (elf_link_add_object_symbols): optimize .stabstr
even if relocatable
* ld/ldlang.c (wild_doit): discard debugging sections that have
been marked SEC_EXCLUDE
--- elflink.h Mon Oct 22 21:45:07 2001
+++ ../../xbinutils/bfd/elflink.h Wed Sep 25 14:50:07 2002
@@ -2005,10 +2005,9 @@
}
}
- /* If this is a non-traditional, non-relocateable link, try to
- optimize the handling of the .stab/.stabstr sections. */
+ /* If this is a non-traditional link try to optimize the handling
+ of the .stab/.stabstr sections. */
if (! dynamic
- && ! info->relocateable
&& ! info->traditional_format
&& info->hash->creator->flavour == bfd_target_elf_flavour
&& (info->strip != strip_all && info->strip != strip_debugger))
--- ldlang.c Thu Oct 25 10:52:25 2001
+++ ../../xbinutils/ld/ldlang.c Wed Sep 25 21:28:37 2002
@@ -1101,9 +1101,11 @@
discard = true;
/* Discard debugging sections if we are stripping debugging
- information. */
- if ((link_info.strip == strip_debugger || link_info.strip == strip_all)
- && (flags & SEC_DEBUGGING) != 0)
+ information or if marked with SEC_EXCLUDE. */
+ if ((flags & SEC_DEBUGGING) != 0
+ && (link_info.strip == strip_debugger
+ || link_info.strip == strip_all
+ || (flags & SEC_EXCLUDE) != 0))
discard = true;
if (discard)
More information about the Binutils
mailing list