Browse Source
We need to clear the R_X86_64_converted_reloc_bit bit after setting it to avoid leaking it out by --emit-relocs. bfd/ PR ld/23324 * elf64-x86-64.c (elf_x86_64_relocate_section): Clear the R_X86_64_converted_reloc_bit bit. ld/ PR ld/23324 * testsuite/ld-x86-64/pr23324.s: New file. * testsuite/ld-x86-64/pr23324a.d: Likewise. * testsuite/ld-x86-64/pr23324b.d: Likewise.gdb-8.2-branch
7 changed files with 43 additions and 2 deletions
@ -0,0 +1,6 @@ |
|||
.text |
|||
.globl _start |
|||
.type _start,@function |
|||
_start: |
|||
movq _start@GOTPCREL(%rip), %rsi |
|||
ret |
|||
@ -0,0 +1,8 @@ |
|||
#source: pr23324.s |
|||
#as: --64 -mrelax-relocations=yes |
|||
#ld: -q -melf_x86_64 -pie |
|||
#readelf: -r --wide |
|||
|
|||
Relocation section '.rela.text' at offset 0x[0-9a-f]+ contains 1 entry: |
|||
+Offset +Info +Type +Sym.* Value +Symbol's Name \+ Addend |
|||
[0-9a-f]+ +[0-9a-f]+ +R_X86_64_PC32 +[0-9a-f]+ +_start - 4 |
|||
@ -0,0 +1,8 @@ |
|||
#source: pr23324.s |
|||
#as: --x32 -mrelax-relocations=yes |
|||
#ld: -q -melf32_x86_64 -pie |
|||
#readelf: -r --wide |
|||
|
|||
Relocation section '.rela.text' at offset 0x[0-9a-f]+ contains 1 entry: |
|||
+Offset +Info +Type +Sym.* Value +Symbol's Name \+ Addend |
|||
[0-9a-f]+ +[0-9a-f]+ +R_X86_64_PC32 +[0-9a-f]+ +_start - 4 |
|||
Loading…
Reference in new issue