]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PE LD: Merge .CRT .ctors and .dtors into .rdata
authorLiu Hao <lh_mouse@126.com>
Wed, 27 Nov 2024 14:27:53 +0000 (14:27 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 27 Nov 2024 14:27:53 +0000 (14:27 +0000)
PR 32264

17 files changed:
bfd/peXXigen.c
ld/scripttempl/pe.sc
ld/scripttempl/pep.sc
ld/testsuite/ld-pe/aarch64.d
ld/testsuite/ld-pe/longsecn-1.d
ld/testsuite/ld-pe/longsecn-2.d
ld/testsuite/ld-pe/longsecn.d
ld/testsuite/ld-pe/orphan.d
ld/testsuite/ld-pe/orphan_nu.d
ld/testsuite/ld-pe/pdb2-section-contrib.d
ld/testsuite/ld-pe/pe-aarch64.d
ld/testsuite/ld-pe/secidx.d
ld/testsuite/ld-pe/secidx_64.d
ld/testsuite/ld-pe/secidx_aarch64.d
ld/testsuite/ld-pe/secrel.d
ld/testsuite/ld-pe/secrel_64.d
ld/testsuite/ld-pe/tlssec64.d

index c09d16ed0c0faa6e129778a67dbf5d9afcbd7104..2f81a59e8cfb9a981312deeb1857293c415cd4e5 100644 (file)
@@ -995,11 +995,12 @@ _bfd_XXi_swap_scnhdr_out (bfd * abfd, void * in, void * out)
 
     pe_required_section_flags known_sections [] =
       {
+       { ".CRT",   IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA },
        { ".arch",  IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_DISCARDABLE | IMAGE_SCN_ALIGN_8BYTES },
        { ".bss",   IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_UNINITIALIZED_DATA | IMAGE_SCN_MEM_WRITE },
        { ".data",  IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_WRITE },
        { ".edata", IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA },
-       { ".idata", IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_WRITE },
+       { ".idata", IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA },
        { ".pdata", IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA },
        { ".rdata", IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA },
        { ".reloc", IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_DISCARDABLE },
index 70f5194b02f4944a5b7074ab6d21539666867346..75730a5b2c79cc220aa0904fee78f46693c5ef41 100644 (file)
@@ -44,6 +44,7 @@ if test "${RELOCATING}"; then
   R_CRT_XL='KEEP (*(SORT(.CRT$XL*)))  /* TLS callbacks */'
   R_CRT_XP='KEEP (*(SORT(.CRT$XP*)))  /* Pre-termination */'
   R_CRT_XT='KEEP (*(SORT(.CRT$XT*)))  /* Termination */'
+  R_CRT_XD='KEEP (*(SORT(.CRT$XD*)))  /* Dynamic TLS Initializer */'
   R_TLS='
     KEEP (*(.tls$AAA))
     KEEP (*(.tls))
@@ -65,6 +66,7 @@ else
   R_CRT_XL=
   R_CRT_XP=
   R_CRT_XT=
+  R_CRT_XD=
   R_TLS='*(.tls)'
   R_RSRC='*(.rsrc)'
 fi
@@ -97,6 +99,40 @@ SECTIONS
     ${RELOCATING+ *(.gnu.linkonce.t.*)}
     ${RELOCATING+*(.glue_7t)}
     ${RELOCATING+*(.glue_7)}
+    ${RELOCATING+KEEP (*(SORT_NONE(.fini)))}
+    ${RELOCATING+/* ??? Why is .gcc_exc here?  */}
+    ${RELOCATING+ *(.gcc_exc)}
+    ${RELOCATING+PROVIDE (etext = .);}
+    ${RELOCATING+PROVIDE (_etext = .);}
+    ${RELOCATING+ KEEP (*(.gcc_except_table))}
+  }
+
+  /* The Cygwin32 library uses a section to avoid copying certain data
+     on fork.  This used to be named ".data$nocopy".  The linker used
+     to include this between __data_start__ and __data_end__, but that
+     breaks building the cygwin32 dll.  Instead, we name the section
+     ".data_cygwin_nocopy" and explicitly include it after __data_end__. */
+
+  .data ${RELOCATING+BLOCK(__section_alignment__)} :
+  {
+    ${RELOCATING+__data_start__ = . ;}
+    *(.data)
+    ${RELOCATING+*(.data2)}
+    ${R_DATA}
+    KEEP(*(.jcr))
+    ${RELOCATING+__data_end__ = . ;}
+    ${RELOCATING+*(.data_cygwin_nocopy)}
+  }
+
+  .rdata ${RELOCATING+BLOCK(__section_alignment__)} :
+  {
+    ${R_RDATA}
+    . = ALIGN(4);
+    ${RELOCATING+__rt_psrelocs_start = .;}
+    ${RELOCATING+KEEP(*(.rdata_runtime_pseudo_reloc))}
+    ${RELOCATING+__rt_psrelocs_end = .;}
+
+    /* .ctors & .dtors */
     ${CONSTRUCTING+
        /* Note: we always define __CTOR_LIST__ and ___CTOR_LIST__ here,
           we do not PROVIDE them.  This is because the ctors.o startup
@@ -136,44 +172,32 @@ SECTIONS
        KEEP(*(SORT_BY_NAME(.dtors.*)));
        LONG (0);
      }
-    ${RELOCATING+KEEP (*(SORT_NONE(.fini)))}
-    ${RELOCATING+/* ??? Why is .gcc_exc here?  */}
-    ${RELOCATING+ *(.gcc_exc)}
-    ${RELOCATING+PROVIDE (etext = .);}
-    ${RELOCATING+PROVIDE (_etext = .);}
-    ${RELOCATING+ KEEP (*(.gcc_except_table))}
-  }
-
-  /* The Cygwin32 library uses a section to avoid copying certain data
-     on fork.  This used to be named ".data$nocopy".  The linker used
-     to include this between __data_start__ and __data_end__, but that
-     breaks building the cygwin32 dll.  Instead, we name the section
-     ".data_cygwin_nocopy" and explicitly include it after __data_end__. */
 
-  .data ${RELOCATING+BLOCK(__section_alignment__)} :
-  {
-    ${RELOCATING+__data_start__ = . ;}
-    *(.data)
-    ${RELOCATING+*(.data2)}
-    ${R_DATA}
-    KEEP(*(.jcr))
-    ${RELOCATING+__data_end__ = . ;}
-    ${RELOCATING+*(.data_cygwin_nocopy)}
+    /* .CRT */
+    ${RELOCATING+___crt_xc_start__ = . ;}
+    ${R_CRT_XC}
+    ${RELOCATING+___crt_xc_end__ = . ;}
+    ${RELOCATING+___crt_xi_start__ = . ;}
+    ${R_CRT_XI}
+    ${RELOCATING+___crt_xi_end__ = . ;}
+    ${RELOCATING+___crt_xl_start__ = . ;}
+    ${R_CRT_XL}
+    /* ___crt_xl_end__ is defined in the TLS Directory support code */
+    ${RELOCATING+___crt_xp_start__ = . ;}
+    ${R_CRT_XP}
+    ${RELOCATING+___crt_xp_end__ = . ;}
+    ${RELOCATING+___crt_xt_start__ = . ;}
+    ${R_CRT_XT}
+    ${RELOCATING+___crt_xt_end__ = . ;}
+    ${RELOCATING+___crt_xd_start__ = . ;}
+    ${R_CRT_XD}
+    ${RELOCATING+___crt_xd_end__ = . ;}
   }
 
-  .rdata ${RELOCATING+BLOCK(__section_alignment__)} :
-  {
-    ${R_RDATA}
-    . = ALIGN(4);
-    ${RELOCATING+__rt_psrelocs_start = .;}
-    ${RELOCATING+KEEP(*(.rdata_runtime_pseudo_reloc))}
-    ${RELOCATING+__rt_psrelocs_end = .;}
-  }
-  ${RELOCATING+__rt_psrelocs_size = __rt_psrelocs_end - __rt_psrelocs_start;}
-  ${RELOCATING+___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;}
-  ${RELOCATING+__RUNTIME_PSEUDO_RELOC_LIST_END__ = .;}
-  ${RELOCATING+___RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;}
-  ${RELOCATING+__RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;}
+  ${RELOCATING+___RUNTIME_PSEUDO_RELOC_LIST_END__ = __rt_psrelocs_end;}
+  ${RELOCATING+__RUNTIME_PSEUDO_RELOC_LIST_END__ = __rt_psrelocs_end;}
+  ${RELOCATING+___RUNTIME_PSEUDO_RELOC_LIST__ = __rt_psrelocs_start;}
+  ${RELOCATING+__RUNTIME_PSEUDO_RELOC_LIST__ = __rt_psrelocs_start;}
 
   .eh_frame ${RELOCATING+BLOCK(__section_alignment__)} :
   {
@@ -218,24 +242,6 @@ SECTIONS
     ${RELOCATING+__IAT_end__ = .;}
     ${R_IDATA67}
   }
-  .CRT ${RELOCATING+BLOCK(__section_alignment__)} :
-  {
-    ${RELOCATING+___crt_xc_start__ = . ;}
-    ${R_CRT_XC}
-    ${RELOCATING+___crt_xc_end__ = . ;}
-    ${RELOCATING+___crt_xi_start__ = . ;}
-    ${R_CRT_XI}
-    ${RELOCATING+___crt_xi_end__ = . ;}
-    ${RELOCATING+___crt_xl_start__ = . ;}
-    ${R_CRT_XL}
-    /* ___crt_xl_end__ is defined in the TLS Directory support code */
-    ${RELOCATING+___crt_xp_start__ = . ;}
-    ${R_CRT_XP}
-    ${RELOCATING+___crt_xp_end__ = . ;}
-    ${RELOCATING+___crt_xt_start__ = . ;}
-    ${R_CRT_XT}
-    ${RELOCATING+___crt_xt_end__ = . ;}
-  }
 
   /* Windows TLS expects .tls\$AAA to be at the start and .tls\$ZZZ to be
      at the end of section.  This is important because _tls_start MUST
index 63039f11574ca5d661f728a73b35617391856c7f..b9c11cd74ed3df518928e7ede516c837345d21ca 100644 (file)
@@ -45,6 +45,7 @@ if test "${RELOCATING}"; then
   R_CRT_XL='KEEP (*(SORT(.CRT$XL*)))  /* TLS callbacks */'
   R_CRT_XP='KEEP (*(SORT(.CRT$XP*)))  /* Pre-termination */'
   R_CRT_XT='KEEP (*(SORT(.CRT$XT*)))  /* Termination */'
+  R_CRT_XD='KEEP (*(SORT(.CRT$XD*)))  /* Dynamic TLS Initializer */'
   R_TLS='
     KEEP (*(.tls$AAA))
     KEEP (*(.tls))
@@ -66,6 +67,7 @@ else
   R_CRT_XL=
   R_CRT_XP=
   R_CRT_XT=
+  R_CRT_XD=
   R_TLS='*(.tls)'
   R_RSRC='*(.rsrc)'
 fi
@@ -99,6 +101,40 @@ SECTIONS
     ${RELOCATING+*(.glue_7t)}
     ${RELOCATING+*(.glue_7)}
     ${CONSTRUCTING+. = ALIGN(8);}
+    ${RELOCATING+KEEP (*(SORT_NONE(.fini)))}
+    ${RELOCATING+/* ??? Why is .gcc_exc here?  */}
+    ${RELOCATING+ *(.gcc_exc)}
+    ${RELOCATING+PROVIDE (etext = .);}
+    ${RELOCATING+ KEEP (*(.gcc_except_table))}
+  }
+
+  /* The Cygwin32 library uses a section to avoid copying certain data
+     on fork.  This used to be named ".data$nocopy".  The linker used
+     to include this between __data_start__ and __data_end__, but that
+     breaks building the cygwin32 dll.  Instead, we name the section
+     ".data_cygwin_nocopy" and explicitly include it after __data_end__. */
+
+  .data ${RELOCATING+BLOCK(__section_alignment__)} :
+  {
+    ${RELOCATING+__data_start__ = . ;}
+    *(.data)
+    ${RELOCATING+*(.data2)}
+    ${R_DATA}
+    KEEP(*(.jcr))
+    ${RELOCATING+__data_end__ = . ;}
+    ${RELOCATING+*(.data_cygwin_nocopy)}
+  }
+
+  .rdata ${RELOCATING+BLOCK(__section_alignment__)} :
+  {
+    ${R_RDATA}
+    . = ALIGN(4);
+    ${RELOCATING+__rt_psrelocs_start = .;}
+    ${RELOCATING+KEEP(*(.rdata_runtime_pseudo_reloc))}
+    ${RELOCATING+__rt_psrelocs_end = .;}
+
+    /* .ctors & .dtors */
+    ${CONSTRUCTING+. = ALIGN(8);}
     ${CONSTRUCTING+
        /* Note: we always define __CTOR_LIST__ and ___CTOR_LIST__ here,
           we do not PROVIDE them.  This is because the ctors.o startup
@@ -138,43 +174,32 @@ SECTIONS
        KEEP (*(SORT_BY_NAME(.dtors.*)));
        LONG (0); LONG (0);
      }
-    ${RELOCATING+KEEP (*(SORT_NONE(.fini)))}
-    ${RELOCATING+/* ??? Why is .gcc_exc here?  */}
-    ${RELOCATING+ *(.gcc_exc)}
-    ${RELOCATING+PROVIDE (etext = .);}
-    ${RELOCATING+ KEEP (*(.gcc_except_table))}
-  }
 
-  /* The Cygwin32 library uses a section to avoid copying certain data
-     on fork.  This used to be named ".data$nocopy".  The linker used
-     to include this between __data_start__ and __data_end__, but that
-     breaks building the cygwin32 dll.  Instead, we name the section
-     ".data_cygwin_nocopy" and explicitly include it after __data_end__. */
-
-  .data ${RELOCATING+BLOCK(__section_alignment__)} :
-  {
-    ${RELOCATING+__data_start__ = . ;}
-    *(.data)
-    ${RELOCATING+*(.data2)}
-    ${R_DATA}
-    KEEP(*(.jcr))
-    ${RELOCATING+__data_end__ = . ;}
-    ${RELOCATING+*(.data_cygwin_nocopy)}
+    /* .CRT */
+    ${RELOCATING+___crt_xc_start__ = . ;}
+    ${R_CRT_XC}
+    ${RELOCATING+___crt_xc_end__ = . ;}
+    ${RELOCATING+___crt_xi_start__ = . ;}
+    ${R_CRT_XI}
+    ${RELOCATING+___crt_xi_end__ = . ;}
+    ${RELOCATING+___crt_xl_start__ = . ;}
+    ${R_CRT_XL}
+    /* ___crt_xl_end__ is defined in the TLS Directory support code */
+    ${RELOCATING+___crt_xp_start__ = . ;}
+    ${R_CRT_XP}
+    ${RELOCATING+___crt_xp_end__ = . ;}
+    ${RELOCATING+___crt_xt_start__ = . ;}
+    ${R_CRT_XT}
+    ${RELOCATING+___crt_xt_end__ = . ;}
+    ${RELOCATING+___crt_xd_start__ = . ;}
+    ${R_CRT_XD}
+    ${RELOCATING+___crt_xd_end__ = . ;}
   }
 
-  .rdata ${RELOCATING+BLOCK(__section_alignment__)} :
-  {
-    ${R_RDATA}
-    . = ALIGN(4);
-    ${RELOCATING+__rt_psrelocs_start = .;}
-    ${RELOCATING+KEEP(*(.rdata_runtime_pseudo_reloc))}
-    ${RELOCATING+__rt_psrelocs_end = .;}
-  }
-  ${RELOCATING+__rt_psrelocs_size = __rt_psrelocs_end - __rt_psrelocs_start;}
-  ${RELOCATING+___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;}
-  ${RELOCATING+__RUNTIME_PSEUDO_RELOC_LIST_END__ = .;}
-  ${RELOCATING+___RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;}
-  ${RELOCATING+__RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;}
+  ${RELOCATING+___RUNTIME_PSEUDO_RELOC_LIST_END__ = __rt_psrelocs_end;}
+  ${RELOCATING+__RUNTIME_PSEUDO_RELOC_LIST_END__ = __rt_psrelocs_end;}
+  ${RELOCATING+___RUNTIME_PSEUDO_RELOC_LIST__ = __rt_psrelocs_start;}
+  ${RELOCATING+__RUNTIME_PSEUDO_RELOC_LIST__ = __rt_psrelocs_start;}
 
   .eh_frame ${RELOCATING+BLOCK(__section_alignment__)} :
   {
@@ -224,24 +249,6 @@ SECTIONS
     ${RELOCATING+__IAT_end__ = .;}
     ${R_IDATA67}
   }
-  .CRT ${RELOCATING+BLOCK(__section_alignment__)} :
-  {
-    ${RELOCATING+___crt_xc_start__ = . ;}
-    ${R_CRT_XC}
-    ${RELOCATING+___crt_xc_end__ = . ;}
-    ${RELOCATING+___crt_xi_start__ = . ;}
-    ${R_CRT_XI}
-    ${RELOCATING+___crt_xi_end__ = . ;}
-    ${RELOCATING+___crt_xl_start__ = . ;}
-    ${R_CRT_XL}
-    /* ___crt_xl_end__ is defined in the TLS Directory support code */
-    ${RELOCATING+___crt_xp_start__ = . ;}
-    ${R_CRT_XP}
-    ${RELOCATING+___crt_xp_end__ = . ;}
-    ${RELOCATING+___crt_xt_start__ = . ;}
-    ${R_CRT_XT}
-    ${RELOCATING+___crt_xt_end__ = . ;}
-  }
 
   /* Windows TLS expects .tls\$AAA to be at the start and .tls\$ZZZ to be
      at the end of the .tls section.  This is important because _tls_start MUST
index eea52e10fe2911f6c1ce0b520a330be0d06a8bdf..074c09916f77b510987d7722ecadfb2291bab8b2 100644 (file)
@@ -4,7 +4,7 @@ tmpdir/aarch64.x:     file format pei-aarch64-little
 
 Disassembly of section .text:
 
-0000000000002000 <__rt_psrelocs_end>:
+0000000000002000 <.text>:
        ...
 
 0000000000002010 <foo>:
@@ -58,41 +58,41 @@ Disassembly of section .text:
     20cc:      0000121f        udf     #4639
     20d0:      17ffffd0        b       2010 <foo>
     20d4:      17ffffd0        b       2014 <foo\+0x4>
-    20d8:      17ffffcd        b       200c <__rt_psrelocs_end\+0xc>
+    20d8:      17ffffcd        b       200c <.text\+0xc>
     20dc:      14000051        b       2220 <bar>
     20e0:      14000051        b       2224 <bar\+0x4>
     20e4:      1400004e        b       221c <.text>
     20e8:      97ffffca        bl      2010 <foo>
     20ec:      97ffffca        bl      2014 <foo\+0x4>
-    20f0:      97ffffc7        bl      200c <__rt_psrelocs_end\+0xc>
+    20f0:      97ffffc7        bl      200c <.text\+0xc>
     20f4:      9400004b        bl      2220 <bar>
     20f8:      9400004b        bl      2224 <bar\+0x4>
     20fc:      94000048        bl      221c <.text>
     2100:      97ffffbf        bl      1ffc <__ImageBase\+0xffc>
     2104:      b4fff860        cbz     x0, 2010 <foo>
     2108:      b4fff860        cbz     x0, 2014 <foo\+0x4>
-    210c:      b4fff800        cbz     x0, 200c <__rt_psrelocs_end\+0xc>
+    210c:      b4fff800        cbz     x0, 200c <.text\+0xc>
     2110:      b4000880        cbz     x0, 2220 <bar>
     2114:      b4000880        cbz     x0, 2224 <bar\+0x4>
     2118:      b4000820        cbz     x0, 221c <.text>
     211c:      b4fff700        cbz     x0, 1ffc <__ImageBase\+0xffc>
     2120:      3607f780        tbz     w0, #0, 2010 <foo>
     2124:      3607f780        tbz     w0, #0, 2014 <foo\+0x4>
-    2128:      3607f720        tbz     w0, #0, 200c <__rt_psrelocs_end\+0xc>
+    2128:      3607f720        tbz     w0, #0, 200c <.text\+0xc>
     212c:      360007a0        tbz     w0, #0, 2220 <bar>
     2130:      360007a0        tbz     w0, #0, 2224 <bar\+0x4>
     2134:      36000740        tbz     w0, #0, 221c <.text>
     2138:      3607f620        tbz     w0, #0, 1ffc <__ImageBase\+0xffc>
-    213c:      90000000        adrp    x0, 2000 <__rt_psrelocs_end>
-    2140:      90000000        adrp    x0, 2000 <__rt_psrelocs_end>
-    2144:      90000000        adrp    x0, 2000 <__rt_psrelocs_end>
-    2148:      90000000        adrp    x0, 2000 <__rt_psrelocs_end>
-    214c:      90000000        adrp    x0, 2000 <__rt_psrelocs_end>
-    2150:      90000000        adrp    x0, 2000 <__rt_psrelocs_end>
+    213c:      90000000        adrp    x0, 2000 <.text>
+    2140:      90000000        adrp    x0, 2000 <.text>
+    2144:      90000000        adrp    x0, 2000 <.text>
+    2148:      90000000        adrp    x0, 2000 <.text>
+    214c:      90000000        adrp    x0, 2000 <.text>
+    2150:      90000000        adrp    x0, 2000 <.text>
     2154:      f0ffffe0        adrp    x0, 1000 <__ImageBase>
     2158:      10fff5c0        adr     x0, 2010 <foo>
     215c:      30fff5a0        adr     x0, 2011 <foo\+0x1>
-    2160:      70fff560        adr     x0, 200f <__rt_psrelocs_end\+0xf>
+    2160:      70fff560        adr     x0, 200f <.text\+0xf>
     2164:      100005e0        adr     x0, 2220 <bar>
     2168:      300005c0        adr     x0, 2221 <bar\+0x1>
     216c:      70000580        adr     x0, 221f <.text\+0x3>
@@ -146,13 +146,4 @@ Disassembly of section .text:
 0000000000002220 <bar>:
     2220:      9abcdef0        .inst   0x9abcdef0 ; undefined
     2224:      12345678        and     w24, w19, #0xfffff003
-
-0000000000002228 <__CTOR_LIST__>:
-    2228:      ffffffff        .inst   0xffffffff ; undefined
-    222c:      ffffffff        .inst   0xffffffff ; undefined
-       ...
-
-0000000000002238 <__DTOR_LIST__>:
-    2238:      ffffffff        .inst   0xffffffff ; undefined
-    223c:      ffffffff        .inst   0xffffffff ; undefined
-       ...
+#pass
index 81a44a7f2279ce0cc8c51a14f5fdf2ef4ac6e3fd..16e736ea7a3c54d8f5866c00966a69d51dd2c3d4 100644 (file)
@@ -2,6 +2,7 @@
 #ld: --disable-long-section-names
 #objdump: -h
 #source: longsecn.s
+#xfail: mcore-*-*
 
 .*:     file format .*
 
@@ -17,6 +18,8 @@ Idx Name          Size      VMA +LMA +File off  Algn
                   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]
                   CONTENTS, ALLOC, LOAD, DATA
-  5 \.idata        [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
-                  CONTENTS, ALLOC, LOAD, DATA
+  5 \.rdata        [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
+                  CONTENTS, ALLOC, LOAD, READONLY, DATA
+  6 \.idata        [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
+                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 #...
index 64d16277a4f633ebe89eceaff2c83c30535f6e1e..494e53240af2cb82d1fb0764ed368aa51642e8bb 100644 (file)
@@ -2,6 +2,7 @@
 #ld: --enable-long-section-names
 #objdump: -h
 #source: longsecn.s
+#xfail: mcore-*-*
 
 .*:     file format .*
 
@@ -17,6 +18,8 @@ Idx Name          Size      VMA +LMA +File off  Algn
                   CONTENTS, ALLOC, LOAD, DATA
   4 \.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
-  5 \.idata        [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
-                  CONTENTS, ALLOC, LOAD, DATA
+  5 \.rdata        [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
+                  CONTENTS, ALLOC, LOAD, READONLY, DATA
+  6 \.idata        [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
+                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 #...
index e77f6eeaf19c28add7eb2c2e50fe1c9ee4075e30..1d18c80eb9a7d0ca45f161122f46b5014ed875fe 100644 (file)
@@ -2,6 +2,7 @@
 #ld:
 #objdump: -h
 #source: longsecn.s
+#xfail: mcore-*-*
 
 .*:     file format .*
 
@@ -17,6 +18,8 @@ Idx Name          Size      VMA +LMA +File off  Algn
                   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]
                   CONTENTS, ALLOC, LOAD, DATA
-  5 \.idata        [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
-                  CONTENTS, ALLOC, LOAD, DATA
+  5 \.rdata        [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
+                  CONTENTS, ALLOC, LOAD, READONLY, DATA
+  6 \.idata        [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  [0-9a-fA-F]+  2\*\*[0-9]
+                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 #...
index 4047a6ae0f9990d23ee468903bc534e6ea03a488..6a2d9f0d287754c9058fe955addd50b688f4e07a 100644 (file)
@@ -4,10 +4,11 @@
 #source: orphane.s
 #ld: --file-align 1 --section-align 1
 #objdump: -h --wide
+#xfail: mcore-*-*
 
 #...
- +0 +\.text .*
- +1 +\.foo +0+20 .*
- +2 +\.foo +0+20 .*
- +3 +\.idata .*
+ +. +\.foo .*
+ +. +\.rdata .*
+ +. +\.foo +0+20 .*
+ +. +\.idata .*
 #pass
index 5e88da71e05622fc04f7e03fae48f95ab4b92766..07b8b51415a49458a641c45d8e3bfb1cdde1d29a 100644 (file)
@@ -4,10 +4,11 @@
 #source: orphane.s
 #ld: --file-align 1 --section-align 1  --no-leading-underscore
 #objdump: -h --wide
+#xfail: mcore-*-*
 
 #...
- +0 +\.text .*
- +1 +\.foo +0+20 .*
- +2 +\.foo +0+20 .*
- +3 +\.idata .*
+ +. +\.foo +0+20 .*
+ +. +\.rdata .*
+ +. +\.foo +0+20 .*
+ +. +\.idata .*
 #pass
index 214eb11d3fb17ce717383d7861ca9cb33c56e17e..73592a30113991bba7f465f191fd599d9c1ae422 100644 (file)
@@ -5,6 +5,6 @@ Contents of section .data:
  0000 2dba2ef1 01000000 00000000 10000000  -...............
  0010 20000060 00000000 00000000 00000000   ..`............
  0020 01000000 10000000 10000000 20000060  ............ ..`
- 0030 01000000 00000000 00000000 02000000  ................
+ 0030 01000000 00000000 00000000 03000000  ................
  0040 00000000 3d000000 40000040 00000000  ....=...@..@....
  0050 00000000 00000000                    ........        
index ab6370fb514bd4fe3d2b09f5974fa37748fe703d..18b1c9beacadd2d9d5c2b30cf02a1187e9923e8f 100644 (file)
@@ -6,20 +6,11 @@
 
 Disassembly of section .text:
 
-0000000140001000 <___crt_xc_end__>:
+0000000140001000 <___tls_end__>:
    140001000:  d2800281        mov     x1, #0x14                       // #20
    140001004:  14000001        b       140001008 <foo>
 
 0000000140001008 <foo>:
    140001008:  d65f03c0        ret
    14000100c:  00000000        udf     #0
-
-0000000140001010 <__CTOR_LIST__>:
-   140001010:  ffffffff        .inst   0xffffffff ; undefined
-   140001014:  ffffffff        .inst   0xffffffff ; undefined
-       ...
-
-0000000140001020 <__DTOR_LIST__>:
-   140001020:  ffffffff        .inst   0xffffffff ; undefined
-   140001024:  ffffffff        .inst   0xffffffff ; undefined
-       ...
+#pass
index 20ace36d1edbcc670cdb15d0280eec11ad97e9c8..184cc9f05baae9ed361399b17b2a7c93977aead3 100644 (file)
@@ -4,8 +4,7 @@ tmpdir/secidx\.x: +file format pei-.*
 Contents of section .text:
  .*1000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c  >>>><<<<>>>>><<<
  .*1010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c  >>>>>><<>>>>>>><
- .*1020 3c3c3c3c 3e3e3e3e 3e909090 ffffffff  <<<<>>>>>.......
- .*1030 00000000 ffffffff 00000000           ............    
+ .*1020 3c3c3c3c 3e3e3e3e 3e909090           <<<<>>>>>...    
 Contents of section .data:
  .*2000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c  >>>><<<<>>>>><<<
  .*2010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c  >>>>>><<>>>>>>><
@@ -20,7 +19,8 @@ Contents of section .rdata:
  .*3000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c  >>>><<<<>>>>><<<
  .*3010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c  >>>>>><<>>>>>>><
  .*3020 3e3e3e3e 00000000 00000000 00000000  >>>>............
- .*3030 3c3c3c3e 3e3e3e3e 3e000000           <<<>>>>>>...    
+ .*3030 3c3c3c3e 3e3e3e3e 3e000000 ffffffff  <<<>>>>>>.......
+ .*3040 00000000 ffffffff 00000000           ............    
 Contents of section .idata:
  .*4000 00000000 00000000 00000000 00000000  ................
  .*4010 00000000                             ....            
index 63b4a589c704796c569f4fc06e6458ecfcad5356..0d5b971d198d619a12af47f53cb54238388e9ae6 100644 (file)
@@ -5,8 +5,6 @@ Contents of section \.text:
  .*1000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c  .*
  .*1010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c  .*
  .*1020 3c3c3c3c 3e3e3e3e 3e909090 90909090  .*
- .*1030 ffffffff ffffffff 00000000 00000000  .*
- .*1040 ffffffff ffffffff 00000000 00000000  .*
 Contents of section \.data:
  .*2000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c  .*
  .*2010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c  .*
@@ -22,6 +20,8 @@ Contents of section \.rdata:
  .*3010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c  .*
  .*3020 3e3e3e3e 00000000 00000000 00000000  .*
  .*3030 3c3c3c3e 3e3e3e3e 3e000000 00000000  .*
+ .*3040 ffffffff ffffffff 00000000 00000000  .*
+ .*3050 ffffffff ffffffff 00000000 00000000  .*
 Contents of section \.idata:
  .*4000 00000000 00000000 00000000 00000000  .*
  .*4010 00000000 00000000                    .*
index e119d1cff6f28745a993b867cfb7cc68f2a0c1b7..82089103d7d1d607499667e790bf803a4fb65242 100644 (file)
@@ -5,8 +5,6 @@ Contents of section \.text:
  .*1000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c  .*
  .*1010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c  .*
  .*1020 3c3c3c3c 3e3e3e3e 3e000000 00000000  .*
- .*1030 ffffffff ffffffff 00000000 00000000  .*
- .*1040 ffffffff ffffffff 00000000 00000000  .*
 Contents of section \.data:
  .*2000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c  .*
  .*2010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c  .*
@@ -22,6 +20,8 @@ Contents of section \.rdata:
  .*3010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c  .*
  .*3020 3e3e3e3e 00000000 00000000 00000000  .*
  .*3030 3c3c3c3e 3e3e3e3e 3e000000 .*
+ .*3040 ffffffff ffffffff 00000000 00000000  .*
+ .*3050 ffffffff ffffffff 00000000 00000000  .*
 Contents of section \.idata:
  .*4000 00000000 00000000 00000000 00000000  .*
  .*4010 00000000 00000000                    .*
index 3f1bb4a510a0d41039342fc71e8b4c1df4f35c4f..6e31cd55712be623361bb9026702dd2e45c0c372 100644 (file)
@@ -6,7 +6,6 @@ Contents of section \.text:
  .*1010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c  >>>>>><<>>>>>>><\r
  .*1020 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c  >>>><<<<>>>>><<<\r
  .*1030 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c  >>>>>><<>>>>>>><\r
- .*1040 ........ ........ ........ ........  ................\r
 Contents of section \.data:\r
  .*2000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c  >>>><<<<>>>>><<<\r
  .*2010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c  >>>>>><<>>>>>>><\r
@@ -22,6 +21,7 @@ Contents of section \.rdata:
  .*3000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c  >>>><<<<>>>>><<<\r
  .*3010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c  >>>>>><<>>>>>>><\r
  .*3020 3e3e3e3e 00000000 00000000 00000000  >>>>............\r
+ .*3030 ........ ........ ........ ........  ................\r
 Contents of section \.idata:\r
  .*4000 00000000 00000000 00000000 00000000  ................\r
  .*4010 00000000                             ....            \r
index 82284f9cf624d76ad273fcfa61095be238f20780..cd3bdda98f8f48b64627c657941809596a7f262d 100644 (file)
@@ -6,8 +6,6 @@ Contents of section \.text:
  .*1010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c  .*
  .*1020 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c  .*
  .*1030 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c  .*
- .*1040 ffffffff ffffffff 00000000 00000000  .*
- .*1050 ffffffff ffffffff 00000000 00000000  .*
 Contents of section \.data:
  .*2000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c  .*
  .*2010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c  .*
@@ -23,6 +21,8 @@ Contents of section \.rdata:
  .*3000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c  .*
  .*3010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c  .*
  .*3020 3e3e3e3e 00000000 00000000 00000000  .*
+ .*3030 ffffffff ffffffff 00000000 00000000  .*
+ .*3040 ffffffff ffffffff 00000000 00000000  .*
 Contents of section \.idata:
  .*4000 00000000 00000000 00000000 00000000  .*
  .*4010 00000000 00000000                    .*
index 692d9e4848a6023a6796a674e671d57017898257..a63a9e72b3b73077420867a391a6289259af62e6 100644 (file)
@@ -1,3 +1,3 @@
 #...
-Entry 9 0000000000003000 00000028 Thread Storage Directory \[\.tls\]
+Entry 9 0000000000004000 00000028 Thread Storage Directory \[\.tls\]
 #...