PE LD: Merge .CRT .ctors and .dtors into .rdata

PR 32264
This commit is contained in:
Liu Hao 2024-11-27 14:27:53 +00:00 committed by Nick Clifton
parent fe217087a4
commit db00f6c3ac
No known key found for this signature in database
17 changed files with 174 additions and 167 deletions

View 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 },

View 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))}
/* .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__ = . ;}
}
/* 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 = .;}
}
${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

View 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))}
/* .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__ = . ;}
}
/* 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 = .;}
}
${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

View 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

View 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
#...

View 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
#...

View 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
#...

View 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

View 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

View 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 ........

View 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

View 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 ....

View 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 .*

View 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 .*

View File

@ -6,7 +6,6 @@ Contents of section \.text:
.*1010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>><
.*1020 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<<
.*1030 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>><
.*1040 ........ ........ ........ ........ ................
Contents of section \.data:
.*2000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<<
.*2010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>><
@ -22,6 +21,7 @@ Contents of section \.rdata:
.*3000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<<
.*3010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>><
.*3020 3e3e3e3e 00000000 00000000 00000000 >>>>............
.*3030 ........ ........ ........ ........ ................
Contents of section \.idata:
.*4000 00000000 00000000 00000000 00000000 ................
.*4010 00000000 ....

View 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 .*

View File

@ -1,3 +1,3 @@
#...
Entry 9 0000000000003000 00000028 Thread Storage Directory \[\.tls\]
Entry 9 0000000000004000 00000028 Thread Storage Directory \[\.tls\]
#...