binutils-gdb/ld/testsuite/ld-x86-64/pe-x86-64-3.od
H.J. Lu 36068e2fa5 elf/x86-64: Adjust relocation for PE/x86-64 inputs
PE linker calls _bfd_relocate_contents to resolve relocation, instead of
bfd_perform_relocation.  But ELF linker calls bfd_perform_relocation, not
_bfd_relocate_contents.  When linking PE/x86-64 inputs to generate ELF
output, we need to adjust PE/x86-64 relocations in bfd_perform_relocation.

Enable PE/x86-64 in bfd together with PEI/x86-64.  Update run_ld_link_tests
to handle bzip2 binary inputs.

bfd/

	PR ld/26583
	* config.bfd (targ64_selvecs, targ_selvecs): Add x86_64_pe_vec
	to x86_64_pei_vec.
	* reloc.c: Include "coff/internal.h".
	(bfd_perform_relocation): Adjust relocation for PE/x86-64 inputs.

ld/

	PR ld/26583
	* testsuite/ld-x86-64/pe-x86-64-1.od: New file.
	* testsuite/ld-x86-64/pe-x86-64-1a.obj.bz2: Likewise.
	* testsuite/ld-x86-64/pe-x86-64-1b.obj.bz2: Likewise.
	* testsuite/ld-x86-64/pe-x86-64-1c.obj.bz2: Likewise.
	* testsuite/ld-x86-64/pe-x86-64-2.od: Likewise.
	* testsuite/ld-x86-64/pe-x86-64-2a.obj.bz2: Likewise.
	* testsuite/ld-x86-64/pe-x86-64-2b.obj.bz2: Likewise.
	* testsuite/ld-x86-64/pe-x86-64-2c.obj.bz2: Likewise.
	* testsuite/ld-x86-64/pe-x86-64-3.od: Likewise.
	* testsuite/ld-x86-64/pe-x86-64-3a.obj.bz2: Likewise.
	* testsuite/ld-x86-64/pe-x86-64-3b.obj.bz2: Likewise.
	* testsuite/ld-x86-64/pe-x86-64-3c.obj.bz2: Likewise.
	* testsuite/ld-x86-64/pe-x86-64-3d.obj.bz2: Likewise.
	* testsuite/ld-x86-64/pe-x86-64-4.od: Likewise.
	* testsuite/ld-x86-64/pe-x86-64-4a.obj.bz2: Likewise.
	* testsuite/ld-x86-64/pe-x86-64-4b.obj.bz2: Likewise.
	* testsuite/ld-x86-64/pe-x86-64-4c.obj.bz2: Likewise.
	* testsuite/ld-x86-64/pe-x86-64-4d.obj.bz2: Likewise.
	* testsuite/ld-x86-64/pe-x86-64.exp: Likewise.
	* testsuite/lib/ld-lib.exp (run_ld_link_tests): Handle bz2 binary
	inputs.
2020-09-16 07:11:31 -07:00

39 lines
1.4 KiB
Plaintext

.*: +file format .*
SYMBOL TABLE:
0+401000 l d .text\$mn 0000000000000000 .text\$mn
0+402000 l d .xdata 0000000000000000 .xdata
0+402008 l d .pdata 0000000000000000 .pdata
0+403014 l d .bss 0000000000000000 .bss
0+ l d .debug\$S 0000000000000000 .debug\$S
0+401000 g .text\$mn 0000000000000000 getaddr1
0+401020 g .text\$mn 0000000000000000 begin
0+403014 g .bss 0000000000000000 __bss_start
0+403014 g .bss 0000000000000000 var
0+401010 g .text\$mn 0000000000000000 getaddr2
0+403014 g .bss 0000000000000000 _edata
0+403018 g .bss 0000000000000000 _end
Disassembly of section .text\$mn:
0+401000 <getaddr1>:
+[a-f0-9]+: 48 8d 05 0d 20 00 00 lea 0x200d\(%rip\),%rax # 403014 <__bss_start>
+[a-f0-9]+: c3 ret
+[a-f0-9]+: 0f 1f 84 00 00 00 00 00 nopl 0x0\(%rax,%rax,1\)
0+401010 <getaddr2>:
+[a-f0-9]+: 48 8d 05 fd 1f 00 00 lea 0x1ffd\(%rip\),%rax # 403014 <__bss_start>
+[a-f0-9]+: c3 ret
+[a-f0-9]+: 0f 1f 84 00 00 00 00 00 nopl 0x0\(%rax,%rax,1\)
0+401020 <begin>:
+[a-f0-9]+: 48 83 ec 28 sub \$0x28,%rsp
+[a-f0-9]+: e8 d7 ff ff ff call 401000 <getaddr1>
+[a-f0-9]+: e8 e2 ff ff ff call 401010 <getaddr2>
+[a-f0-9]+: 48 83 c4 28 add \$0x28,%rsp
+[a-f0-9]+: c3 ret
#pass