mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-12 12:16:04 +08:00
233cc9c13a
If a backend supports it, PLT entry isn't needed when all references to a STT_GNU_IFUNC symbols are done via GOT or static function pointers. For GOT entries, We generate dynamic R_*_GLOB_DAT relocations for preemptable symbols and R_*_IRELATIVE relocations for non-preemptable symbols to update them with real function address. For static pointer pointers, we generate dynamic pointer relocations and store them in: 1. .rel[a].ifunc section in PIC object. 2. .rel[a].got section in dynamic executable. 3. .rel[a].iplt section in static executable. We don't allocate GOT entry if it isn't used. bfd/ PR ld/20253 * elf-bfd.h (_bfd_elf_allocate_ifunc_dyn_relocs): Add an bfd_boolean argument. * elf-ifunc.c (_bfd_elf_create_ifunc_sections): Replace "shared object" with "PIC object" in comments. (_bfd_elf_allocate_ifunc_dyn_relocs): Updated. Replace "shared object" with "PIC object" in comments. Avoid PLT if requested. Generate dynamic relocations for non-GOT references. Make room for the special first entry in PLT and allocate PLT entry only for PLT and PC-relative references. Store dynamic GOT relocations in .rel[a].iplt section for static executables. If PLT isn't used, always use GOT for symbol value. Don't allocate GOT entry if it isn't used. * elf32-i386.c (elf_i386_check_relocs): Increment PLT reference count only in the code section. Allocate dynamic pointer relocation against STT_GNU_IFUNC symbol in the non-code section. (elf_i386_adjust_dynamic_symbol): Increment PLT reference count only for PC-relative references. (elf_i386_allocate_dynrelocs): Pass TRUE to _bfd_elf_allocate_ifunc_dyn_relocs. (elf_i386_relocate_section): Allow R_386_GOT32/R_386_GOT32X relocations against STT_GNU_IFUNC symbols without PLT. Generate dynamic pointer relocation against STT_GNU_IFUNC symbol in the non-code section and store it in the proper REL section. Don't allow non-pointer relocation against STT_GNU_IFUNC symbol without PLT. (elf_i386_finish_dynamic_symbol): Generate dynamic R_386_IRELATIVE and R_386_GLOB_DAT GOT relocations against STT_GNU_IFUNC symbols without PLT. (elf_i386_finish_dynamic_sections): Don't handle local STT_GNU_IFUNC symbols here. (elf_i386_output_arch_local_syms): Handle local STT_GNU_IFUNC symbols here. (elf_backend_output_arch_local_syms): New. * elf32-x86-64.c (elf_i386_check_relocs): Increment PLT reference count only in the code section. Allocate dynamic pointer relocation against STT_GNU_IFUNC symbol in the non-code section. (elf_x86_64_adjust_dynamic_symbol): Increment PLT reference count only for PC-relative references. (elf_x86_64_allocate_dynrelocs): Pass TRUE to _bfd_elf_allocate_ifunc_dyn_relocs. (elf_x86_64_relocate_section): Allow R_X86_64_GOTPCREL, R_X86_64_GOTPCRELX, R_X86_64_REX_GOTPCRELX and R_X86_64_GOTPCREL64 relocations against STT_GNU_IFUNC symbols without PLT. Generate dynamic pointer relocation against STT_GNU_IFUNC symbol in the non-code section and store it in the proper RELA section. Don't allow non-pointer relocation against STT_GNU_IFUNC symbol without PLT. (elf_x86_64_finish_dynamic_symbol): Generate dynamic R_X86_64_IRELATIVE and R_X86_64_GLOB_DAT GOT relocations against STT_GNU_IFUNC symbols without PLT. (elf_x86_64_finish_dynamic_sections): Don't handle local STT_GNU_IFUNC symbols here. (elf_x86_64_output_arch_local_syms): Handle local STT_GNU_IFUNC symbols here. (elf_backend_output_arch_local_syms): New. * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs): Pass FALSE to _bfd_elf_allocate_ifunc_dyn_relocs. ld/ PR ld/20253 * testsuite/ld-i386/i386.exp: Run PR ld/20253 tests. * testsuite/ld-i386/no-plt.exp: Likewise. * testsuite/ld-x86-64/no-plt.exp: Likewise. * testsuite/ld-i386/pr13302.d: Remove .rel.plt section. * testsuite/ld-ifunc/ifunc-13-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-13-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-15-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-15-x86-64.d: Likewise. * testsuite/ld-x86-64/pr13082-5a.d: Likewise. * testsuite/ld-x86-64/pr13082-5b.d: Likewise. * testsuite/ld-x86-64/pr13082-6a.d: Likewise. * testsuite/ld-x86-64/pr13082-6b.d: Likewise. * testsuite/ld-i386/pr20244-2a.d: Remove .plt section. * testsuite/ld-ifunc/ifunc-21-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-21-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-22-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-22-x86-64.d: Likewise. * testsuite/ld-i386/pr20244-2b.d: Updated. * testsuite/ld-i386/pr20244-2c.d: Likewise. * testsuite/ld-ifunc/ifunc-18a-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-18a-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-18b-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-18b-x86-64.d: Likewise. * testsuite/ld-i386/pr20253-1a.c: New file. * testsuite/ld-i386/pr20253-1b.S: Likewise. * testsuite/ld-i386/pr20253-1c.S: Likewise. * testsuite/ld-i386/pr20253-1d.S: Likewise. * testsuite/ld-i386/pr20253-2a.c: Likewise. * testsuite/ld-i386/pr20253-2b.S: Likewise. * testsuite/ld-i386/pr20253-2c.S: Likewise. * testsuite/ld-i386/pr20253-2d.S: Likewise. * testsuite/ld-i386/pr20253-3.d: Likewise. * testsuite/ld-i386/pr20253-3.s: Likewise. * testsuite/ld-i386/pr20253-4.s: Likewise. * testsuite/ld-i386/pr20253-4a.d: Likewise. * testsuite/ld-i386/pr20253-4b.d: Likewise. * testsuite/ld-i386/pr20253-4c.d: Likewise. * testsuite/ld-i386/pr20253-5.d: Likewise. * testsuite/ld-i386/pr20253-5.s: Likewise. * testsuite/ld-ifunc/ifunc-23-x86.s: Likewise. * testsuite/ld-ifunc/ifunc-23a-x86.d: Likewise. * testsuite/ld-ifunc/ifunc-23b-x86.d: Likewise. * testsuite/ld-ifunc/ifunc-23c-x86.d: Likewise. * testsuite/ld-ifunc/ifunc-24-x86.s: Likewise. * testsuite/ld-ifunc/ifunc-24a-x86.d: Likewise. * testsuite/ld-ifunc/ifunc-24b-x86.d: Likewise. * testsuite/ld-ifunc/ifunc-24c-x86.d: Likewise. * testsuite/ld-ifunc/ifunc-25-x86.s: Likewise. * testsuite/ld-ifunc/ifunc-25a-x86.d: Likewise. * testsuite/ld-ifunc/ifunc-25b-x86.d: Likewise. * testsuite/ld-ifunc/ifunc-25c-x86.d: Likewise. * testsuite/ld-x86-64/pr20253-1.s: Likewise. * testsuite/ld-x86-64/pr20253-1a.d: Likewise. * testsuite/ld-x86-64/pr20253-1b.d: Likewise. * testsuite/ld-x86-64/pr20253-1c.d: Likewise. * testsuite/ld-x86-64/pr20253-1d.d: Likewise. * testsuite/ld-x86-64/pr20253-1e.d: Likewise. * testsuite/ld-x86-64/pr20253-1f.d: Likewise. * testsuite/ld-x86-64/pr20253-1g.d: Likewise. * testsuite/ld-x86-64/pr20253-1h.d: Likewise. * testsuite/ld-x86-64/pr20253-1i.d: Likewise. * testsuite/ld-x86-64/pr20253-1j.d: Likewise. * testsuite/ld-x86-64/pr20253-1k.d: Likewise. * testsuite/ld-x86-64/pr20253-1l.d: Likewise. * testsuite/ld-x86-64/pr20253-2a.c: Likewise. * testsuite/ld-x86-64/pr20253-2b.S: Likewise. * testsuite/ld-x86-64/pr20253-2c.S: Likewise. * testsuite/ld-x86-64/pr20253-2d.S: Likewise. * testsuite/ld-x86-64/pr20253-3.d: Likewise. * testsuite/ld-x86-64/pr20253-3.s: Likewise. * testsuite/ld-x86-64/pr20253-4.s: Likewise. * testsuite/ld-x86-64/pr20253-4a.d: Likewise. * testsuite/ld-x86-64/pr20253-4b.d: Likewise. * testsuite/ld-x86-64/pr20253-4c.d: Likewise. * testsuite/ld-x86-64/pr20253-4d.d: Likewise. * testsuite/ld-x86-64/pr20253-4e.d: Likewise. * testsuite/ld-x86-64/pr20253-4f.d: Likewise. * testsuite/ld-x86-64/pr20253-5.s: Likewise. * testsuite/ld-x86-64/pr20253-5a.d: Likewise. * testsuite/ld-x86-64/pr20253-5b.d: Likewise. * testsuite/ld-ifunc/ifunc-18a-i386.d: Remove extra IRELATIVE relocation. * testsuite/ld-ifunc/ifunc-18a-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-18b-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-18b-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-18a.s: Fix a typo. * testsuite/ld-x86-64/x86-64.exp: Run pr20253-1 tests. |
||
---|---|---|
.. | ||
abs-iamcu.d | ||
abs.d | ||
abs.s | ||
alloc.d | ||
alloc.s | ||
alloc.t | ||
branch1.d | ||
branch1.s | ||
call1.d | ||
call1.s | ||
call2.d | ||
call2.s | ||
call3.s | ||
call3a.d | ||
call3b.d | ||
call3c.d | ||
call3d.d | ||
call3e.d | ||
call3f.d | ||
call3g.d | ||
call3h.d | ||
combreloc.d | ||
combreloc.s | ||
compressed1.d | ||
compressed1.s | ||
copyreloc-lib.c | ||
copyreloc-main1.rd | ||
copyreloc-main2.rd | ||
copyreloc-main.out | ||
copyreloc-main.S | ||
discarded1.d | ||
discarded1.s | ||
discarded1.t | ||
dummy.c | ||
dummy.s | ||
emit-relocs-nacl.rd | ||
emit-relocs.rd | ||
emit-relocs.s | ||
export-class.exp | ||
foo.s | ||
got1.dd | ||
got1.out | ||
got1a.S | ||
got1b.c | ||
got1c.c | ||
got1d.S | ||
hidden1.d | ||
hidden1.s | ||
hidden2.d | ||
hidden2.s | ||
hidden3.d | ||
hidden3.s | ||
i386-export-class.rd | ||
i386-export-class.xd | ||
i386.exp | ||
iamcu-1.d | ||
iamcu-2.d | ||
iamcu-3.d | ||
iamcu-4.d | ||
ifunc-1a.c | ||
ifunc-1b.S | ||
ifunc-1c.S | ||
ifunc-1d.S | ||
jmp1.d | ||
jmp1.s | ||
jmp2.d | ||
jmp2.s | ||
lea1.s | ||
lea1a.d | ||
lea1b.d | ||
lea1c.d | ||
lea1d.d | ||
lea1e.d | ||
lea1f.d | ||
libno-plt-1b.dd | ||
libno-plt-1b.rd | ||
load1-nacl.d | ||
load1.d | ||
load1.s | ||
load2.d | ||
load2.s | ||
load3.d | ||
load3.s | ||
load4.s | ||
load4a.d | ||
load4b.d | ||
load5.s | ||
load5a.d | ||
load5b.d | ||
load6.d | ||
load6.s | ||
load7.d | ||
load7.map | ||
load7.s | ||
mov1.s | ||
mov1a.d | ||
mov1b.d | ||
mov2.s | ||
mov2a.d | ||
mov2b.d | ||
mov3.d | ||
mov3.s | ||
no-plt-1a.dd | ||
no-plt-1a.rd | ||
no-plt-1b.dd | ||
no-plt-1b.rd | ||
no-plt-1c.dd | ||
no-plt-1c.rd | ||
no-plt-1d.dd | ||
no-plt-1d.rd | ||
no-plt-1e.dd | ||
no-plt-1e.rd | ||
no-plt-1f.dd | ||
no-plt-1f.rd | ||
no-plt-1g.dd | ||
no-plt-1g.rd | ||
no-plt-1h.dd | ||
no-plt-1h.rd | ||
no-plt-1i.dd | ||
no-plt-1i.rd | ||
no-plt-1j.dd | ||
no-plt-1j.rd | ||
no-plt-check1a.S | ||
no-plt-check1b.S | ||
no-plt-extern1a.S | ||
no-plt-extern1b.S | ||
no-plt-func1.c | ||
no-plt-main1.c | ||
no-plt.exp | ||
nogot1.d | ||
nogot1.s | ||
nogot2.d | ||
nogot2.s | ||
pass.out | ||
pcrel8.d | ||
pcrel8.s | ||
pcrel16.d | ||
pcrel16.s | ||
pcrel16abs.d | ||
pcrel16abs.s | ||
plt-lib.c | ||
plt-main1.c | ||
plt-main1.rd | ||
plt-main2.c | ||
plt-main2.rd | ||
plt-main3.c | ||
plt-main3.rd | ||
plt-main4.c | ||
plt-main4.rd | ||
plt-main5.c | ||
plt-main.out | ||
plt-main.rd | ||
plt-nacl.pd | ||
plt-pic-nacl.pd | ||
plt-pic.pd | ||
plt-pic.s | ||
plt.pd | ||
plt.s | ||
pltgot-1.d | ||
pltgot-1.s | ||
pltgot-2.d | ||
pltlib.s | ||
pr12570a.d | ||
pr12570a.s | ||
pr12570b.d | ||
pr12570b.s | ||
pr12627.d | ||
pr12627.s | ||
pr12627.t | ||
pr12718.d | ||
pr12718.s | ||
pr12921.d | ||
pr12921.s | ||
pr13302.d | ||
pr13302.s | ||
pr14215.d | ||
pr14215.s | ||
pr17057.d | ||
pr17057.s | ||
pr17306a.s | ||
pr17306b.s | ||
pr17689.out | ||
pr17689.rd | ||
pr17689a.c | ||
pr17689a.t | ||
pr17689b.S | ||
pr17689now.rd | ||
pr17689ver.rd | ||
pr17709-nacl.rd | ||
pr17709.rd | ||
pr17709a.s | ||
pr17709b.s | ||
pr17827.rd | ||
pr17935-1.d | ||
pr17935-1.s | ||
pr17935-2.d | ||
pr17935-2.s | ||
pr18801.d | ||
pr18801.s | ||
pr18815.d | ||
pr18815.s | ||
pr18900.out | ||
pr18900a.c | ||
pr18900a.rd | ||
pr18900b.c | ||
pr18900b.rd | ||
pr18900c.c | ||
pr19031.out | ||
pr19031a.c | ||
pr19031b.S | ||
pr19031c.c | ||
pr19175.d | ||
pr19175.s | ||
pr19175.t | ||
pr19319.dd | ||
pr19319a.S | ||
pr19319b.S | ||
pr19539.d | ||
pr19539.s | ||
pr19539.t | ||
pr19609-1.s | ||
pr19609-1a.d | ||
pr19609-1b.d | ||
pr19609-1c.d | ||
pr19609-1d.d | ||
pr19609-1e.d | ||
pr19609-1f.d | ||
pr19609-1g.d | ||
pr19609-1h.d | ||
pr19609-1i.d | ||
pr19609-2.s | ||
pr19609-2a.d | ||
pr19609-2b.d | ||
pr19609-2c.d | ||
pr19615.d | ||
pr19615.s | ||
pr19636-1.s | ||
pr19636-1a.d | ||
pr19636-1b.d | ||
pr19636-1c.d | ||
pr19636-1d-nacl.d | ||
pr19636-1d.d | ||
pr19636-1e.d | ||
pr19636-1f.d | ||
pr19636-1g.d | ||
pr19636-1h.d | ||
pr19636-1i.d | ||
pr19636-2.s | ||
pr19636-2a.d | ||
pr19636-2b.d | ||
pr19636-2c-nacl.d | ||
pr19636-2c.d | ||
pr19636-2d-nacl.d | ||
pr19636-2d.d | ||
pr19636-2e-nacl.d | ||
pr19636-2e.d | ||
pr19636-3.s | ||
pr19636-3a.d | ||
pr19636-3b.d | ||
pr19636-3c.d | ||
pr19636-3d.d | ||
pr19636-3e.d | ||
pr19636-3f.d | ||
pr19636-3g.d | ||
pr19636-4.s | ||
pr19636-4a.d | ||
pr19636-4b.d | ||
pr19636-4c.d | ||
pr19636-4d.d | ||
pr19645.d | ||
pr19645.s | ||
pr19704.out | ||
pr19704a.c | ||
pr19704b.c | ||
pr19827-nacl.rd | ||
pr19827.rd | ||
pr19827a.S | ||
pr19827b.S | ||
pr19939.s | ||
pr19939a.d | ||
pr19939b.d | ||
pr20117.d | ||
pr20117.s | ||
pr20244-1.s | ||
pr20244-1a.d | ||
pr20244-1b.d | ||
pr20244-1c.d | ||
pr20244-2.s | ||
pr20244-2a.d | ||
pr20244-2b.d | ||
pr20244-2c.d | ||
pr20244-2d.d | ||
pr20244-3a.c | ||
pr20244-3b.S | ||
pr20244-3c.S | ||
pr20244-3d.S | ||
pr20253-1a.c | ||
pr20253-1b.S | ||
pr20253-1c.S | ||
pr20253-1d.S | ||
pr20253-2a.c | ||
pr20253-2b.S | ||
pr20253-2c.S | ||
pr20253-2d.S | ||
pr20253-3.d | ||
pr20253-3.s | ||
pr20253-4.s | ||
pr20253-4a.d | ||
pr20253-4b.d | ||
pr20253-4c.d | ||
pr20253-5.d | ||
pr20253-5.s | ||
protected1.d | ||
protected1.s | ||
protected2.d | ||
protected2.s | ||
protected3.d | ||
protected3.s | ||
protected4.d | ||
protected4.s | ||
protected5.d | ||
protected5.s | ||
protected6.s | ||
protected6a.d | ||
protected6b.d | ||
reloc.d | ||
reloc.s | ||
start.s | ||
tls-def1.c | ||
tls-gd1.S | ||
tls-ld1.S | ||
tls-main1.c | ||
tls.exp | ||
tlsbin2-nacl.rd | ||
tlsbin2.dd | ||
tlsbin2.rd | ||
tlsbin2.sd | ||
tlsbin2.td | ||
tlsbin-nacl.rd | ||
tlsbin.dd | ||
tlsbin.rd | ||
tlsbin.s | ||
tlsbin.sd | ||
tlsbin.td | ||
tlsbindesc-nacl.rd | ||
tlsbindesc.dd | ||
tlsbindesc.rd | ||
tlsbindesc.s | ||
tlsbindesc.sd | ||
tlsbindesc.td | ||
tlsbinpic2.s | ||
tlsbinpic.s | ||
tlsdesc-nacl.rd | ||
tlsdesc.dd | ||
tlsdesc.rd | ||
tlsdesc.s | ||
tlsdesc.sd | ||
tlsdesc.td | ||
tlsg.s | ||
tlsg.sd | ||
tlsgd1.dd | ||
tlsgd1.s | ||
tlsgd2.d | ||
tlsgd2.s | ||
tlsgd3.dd | ||
tlsgd3.s | ||
tlsgd4.d | ||
tlsgd4.s | ||
tlsgdesc-nacl.rd | ||
tlsgdesc.dd | ||
tlsgdesc.rd | ||
tlsgdesc.s | ||
tlsie1.dd | ||
tlsie1.s | ||
tlsie2.d | ||
tlsie2.s | ||
tlsie3.d | ||
tlsie3.s | ||
tlsie4.d | ||
tlsie4.s | ||
tlsie5.d | ||
tlsie5.s | ||
tlsindntpoff.dd | ||
tlsindntpoff.s | ||
tlsld1.dd | ||
tlsld1.s | ||
tlsld2.dd | ||
tlsld2.s | ||
tlslib.s | ||
tlsnopic1.s | ||
tlsnopic2.s | ||
tlsnopic-nacl.rd | ||
tlsnopic.dd | ||
tlsnopic.rd | ||
tlsnopic.sd | ||
tlspic1.s | ||
tlspic2-nacl.rd | ||
tlspic2.dd | ||
tlspic2.rd | ||
tlspic2.s | ||
tlspic2.sd | ||
tlspic2.td | ||
tlspic3.s | ||
tlspic-nacl.rd | ||
tlspic.dd | ||
tlspic.rd | ||
tlspic.sd | ||
tlspic.td | ||
tlspie1.d | ||
tlspie1.s | ||
tlspie2.d | ||
tlspie2.s | ||
tlspie3.s | ||
tlspie3a.d | ||
tlspie3b.d | ||
tlspie3c.d | ||
undefweak.s | ||
undefweaka.d | ||
undefweakb.d | ||
vxworks1-lib.dd | ||
vxworks1-lib.nd | ||
vxworks1-lib.rd | ||
vxworks1-lib.s | ||
vxworks1-lib.td | ||
vxworks1-static.d | ||
vxworks1.dd | ||
vxworks1.ld | ||
vxworks1.rd | ||
vxworks1.s | ||
vxworks2-static.sd | ||
vxworks2.s | ||
vxworks2.sd | ||
warn1.d | ||
warn1.s | ||
zero.s |