This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: editing stabs and eh_frame during ld -r
On Tue, Nov 12, 2002 at 06:22:25PM +1030, Alan Modra wrote:
> This final patch enables stabs and eh_frame editing during relocatable
Forgot one. Done a little differently than Earl's submitted patch,
but the idea is the same.
2002-11-12 Earl Chew <earl_chew@agilent.com>
* ldlang.c (lang_add_section): Discard debugging sections that have
been marked SEC_EXCLUDE.
Index: ld/ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.103
diff -u -p -r1.103 ldlang.c
--- ld/ldlang.c 30 Oct 2002 03:57:38 -0000 1.103
+++ ld/ldlang.c 12 Nov 2002 11:29:19 -0000
@@ -1138,10 +1138,11 @@ lang_add_section (ptr, section, output,
discard = false;
- /* If we are doing a final link, discard sections marked with
- SEC_EXCLUDE. */
- if (! link_info.relocateable
- && (flags & SEC_EXCLUDE) != 0)
+ /* Discard sections marked with SEC_EXCLUDE if we are doing a final
+ link. Discard debugging sections marked with SEC_EXCLUDE on a
+ relocatable link too. */
+ if ((flags & SEC_EXCLUDE) != 0
+ && ((flags & SEC_DEBUGGING) != 0 || !link_info.relocateable))
discard = true;
/* Discard input sections which are assigned to a section named
--
Alan Modra
IBM OzLabs - Linux Technology Centre