mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
144bed8d4d
Relocations against .got.plt section may not be in the same order as entries in PLT section. It is incorrect to assume that the Ith reloction index against .got.plt section always maps to the (I + 1)th entry in PLT section. This patch matches the .got.plt relocation offset/index in PLT entry against the index in .got.plt relocation table. It only checks R_*_JUMP_SLOT and R_*_IRELATIVE relocations. It ignores R_*_TLS_DESC and R_*_TLSDESC relocations since they have different PLT entries. bfd/ PR binutils/17154 * elf32-i386.c (elf_i386_plt_sym_val): Only match R_*_JUMP_SLOT and R_*_IRELATIVE relocation offset with PLT entry. * elf64-x86-64.c (elf_x86_64_plt_sym_val): Likewise. (elf_x86_64_plt_sym_val_offset_plt_bnd): New. (elf_x86_64_get_synthetic_symtab): Use it. ld/testsuite/ PR binutils/17154 * ld-ifunc/pr17154-i386.d: New file. * ld-ifunc/pr17154-x86-64.d: Likewise. * ld-ifunc/pr17154-x86.s: Likewise. * ld-x86-64/bnd-ifunc-2.d: Likewise. * ld-x86-64/bnd-ifunc-2.s: Likewise. * ld-x86-64/mpx.exp: Run bnd-ifunc-2. * ld-x86-64/tlsdesc-nacl.pd: Updated. * ld-x86-64/tlsdesc.pd: Likewise.
29 lines
470 B
ArmAsm
29 lines
470 B
ArmAsm
.text
|
|
.globl fct1
|
|
.type fct1, @gnu_indirect_function
|
|
.set fct1,resolve1
|
|
.hidden int_fct1
|
|
.globl int_fct1
|
|
.set int_fct1,fct1
|
|
.type resolve1, @function
|
|
resolve1:
|
|
call func1@PLT
|
|
.globl g1
|
|
.type g1, @function
|
|
g1:
|
|
jmp int_fct1@PLT
|
|
|
|
.globl fct2
|
|
.type fct2, @gnu_indirect_function
|
|
.set fct2,resolve2
|
|
.hidden int_fct2
|
|
.globl int_fct2
|
|
.set int_fct2,fct2
|
|
.type resolve2, @function
|
|
resolve2:
|
|
call func2@PLT
|
|
.globl g2
|
|
.type g2, @function
|
|
g2:
|
|
jmp int_fct2@PLT
|