binutils-gdb/ld/testsuite/ld-x86-64/pr27016a.s
H.J. Lu 7e45e7a9ab x86-64: Convert load to mov only for GOTPCRELX relocations
Since converting load to mov needs to rewrite the REX byte and we don't
know if there is a REX byte with GOTPCREL relocation, do it only for
GOTPCRELX relocations.

bfd/

	PR ld/27016
	* elf64-x86-64.c (elf_x86_64_convert_load_reloc): Convert load
	to mov only for GOTPCRELX relocations.

ld/

	PR ld/27016
	* testsuite/ld-x86-64/x86-64.exp: Run pr27016a and pr27016b.
	* testsuite/ld-x86-64/pr27016a.d: New file.
	* testsuite/ld-x86-64/pr27016a.s: Likewise.
	* testsuite/ld-x86-64/pr27016b.d: Likewise.
	* testsuite/ld-x86-64/pr27016b.s: Likewise.
2020-12-04 18:54:47 -08:00

24 lines
628 B
ArmAsm

.text
.comm global_int,4,4
.globl main
.type main, @function
main:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movq thesym@GOTPCREL(%rip), %r11
movl (%r11), %eax
leal 1(%rax), %edx
movq thesym@GOTPCREL(%rip), %r11
movl %edx, (%r11)
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.size main, .-main
.section .note.GNU-stack,"",@progbits