aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2004-05-27 05:53:36 +0000
committerH.J. Lu <hjl.tools@gmail.com>2004-05-27 05:53:36 +0000
commitb30962503862fcef0e3c550d4b652b2318e8684a (patch)
treee5c2134c9b2c5fa702f16eb71ddd6e80da1c5e78 /ld/ldlang.c
parent9bb351fd9cfb5adf3630f433486727808fe994e7 (diff)
downloadgdb-b30962503862fcef0e3c550d4b652b2318e8684a.zip
gdb-b30962503862fcef0e3c550d4b652b2318e8684a.tar.gz
gdb-b30962503862fcef0e3c550d4b652b2318e8684a.tar.bz2
bfd/
2004-05-26 H.J. Lu <hongjiu.lu@intel.com> * elf.c (_bfd_elf_make_section_from_shdr): Undo the last change. ld/ 2004-05-26 H.J. Lu <hongjiu.lu@intel.com> * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Clear SEC_EXCLUDE on non-SEC_DEBUGGING sections for relocatable link. * ldlang.c (lang_add_section): Likewise.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 34cff0f..b4c2559 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -1094,29 +1094,20 @@ lang_add_section (lang_statement_list_type *ptr,
flags = bfd_get_section_flags (section->owner, section);
- discard = FALSE;
-
- if (link_info.relocatable)
- {
- /* SEC_EXCLUDE is ignored when doing a relocatable link,
- except in the special case of debug info. (See bfd/stabs.c) */
- if ((flags & SEC_DEBUGGING) == 0)
- flags &= ~SEC_EXCLUDE;
- }
- else
+ /* SEC_EXCLUDE is ignored when doing a relocatable link, except in
+ the special case of debug info. (See bfd/stabs.c) */
+ if (link_info.relocatable && (flags & SEC_DEBUGGING) == 0)
{
- /* SEC_GROUP sections should be dropped on a final link. */
- if ((flags & SEC_GROUP) != 0)
- flags |= SEC_EXCLUDE;
- }
+ flags &= ~SEC_EXCLUDE;
- /* Write SEC_EXCLUDE flag back, to simplify later linker code. */
- if (section->owner != NULL)
- bfd_set_section_flags (section->owner, section, flags);
+ /* Write the modified flag back, to simplify later linker
+ code. */
+ if (section->owner != NULL)
+ bfd_set_section_flags (section->owner, section, flags);
+ }
/* Discard sections marked with SEC_EXCLUDE. */
- if ((flags & SEC_EXCLUDE) != 0)
- discard = TRUE;
+ discard = (flags & SEC_EXCLUDE) != 0;
/* Discard input sections which are assigned to a section named
DISCARD_SECTION_NAME. */