From: Alan Modra Date: Tue, 12 Nov 2002 11:31:43 +0000 (+0000) Subject: * ldlang.c (lang_add_section): Discard debugging sections that have X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c4c41219636642438223c7b46a2c8e1467faba06;p=binutils-gdb.git * ldlang.c (lang_add_section): Discard debugging sections that have been marked SEC_EXCLUDE. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 2b76d2a5ced..0e37adbe823 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2002-11-12 Earl Chew + + * ldlang.c (lang_add_section): Discard debugging sections that have + been marked SEC_EXCLUDE. + 2002-11-12 Nick Clifton * configure.in (ALL_LINGUAS): Add da. diff --git a/ld/ldlang.c b/ld/ldlang.c index 1b00705febb..80ba0c887fc 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -1138,10 +1138,11 @@ lang_add_section (ptr, section, output, file) 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