68bb0359ee
This patch aims to improve the definitions of BTI and PAC based PLTs. The following changes are made: * PLT0 does not need PAC instructions since the PLTGOT[2] (and PLTGOT[1]) are readonly so they cannot be corrupted at runtime. Thus both PAC plt0 and BTI+PAC plt0 are removed and we can use basic plt0 and BTI plt0 instead, respectively. * We can remove the extra padding nops when we add the new bti instructions. BTI plt0 and BTI TLSDESC plt are updated. * For better performance PLTn could be padded to 24bytes. Both BTI pltn and PAC pltn are updated. *** bfd/ChangeLog *** 2019-04-25 Sudakshina Das <sudi.das@arm.com> * elfnn-aarch64.c (PLT_BTI_ENTRY_SIZE): Remove. (PLT_BTI_TLSDESC_ENTRY_SIZE): Remove. (PLT_PAC_ENTRY_SIZE, PLT_BTI_PAC_ENTRY_SIZE): Remove. (PLT_BTI_SMALL_ENTRY_SIZE, PLT_PAC_SMALL_ENTRY_SIZE): Update. (elfNN_aarch64_small_plt0_pac_entry): Remove. (elfNN_aarch64_small_plt0_bti_pac_entry): Remove. (elfNN_aarch64_small_plt0_bti_entry): Update. (elfNN_aarch64_small_plt_bti_entry): Update. (elfNN_aarch64_small_plt_pac_entry): Update. (elfNN_aarch64_tlsdesc_small_plt_bti_entry): Update. (setup_plt_values): Setup new entries. (elfNN_aarch64_finish_dynamic_sections): Remove size change. (elfNN_aarch64_plt_sym_val): Likewise. *** ld/ChangeLog *** 2019-04-25 Sudakshina Das <sudi.das@arm.com> * testsuite/ld-aarch64/bti-pac-plt-1.d: Update. * testsuite/ld-aarch64/bti-pac-plt-2.d: Update. * testsuite/ld-aarch64/bti-plt-1.d: Update. * testsuite/ld-aarch64/bti-plt-3.d: Update. * testsuite/ld-aarch64/bti-plt-5.d: Update. * testsuite/ld-aarch64/pac-plt-1.d: Update. * testsuite/ld-aarch64/pac-plt-2.d: Update.
29 lines
682 B
Makefile
29 lines
682 B
Makefile
#name: BTI PLT with only GNU PROP
|
|
#source: property-bti-pac1.s
|
|
#as: -mabi=lp64 -defsym __property_bti__=1
|
|
#ld: -e _start -L./tmpdir -lbti-plt-so
|
|
#objdump: -dr -j .plt
|
|
#target: *linux*
|
|
|
|
[^:]*: *file format elf64-.*aarch64
|
|
|
|
Disassembly of section \.plt:
|
|
|
|
[0-9a-f]+ <.*>:
|
|
.*: d503245f bti c
|
|
.*: a9bf7bf0 stp x16, x30, \[sp, #-16\]!
|
|
.*: 90000090 adrp x16, 410000 <.*>
|
|
.*: f9421611 ldr x17, \[x16, #1064\]
|
|
.*: 9110a210 add x16, x16, #0x428
|
|
.*: d61f0220 br x17
|
|
.*: d503201f nop
|
|
.*: d503201f nop
|
|
|
|
[0-9a-f]+ <.*>:
|
|
.*: d503245f bti c
|
|
.*: 90000090 adrp x16, 410000 <.*>
|
|
.*: f9421a11 ldr x17, \[x16, #1072\]
|
|
.*: 9110c210 add x16, x16, #0x430
|
|
.*: d61f0220 br x17
|
|
.*: d503201f nop
|