Browse Source
Commit dd7e64d45b may optimize out
i386/x86-64 JUMP_SLOT relocation. If there is no JUMP_SLOT relocation
left, we don't need to the first .plt entry. This patch allocates
space for the first .plt entry only if we also reserve space for a PLT
slot for JUMP_SLOT relocation.
bfd/
* elf32-i386.c (elf_i386_allocate_dynrelocs): Allocate space
for the first .plt entry only if needed.
* elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
ld/testsuite/
* ld-i386/i386.exp: Run pltgot-1 for Linux targets.
* ld-x86-64/x86-64.exp: Likewise.
* ld-i386/pltgot-1.d: New file.
* ld-i386/pltgot-1.s: Likewise.
* ld-x86-64/pltgot-1.d: Likewise.
* ld-x86-64/pltgot-1.s: Likewise.
gdb-7.10-branch
10 changed files with 63 additions and 11 deletions
@ -0,0 +1,8 @@ |
|||
#ld: -shared -melf_i386 |
|||
#readelf: -S --wide |
|||
#as: --32 |
|||
|
|||
#failif |
|||
#... |
|||
+\[ [0-9]+\] \.plt +PROGBITS +.* |
|||
#... |
|||
@ -0,0 +1,6 @@ |
|||
.text |
|||
.globl plt |
|||
.type plt, @function |
|||
plt: |
|||
call *puts@GOT(%ebx) |
|||
jmp puts@PLT |
|||
@ -0,0 +1,8 @@ |
|||
#ld: -shared -melf_x86_64 |
|||
#readelf: -S --wide |
|||
#as: --64 |
|||
|
|||
#failif |
|||
#... |
|||
+\[ [0-9]+\] \.plt +PROGBITS +.* |
|||
#... |
|||
@ -0,0 +1,6 @@ |
|||
.text |
|||
.globl plt |
|||
.type plt, @function |
|||
plt: |
|||
call *puts@GOTPCREL(%rip) |
|||
jmp puts@PLT |
|||
Loading…
Reference in new issue