]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ld/ELF: suppress note section rearrangement for relocatable linking
authorJan Beulich <jbeulich@suse.com>
Fri, 9 Jan 2026 07:39:14 +0000 (08:39 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 9 Jan 2026 07:39:14 +0000 (08:39 +0100)
Input sections would generally best retain their order from in the
input(s) or relocatable links. In particular the (odd) sorting of note
sections by alignment is entirely unnecessary there, and could potentially
even be harmful. Simply accumulate orphan sections in the order observed.

Of course this has an effect on section order, so a few testsuite
adjustments are necessary. The test for PR ld/27590 is being relaxed, as
it's no clear why sh_link fields would need to have exact expectations
when at the same time section numbers aren't matched. (Obviously the .rela
sections should match their corresponding data sections', but afaict this
cannot be [easily] expressed.) Xstormy16 XFAILs for a few tests can be
dropped as the sections of interest there are orphan ones, and hence now
are placed independent of the linker scripts unusual placing of .data
ahead of .text.

19 files changed:
ld/ldlang.c
ld/testsuite/ld-elf/group2.d
ld/testsuite/ld-elf/group4.d
ld/testsuite/ld-elf/group5.d
ld/testsuite/ld-elf/group6.d
ld/testsuite/ld-elf/orphan2.d
ld/testsuite/ld-elf/sec64k.exp
ld/testsuite/ld-mips-elf/sections-1-n32.rd
ld/testsuite/ld-mips-elf/sections-1-n32p.rd
ld/testsuite/ld-mips-elf/sections-1-n32t.rd
ld/testsuite/ld-mips-elf/sections-1-n64.rd
ld/testsuite/ld-mips-elf/sections-1-n64t.rd
ld/testsuite/ld-mips-elf/sections-1-o32.rd
ld/testsuite/ld-mips-elf/sections-1-o32t.rd
ld/testsuite/ld-pe/longsecn-3.d
ld/testsuite/ld-pe/longsecn-4.d
ld/testsuite/ld-pe/longsecn-5.d
ld/testsuite/ld-x86-64/pr27590.rd
ld/testsuite/ld-x86-64/split-by-file.rd

index 76a6c621dcbf850f38b3a164d4d681810266f9ab..c1c60b3f47419cfb608e5961eae3aafbb20fc1c0 100644 (file)
@@ -2078,7 +2078,7 @@ lang_insert_orphan (asection *s,
 
       as = *place->section;
 
-      if (!as)
+      if (!as || bfd_link_relocatable (&link_info))
        {
          /* Put the section at the end of the list.  */
 
index 604c685b606e0cbfadda717b7a0519f8b937fc19..08d23d2a48f29d7110e1ca0e790603bde9b78f5e 100644 (file)
@@ -1,8 +1,6 @@
 #source: ../../../binutils/testsuite/binutils-all/group.s
 #ld: -r
 #readelf: -Sg --wide
-# xstormy uses a non-standard script, putting .data before .text.
-#xfail: xstormy*-*-*
 
 #...
   \[[ 0-9]+\] \.group[ \t]+GROUP[ \t]+.*
index 9530300766e9c9e34f698b5d36e5b6871eaf59f6..2364e6b3dbfcccdd37a08545a8fb0135f1e80861 100644 (file)
@@ -1,8 +1,6 @@
 #source: ../../../binutils/testsuite/binutils-all/group-2.s
 #ld: -r
 #readelf: -Sg --wide
-# xstormy uses a non-standard script, putting .data before .text.
-#xfail: xstormy*-*-*
 
 #...
   \[[ 0-9]+\] .group[ \t]+GROUP[ \t]+.*
index b39c5690cc593802ee5d55e87b0921eccf917f4e..4b952275496e878a28ab056909d45786d41fcae8 100644 (file)
@@ -1,8 +1,6 @@
 #source: ../../../binutils/testsuite/binutils-all/group-3.s
 #ld: -r
 #readelf: -Sg --wide
-# xstormy uses a non-standard script, putting .data before .text.
-#xfail: xstormy*-*-*
 
 #...
   \[[ 0-9]+\] .group[ \t]+GROUP[ \t]+.*
index a495eac733e5d08cd02101a362de373cdb740e29..5010f09bb03ff8776f1004333d7519c381c7201d 100644 (file)
@@ -1,8 +1,6 @@
 #source: ../../../binutils/testsuite/binutils-all/group-4.s
 #ld: -r
 #readelf: -Sg --wide
-# xstormy uses a non-standard script, putting .data before .text.
-#xfail: xstormy*-*-*
 
 #...
   \[[ 0-9]+\] .group[ \t]+GROUP[ \t]+.*
index ddf69c7472ea0f4bc084588c22200bc6544a5995..a82e721775346797dab9ed102cb5b610f66da52d 100644 (file)
@@ -1,8 +1,6 @@
 #source: orphan2.s
 #ld: -r
 #readelf: -S --wide
-#xfail: xstormy*-*-*
-# xstormy uses a non-standard script, resulting is unexpected section order
 
 #...
   \[[ 0-9]+\] \.text[ \t]+PROGBITS[ \t0-9a-f]+AX?.*
index 84496e24ee0552aa941bb738973269944a84a4a2..724346382a1dd88fd9664b83d21d04da92f3942f 100644 (file)
@@ -147,7 +147,7 @@ if { ![istarget "m32r-*-*"] } then {
     puts $ofd "#..."
     puts $ofd " 340..: 0+\[ \]+0\[ \]+SECTION\[ \]+LOCAL\[ \]+DEFAULT\[ \]+68... .*"
     puts $ofd "#..."
-    puts $ofd " 340..: 0+(2|4|8)\[ \]+0\[ \]+NOTYPE\[ \]+LOCAL\[ \]+DEFAULT\[ \]+\[2-7\] bar_1$"
+    puts $ofd " 340..: 0+(2|4|8)\[ \]+0\[ \]+NOTYPE\[ \]+LOCAL\[ \]+DEFAULT\[ \]+\[2-8\] bar_1$"
     puts $ofd "#..."
     puts $ofd ".* bar_34000$"
     puts $ofd "#..."
index ee7043bad6fb3d8a1993eafb9e17b5af471327f8..106e079bda4a6ea05a157f921d40652c2296b21b 100644 (file)
@@ -17,6 +17,7 @@ Section Headers:
   \[..\] \.lit4 +PROGBITS .*
   \[..\] \.sbss +NOBITS .*
   \[..\] \.bss +NOBITS .*
+  \[..\] \.gnu\.attributes +GNU_ATTRIBUTES .*
   \[..\] \.pdr +PROGBITS .*
   \[..\] \.gcc_compiled_long32 +PROGBITS .*
   \[..\] \.gcc_compiled_long64 +PROGBITS .*
@@ -28,7 +29,6 @@ Section Headers:
   \[..\] \.mdebug\.abiO64 +PROGBITS .*
   \[..\] \.mdebug\.eabi32 +PROGBITS .*
   \[..\] \.mdebug\.eabi64 +PROGBITS .*
-  \[..\] \.gnu\.attributes +GNU_ATTRIBUTES .*
   \[..\] \.symtab +SYMTAB .*
   \[..\] \.strtab +STRTAB .*
   \[..\] \.shstrtab +STRTAB .*
index 3e210acd4377b09e437d2a5727808d6ba15c3431..784012563b7d2329cc293bbb9598a01b1c12200c 100644 (file)
@@ -17,6 +17,9 @@ Section Headers:
   \[..\] \.lit4 +PROGBITS .*
   \[..\] \.sbss +NOBITS .*
   \[..\] \.bss +NOBITS .*
+  \[..\] \.gnu\.attributes +GNU_ATTRIBUTES .*
+  \[..\] \.gptab\.sdata +MIPS_GPTAB .*
+  \[..\] \.gptab\.sbss +MIPS_GPTAB .*
   \[..\] \.pdr +PROGBITS .*
   \[..\] \.gcc_compiled_long32 +PROGBITS .*
   \[..\] \.gcc_compiled_long64 +PROGBITS .*
@@ -26,9 +29,6 @@ Section Headers:
   \[..\] \.mdebug\.abiO64 +PROGBITS .*
   \[..\] \.mdebug\.eabi32 +PROGBITS .*
   \[..\] \.mdebug\.eabi64 +PROGBITS .*
-  \[..\] \.gnu\.attributes +GNU_ATTRIBUTES .*
-  \[..\] \.gptab\.sdata +MIPS_GPTAB .*
-  \[..\] \.gptab\.sbss +MIPS_GPTAB .*
   \[..\] \.symtab +SYMTAB .*
   \[..\] \.strtab +STRTAB .*
   \[..\] \.shstrtab +STRTAB .*
index 3e210acd4377b09e437d2a5727808d6ba15c3431..784012563b7d2329cc293bbb9598a01b1c12200c 100644 (file)
@@ -17,6 +17,9 @@ Section Headers:
   \[..\] \.lit4 +PROGBITS .*
   \[..\] \.sbss +NOBITS .*
   \[..\] \.bss +NOBITS .*
+  \[..\] \.gnu\.attributes +GNU_ATTRIBUTES .*
+  \[..\] \.gptab\.sdata +MIPS_GPTAB .*
+  \[..\] \.gptab\.sbss +MIPS_GPTAB .*
   \[..\] \.pdr +PROGBITS .*
   \[..\] \.gcc_compiled_long32 +PROGBITS .*
   \[..\] \.gcc_compiled_long64 +PROGBITS .*
@@ -26,9 +29,6 @@ Section Headers:
   \[..\] \.mdebug\.abiO64 +PROGBITS .*
   \[..\] \.mdebug\.eabi32 +PROGBITS .*
   \[..\] \.mdebug\.eabi64 +PROGBITS .*
-  \[..\] \.gnu\.attributes +GNU_ATTRIBUTES .*
-  \[..\] \.gptab\.sdata +MIPS_GPTAB .*
-  \[..\] \.gptab\.sbss +MIPS_GPTAB .*
   \[..\] \.symtab +SYMTAB .*
   \[..\] \.strtab +STRTAB .*
   \[..\] \.shstrtab +STRTAB .*
index 57323de23e3b31552a6129a11a5ad3c1f203240d..86b543136d7e29cb7b2f391b863c453fe6fd2fd8 100644 (file)
@@ -17,6 +17,7 @@ Section Headers:
   \[..\] \.lit4 +PROGBITS .*
   \[..\] \.sbss +NOBITS .*
   \[..\] \.bss +NOBITS .*
+  \[..\] \.gnu\.attributes +GNU_ATTRIBUTES .*
   \[..\] \.pdr +PROGBITS .*
   \[..\] \.gcc_compiled_long32 +PROGBITS .*
   \[..\] \.gcc_compiled_long64 +PROGBITS .*
@@ -28,7 +29,6 @@ Section Headers:
   \[..\] \.mdebug\.abiO64 +PROGBITS .*
   \[..\] \.mdebug\.eabi32 +PROGBITS .*
   \[..\] \.mdebug\.eabi64 +PROGBITS .*
-  \[..\] \.gnu\.attributes +GNU_ATTRIBUTES .*
   \[..\] \.symtab +SYMTAB .*
   \[..\] \.strtab +STRTAB .*
   \[..\] \.shstrtab +STRTAB .*
index 3852b62e808d5e2af669bca58ec7208add14248d..4ae146b8302a699a69d10da92269e28d53beb687 100644 (file)
@@ -17,6 +17,9 @@ Section Headers:
   \[..\] \.lit4 +PROGBITS .*
   \[..\] \.sbss +NOBITS .*
   \[..\] \.bss +NOBITS .*
+  \[..\] \.gnu\.attributes +GNU_ATTRIBUTES .*
+  \[..\] \.gptab\.sdata +MIPS_GPTAB .*
+  \[..\] \.gptab\.sbss +MIPS_GPTAB .*
   \[..\] \.pdr +PROGBITS .*
   \[..\] \.gcc_compiled_long32 +PROGBITS .*
   \[..\] \.gcc_compiled_long64 +PROGBITS .*
@@ -26,9 +29,6 @@ Section Headers:
   \[..\] \.mdebug\.abiO64 +PROGBITS .*
   \[..\] \.mdebug\.eabi32 +PROGBITS .*
   \[..\] \.mdebug\.eabi64 +PROGBITS .*
-  \[..\] \.gnu\.attributes +GNU_ATTRIBUTES .*
-  \[..\] \.gptab\.sdata +MIPS_GPTAB .*
-  \[..\] \.gptab\.sbss +MIPS_GPTAB .*
   \[..\] \.symtab +SYMTAB .*
   \[..\] \.strtab +STRTAB .*
   \[..\] \.shstrtab +STRTAB .*
index 5a601e64dfaa12e06b35fe29b7dabd78b7956481..a9a4cd08f010b5cf5c9804041f298ec1b3961546 100644 (file)
@@ -17,7 +17,6 @@ Section Headers:
   \[..\] \.lit4 +PROGBITS .*
   \[..\] \.sbss +NOBITS .*
   \[..\] \.bss +NOBITS .*
-  \[..\] \.pdr +PROGBITS .*
   \[..\] \.gnu\.attributes +GNU_ATTRIBUTES .*
   \[..\] \.gptab\.sdata +MIPS_GPTAB .*
   \[..\] \.gptab\.sbss +MIPS_GPTAB .*
@@ -29,6 +28,7 @@ Section Headers:
   \[..\] \.mdebug\.eabi64 +PROGBITS .*
   \[..\] \.gcc_compiled_long32 +PROGBITS .*
   \[..\] \.gcc_compiled_long64 +PROGBITS .*
+  \[..\] \.pdr +PROGBITS .*
   \[..\] \.symtab +SYMTAB .*
   \[..\] \.strtab +STRTAB .*
   \[..\] \.shstrtab +STRTAB .*
index 29daf27eff48692e53b08ac8d4580204c03193dd..da3fa08d3069f4ab31a5d56c579f99f60a006c55 100644 (file)
@@ -17,7 +17,6 @@ Section Headers:
   \[..\] \.lit4 +PROGBITS .*
   \[..\] \.sbss +NOBITS .*
   \[..\] \.bss +NOBITS .*
-  \[..\] \.pdr +PROGBITS .*
   \[..\] \.gnu\.attributes +GNU_ATTRIBUTES .*
   \[..\] \.gptab\.sdata +MIPS_GPTAB .*
   \[..\] \.gptab\.sbss +MIPS_GPTAB .*
@@ -29,6 +28,7 @@ Section Headers:
   \[..\] \.mdebug\.eabi64 +PROGBITS .*
   \[..\] \.gcc_compiled_long32 +PROGBITS .*
   \[..\] \.gcc_compiled_long64 +PROGBITS .*
+  \[..\] \.pdr +PROGBITS .*
   \[..\] \.symtab +SYMTAB .*
   \[..\] \.strtab +STRTAB .*
   \[..\] \.shstrtab +STRTAB .*
index c86a828db95393d102cdd0479747af0b1b97c3ea..13391f984af109b7e7da59e7c116f6b6a05e668e 100644 (file)
@@ -7,34 +7,31 @@
 
 Sections:
 Idx Name          Size      VMA +LMA +File off  Algn
-  0 \.(text|bss )         [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
-                  (CONTENTS, ALLOC, LOAD, (READONLY, )?CODE|ALLOC)
-  1 \.text\.very\.long\.section\.name [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
+#...
+ *[0-9]+ \.text\.very\.long\.section\.name [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, READONLY, CODE, DATA
-  2 \.data         [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
-                  CONTENTS, ALLOC, LOAD, DATA
-  3 \.data\$1       [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
+ *[0-9]+ \.data\$1       [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 4 \.rodata\$1     [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.rodata\$1     [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 5 \.data\$123     [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.data\$123     [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 6 \.rodata\$123   [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.rodata\$123   [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 7 \.data\$123456789 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.data\$123456789 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 8 \.rodata\$123456789 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.rodata\$123456789 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 9 \.data\.very\.long\.section [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.data\.very\.long\.section [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
10 \.rodata\.very\.long\.section [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.rodata\.very\.long\.section [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
11 \.data\.very\.long\.section\$1 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.data\.very\.long\.section\$1 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
12 \.rodata\.very\.long\.section\$1 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.rodata\.very\.long\.section\$1 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
13 \.data\.very\.long\.section\$1234 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.data\.very\.long\.section\$1234 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
14 \.rodata\.very\.long\.section\$1234 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.rodata\.very\.long\.section\$1234 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 #...
index e326d98e80758e12f60ef21372b58af969ebbe10..ce1e9185c6715c2ebaf5328d0b9950a61a1d99af 100644 (file)
@@ -7,34 +7,31 @@
 
 Sections:
 Idx Name          Size      VMA +LMA +File off  Algn
-  0 \.(text|bss )         [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
-                  (CONTENTS, ALLOC, LOAD, (READONLY, )?CODE|ALLOC)
-  1 \.text\.ve      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
+#...
+ *[0-9]+ \.text\.ve      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, READONLY, CODE, DATA
-  2 \.data         [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
-                  CONTENTS, ALLOC, LOAD, DATA
-  3 \.data\$1       [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
+ *[0-9]+ \.data\$1       [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 4 \.rodata\$      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.rodata\$      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 5 \.data\$12      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.data\$12      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 6 \.rodata\$      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.rodata\$      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 7 \.data\$12      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.data\$12      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 8 \.rodata\$      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.rodata\$      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 9 \.data\.ve      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.data\.ve      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
10 \.rodata\.      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.rodata\.      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
11 \.data\.ve      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.data\.ve      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
12 \.rodata\.      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.rodata\.      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
13 \.data\.ve      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.data\.ve      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
14 \.rodata\.      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.rodata\.      [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 #...
index f3ef22bd9a478cd19e6e33f946bd59a01cbe4140..7f753cd1f5a8d1f582afa37297fc433f7e8bca5c 100644 (file)
@@ -7,34 +7,31 @@
 
 Sections:
 Idx Name          Size      VMA +LMA +File off  Algn
-  0 \.(text|bss )         [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
-                  (CONTENTS, ALLOC, LOAD, (READONLY, )?CODE|ALLOC)
-  1 \.text\.very\.long\.section\.name [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
+#...
+ *[0-9]+ \.text\.very\.long\.section\.name [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, READONLY, CODE, DATA
-  2 \.data         [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
-                  CONTENTS, ALLOC, LOAD, DATA
-  3 \.data\$1       [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
+ *[0-9]+ \.data\$1       [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 4 \.rodata\$1     [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.rodata\$1     [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 5 \.data\$123     [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.data\$123     [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 6 \.rodata\$123   [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.rodata\$123   [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 7 \.data\$123456789 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.data\$123456789 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 8 \.rodata\$123456789 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.rodata\$123456789 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 9 \.data\.very\.long\.section [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.data\.very\.long\.section [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
10 \.rodata\.very\.long\.section [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.rodata\.very\.long\.section [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
11 \.data\.very\.long\.section\$1 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.data\.very\.long\.section\$1 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
12 \.rodata\.very\.long\.section\$1 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.rodata\.very\.long\.section\$1 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
13 \.data\.very\.long\.section\$1234 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.data\.very\.long\.section\$1234 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
14 \.rodata\.very\.long\.section\$1234 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
*[0-9]+ \.rodata\.very\.long\.section\$1234 [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
                   CONTENTS, ALLOC, LOAD, DATA
 #...
index 55ed17d6f7e46031eb01318c916d8b034bc9f814..925177689379f6080e53fe29b2e4e106584a84e7 100644 (file)
@@ -1,11 +1,11 @@
 #...
   \[[ 0-9]+\] .gnu.debuglto_.debug_info PROGBITS +0+ [0-9a-f]+ 0+42 00 +E  0 +0  1
-  \[[ 0-9]+\] .rela.gnu.debuglto_.debug_info RELA +0+ [0-9a-f]+ 0+f0 18 +I 26  17  8
+  \[[ 0-9]+\] .rela.gnu.debuglto_.debug_info RELA +0+ [0-9a-f]+ 0+f0 18 +I 26 +[1-9][0-9]*  8
   \[[ 0-9]+\] .gnu.debuglto_.debug_abbrev PROGBITS +0+ [0-9a-f]+ 0+26 00 +E  0 +0  1
   \[[ 0-9]+\] .gnu.debuglto_.debug_macro PROGBITS +0+ [0-9a-f]+ 0+2a 00 +E  0 +0  1
-  \[[ 0-9]+\] .rela.gnu.debuglto_.debug_macro RELA +0+ [0-9a-f]+ 0+60 18 +I 26  20  8
+  \[[ 0-9]+\] .rela.gnu.debuglto_.debug_macro RELA +0+ [0-9a-f]+ 0+60 18 +I 26 +[1-9][0-9]*  8
   \[[ 0-9]+\] .gnu.debuglto_.debug_macro PROGBITS +0+ [0-9a-f]+ 0+10 00  GE  0 +0  1
-  \[[ 0-9]+\] .rela.gnu.debuglto_.debug_macro RELA +0+ [0-9a-f]+ 0+30 18  IG 26  22  8
+  \[[ 0-9]+\] .rela.gnu.debuglto_.debug_macro RELA +0+ [0-9a-f]+ 0+30 18  IG 26 +[1-9][0-9]*  8
   \[[ 0-9]+\] .gnu.debuglto_.debug_line PROGBITS +0+ [0-9a-f]+ 0+8a 00 +E  0 +0  1
   \[[ 0-9]+\] .gnu.debuglto_.debug_str PROGBITS +0+ [0-9a-f]+ 0+15c 01 MSE  0 +0  1
 #pass
index 4e3e74a2e759dc2d0739b2253b6a5564e1159b24..b6d109e081104e0d9667297ad6e3604d92e7d929 100644 (file)
@@ -4,9 +4,9 @@ Section Headers:
   \[Nr\] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
   \[ 0\]                   NULL            0000000000000000 000000 000000 00      0   0  0
   \[ 1\] .text             PROGBITS        0000000000000000 000040 000000 00  AX  0   0  1
-  \[ 2\] .foo              PROGBITS        0000000000000000 000040 000003 00 AXl  0   0  1
-  \[ 3\] .data             PROGBITS        0000000000000000 000043 000000 00  WA  0   0  1
-  \[ 4\] .bss              NOBITS          0000000000000000 000043 000000 00  WA  0   0  1
+  \[ 2\] .data             PROGBITS        0000000000000000 000040 000000 00  WA  0   0  1
+  \[ 3\] .bss              NOBITS          0000000000000000 000040 000000 00  WA  0   0  1
+  \[ 4\] .foo              PROGBITS        0000000000000000 000040 000003 00 AXl  0   0  1
   \[ 5\] .foo.0            PROGBITS        0000000000000003 000043 000003 00 AXl  0   0  1
   \[ 6\] .symtab           SYMTAB          0000000000000000 [0-9a-f]+ [0-9a-f]+ 18      7   [0-9]  8
   \[ 7\] .strtab           STRTAB          0000000000000000 [0-9a-f]+ [0-9a-f]+ 00      0   0  1