]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
bfd/
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 27 May 2004 05:53:36 +0000 (05:53 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 27 May 2004 05:53:36 +0000 (05:53 +0000)
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.

bfd/ChangeLog
bfd/elf.c
ld/ChangeLog
ld/emultempl/elf32.em
ld/ldlang.c

index c7562b67f48d98625d48cf0218a1b7f31f63b20e..d74795f446def4a0f5a0a9d547913e067591835f 100644 (file)
@@ -1,3 +1,8 @@
+2004-05-26  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elf.c (_bfd_elf_make_section_from_shdr): Undo the last
+       change.
+
 2004-05-27  Alexandre Oliva  <aoliva@redhat.com>
 
        * elf-m10300.c (mn10300_elf_relax_section): Don't test isym within
index 61f5f57836816ad47a0637f37c287b5fc8b3da60..93a3d3ac9f837c6c0deacae5a53378efcdb65430 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -677,7 +677,7 @@ _bfd_elf_make_section_from_shdr (bfd *abfd,
   if (hdr->sh_type != SHT_NOBITS)
     flags |= SEC_HAS_CONTENTS;
   if (hdr->sh_type == SHT_GROUP)
-    flags |= SEC_GROUP;
+    flags |= SEC_GROUP | SEC_EXCLUDE;
   if ((hdr->sh_flags & SHF_ALLOC) != 0)
     {
       flags |= SEC_ALLOC;
index 6c34103c7c4b34c06515225839a5ceee05fc2339..b0b7158daedc682653a36cb89a5125137ecbbe91 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2004-05-26  Alan Modra  <amodra@bigpond.net.au>
 
        * ldlang.c (lang_add_section): Set SEC_EXCLUDE for SEC_GROUP
index 89c5d5d0e55a83abfb8d309f3e5d9f0869ab12c7..9950649e05d1c132781549ea1de665e2bdc08f8c 100644 (file)
@@ -1182,9 +1182,10 @@ gld${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s)
 #define HAVE_SECTION(hold, name) \
 (hold.os != NULL || (hold.os = lang_output_section_find (name)) != NULL)
 
-  if (((s->flags & (SEC_EXCLUDE | SEC_GROUP)) != 0 && !link_info.relocatable)
-      || ((s->flags & (SEC_EXCLUDE | SEC_DEBUGGING))
-         == (SEC_EXCLUDE | SEC_DEBUGGING)))
+  if (link_info.relocatable && (s->flags & SEC_DEBUGGING) == 0)
+    s->flags &= ~SEC_EXCLUDE;
+
+  if ((s->flags & SEC_EXCLUDE) != 0)
     {
       if (s->output_section == NULL)
        s->output_section = bfd_abs_section_ptr;
index 34cff0f762aa8375abf352b63f42759839e9e0cd..b4c25599cea5c70e8c5af343919be0434d070ac3 100644 (file)
@@ -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.  */