aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-11-12 11:31:43 +0000
committerAlan Modra <amodra@gmail.com>2002-11-12 11:31:43 +0000
commitc4c41219636642438223c7b46a2c8e1467faba06 (patch)
treea0c3c81637b07a0dda2d9ba442441d8421bf81d5 /ld/ldlang.c
parentcd24c22246aa385256a99c15cae19c73af9e64e3 (diff)
downloadgdb-c4c41219636642438223c7b46a2c8e1467faba06.zip
gdb-c4c41219636642438223c7b46a2c8e1467faba06.tar.gz
gdb-c4c41219636642438223c7b46a2c8e1467faba06.tar.bz2
* ldlang.c (lang_add_section): Discard debugging sections that have
been marked SEC_EXCLUDE.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 1b00705..80ba0c8 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