mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-06 12:09:26 +08:00
1dbade7441
This is part of the patch series to add support for BTI and PAC in AArch64 linker. 1) This patch adds new definitions of PAC enabled PLTs and both BTI and PAC enabled PLTs. 2) It also defines the new dynamic tag DT_AARCH64_PAC_PLT for the PAC enabled PLTs. 3) This patch adds a new ld command line option: --pac-plt. In the presence of this option, the linker uses the PAC enabled PLTs and marks with DT_AARCH64_PAC_PLT. 4) In case both BTI and PAC are enabled the linker should pick PLTs enabled with both and also use dynamic tags for both. All these are made according to the new AArch64 ELF ABI https://developer.arm.com/docs/ihi0056/latest/elf-for-the-arm-64-bit-architecture-aarch64-abi-2018q4 *** bfd/ChangeLog *** 2019-03-13 Sudakshina Das <sudi.das@arm.com> * elfnn-aarch64.c (PLT_PAC_ENTRY_SIZE, PLT_PAC_SMALL_ENTRY_SIZE): New. (PLT_BTI_PAC_ENTRY_SIZE, PLT_BTI_PAC_SMALL_ENTRY_SIZE): New. (setup_plt_values): Account for PAC or PAC and BTI enabled PLTs. (elfNN_aarch64_size_dynamic_sections): Add checks for PLT_BTI_PAC and PLT_PAC_PLT. (elfNN_aarch64_finish_dynamic_sections): Account for PLT_BTI_PAC. (get_plt_type): Add case for DT_AARCH64_PAC_PLT. (elfNN_aarch64_plt_sym_val): Add cases for PLT_BTI_PAC and PLT_PAC. *** binutils/ChangeLog *** 2019-03-13 Sudakshina Das <sudi.das@arm.com> * readelf.c (get_aarch64_dynamic_type): Add case for DT_AARCH64_PAC_PLT. (dynamic_section_aarch64_val): Likewise. *** include/ChangeLog *** 2019-03-13 Sudakshina Das <sudi.das@arm.com> * elf/aarch64.h (DT_AARCH64_PAC_PLT): New. *** ld/ChangeLog *** 2019-03-13 Sudakshina Das <sudi.das@arm.com> * NEWS: Document --pac-plt. * emultempl/aarch64elf.em (OPTION_PAC_PLT): New. (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS): Add pac-plt. (PARSE_AND_LIST_ARGS_CASES): Handle OPTION_PAC_PLT. * testsuite/ld-aarch64/aarch64-elf.exp: Add the following tests. * testsuite/ld-aarch64/bti-pac-plt-1.d: New test. * testsuite/ld-aarch64/bti-pac-plt-2.d: New test. * testsuite/ld-aarch64/pac-plt-1.d: New test. * testsuite/ld-aarch64/pac-plt-2.d: New test. * testsuite/ld-aarch64/bti-plt-1.s: Add .ifndef directive.
37 lines
907 B
Makefile
37 lines
907 B
Makefile
#source: bti-plt-1.s
|
|
#as: -mabi=lp64
|
|
#ld: --force-bti --pac-plt -e _start -T bti-plt.ld -L./tmpdir -lbti-plt-so
|
|
#objdump: -dr -j .plt
|
|
|
|
[^:]*: *file format elf64-.*aarch64
|
|
|
|
Disassembly of section \.plt:
|
|
|
|
[0-9]+ <.*>:
|
|
.*: d503245f bti c
|
|
.*: a9bf7bf0 stp x16, x30, \[sp, #-16\]!
|
|
.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_>
|
|
.*: f9400e11 ldr x17, \[x16, #24\]
|
|
.*: 91006210 add x16, x16, #0x18
|
|
.*: d503219f autia1716
|
|
.*: d61f0220 br x17
|
|
.*: d503201f nop
|
|
.*: d503201f nop
|
|
.*: d503201f nop
|
|
|
|
[0-9]+ <.*>:
|
|
.*: d503245f bti c
|
|
.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_>
|
|
.*: f9401211 ldr x17, \[x16, #32\]
|
|
.*: 91008210 add x16, x16, #0x20
|
|
.*: d503219f autia1716
|
|
.*: d61f0220 br x17
|
|
|
|
[0-9]+ <.*>:
|
|
.*: d503245f bti c
|
|
.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_>
|
|
.*: f9401611 ldr x17, \[x16, #40\]
|
|
.*: 9100a210 add x16, x16, #0x28
|
|
.*: d503219f autia1716
|
|
.*: d61f0220 br x17
|