2004-11-24 Paul Brook <paul@codesourcery.com>
authorPaul Brook <paul@codesourcery.com>
Thu, 25 Nov 2004 00:56:00 +0000 (00:56 +0000)
committerPaul Brook <paul@codesourcery.com>
Thu, 25 Nov 2004 00:56:00 +0000 (00:56 +0000)
bfd/
* elf.c (assign_section_numbers): Number SHT_GROUP sections first.
gas/testsuite/
* gas/elf/group0a.d: Adjust expected secion ordering.
* gas/elf/group1a.d: Ditto.
* gas/elf/section4.d: Ditto.

bfd/ChangeLog
bfd/elf.c
gas/testsuite/ChangeLog
gas/testsuite/gas/elf/group0a.d
gas/testsuite/gas/elf/group1a.d
gas/testsuite/gas/elf/section4.d

index a92af7be08d6d2def6675a089650021330b6226c..69ae520085ed984c08045598612135ff789d958f 100644 (file)
@@ -1,3 +1,7 @@
+2004-11-24  Paul Brook  <paul@codesourcery.com>
+
+       * elf.c (assign_section_numbers): Number SHT_GROUP sections first.
+
 2004-11-24  Paul Brook  <paul@codesourcery.com>
 
        * elf32-arm.c (elf32_arm_swap_symbol_in): New function.
index dcb5c3d586a32d095d266cba41710001a00307f5..ff322bbcbd2998eea555bc217ef5abcd06b5f30c 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -2725,18 +2725,35 @@ assign_section_numbers (bfd *abfd)
   unsigned int section_number, secn;
   Elf_Internal_Shdr **i_shdrp;
   bfd_size_type amt;
+  struct bfd_elf_section_data *d;
 
   section_number = 1;
 
   _bfd_elf_strtab_clear_all_refs (elf_shstrtab (abfd));
 
+  /* Put SHT_GROUP sections first.  */
   for (sec = abfd->sections; sec; sec = sec->next)
     {
-      struct bfd_elf_section_data *d = elf_section_data (sec);
+      d = elf_section_data (sec);
 
-      if (section_number == SHN_LORESERVE)
-       section_number += SHN_HIRESERVE + 1 - SHN_LORESERVE;
-      d->this_idx = section_number++;
+      if (d->this_hdr.sh_type == SHT_GROUP)
+       {
+         if (section_number == SHN_LORESERVE)
+           section_number += SHN_HIRESERVE + 1 - SHN_LORESERVE;
+         d->this_idx = section_number++;
+       }
+    }
+
+  for (sec = abfd->sections; sec; sec = sec->next)
+    {
+      d = elf_section_data (sec);
+
+      if (d->this_hdr.sh_type != SHT_GROUP)
+       {
+         if (section_number == SHN_LORESERVE)
+           section_number += SHN_HIRESERVE + 1 - SHN_LORESERVE;
+         d->this_idx = section_number++;
+       }
       _bfd_elf_strtab_addref (elf_shstrtab (abfd), d->this_hdr.sh_name);
       if ((sec->flags & SEC_RELOC) == 0)
        d->rel_idx = 0;
index eb3ebd45c0cbfe7323392156ce19044d1afb3ab1..a8514c05aa3dccc2cc5e6409fa190a775c2eebf1 100644 (file)
@@ -1,3 +1,9 @@
+2004-11-24  Paul Brook  <paul@codesourcery.com>
+
+       * gas/elf/group0a.d: Adjust expected secion ordering.
+       * gas/elf/group1a.d: Ditto.
+       * gas/elf/section4.d: Ditto.
+
 2004-11-24  Nick Clifton  <nickc@redhat.com>
 
        * gas/iq2000/allinsn.exp: Remove IQ10 tests.
index 9b2b967bab9ea1fd1ea9c64eef5b3e7d64b47d48..8aedc0caa4f9875ba781345d81ca4c8706cd2523 100644 (file)
@@ -2,8 +2,9 @@
 #name: group section
 #source: group0.s
 
+#...
+[      ]*\[.*\][       ]+\.foo_group[  ]+GROUP.*
 #...
 [      ]*\[.*\][       ]+\.foo[        ]+PROGBITS.*[   ]+AXG[  ]+.*
 [      ]*\[.*\][       ]+\.bar[        ]+PROGBITS.*[   ]+AG[   ]+.*
-[      ]*\[.*\][       ]+\.foo_group[  ]+GROUP.*
 #pass
index 2db4033afea9361a505acb925073e85a3bff1f26..a5b3298757480adcb882902071927d9077c055f6 100644 (file)
@@ -2,9 +2,10 @@
 #name: group section with multiple sections of same name
 #source: group1.s
 
+#...
+[      ]*\[.*\][       ]+\.foo_group[  ]+GROUP.*
 #...
 [      ]*\[.*\][       ]+\.text[       ]+PROGBITS.*[   ]+AX[   ]+.*
 #...
 [      ]*\[.*\][       ]+\.text[       ]+PROGBITS.*[   ]+AXG[  ]+.*
-[      ]*\[.*\][       ]+\.foo_group[  ]+GROUP.*
 #pass
index 2e417e7de6f7d7b1420e15b996185e1cb625dc80..5cda69ba7351964dfedcccc02630cc996cf66b10 100644 (file)
@@ -1,12 +1,12 @@
 #readelf: --sections
 #name: label arithmetic with multiple same-name sections
 
+#...
+[      ]*\[.*\][       ]+foo[  ]+GROUP.*
 #...
 [      ]*\[.*\][       ]+\.text[       ]+PROGBITS.*
 #...
 [      ]*\[.*\][       ]+\.data[       ]+PROGBITS.*
 #...
 [      ]*\[.*\][       ]+\.text[       ]+PROGBITS.*
-#...
-[      ]*\[.*\][       ]+foo[  ]+GROUP.*
 #pass
This page took 0.044825 seconds and 4 git commands to generate.