2
0
mirror of https://sourceware.org/git/binutils-gdb.git synced 2024-12-15 04:31:49 +08:00
binutils-gdb/ld/testsuite
Indu Bhagat 5ab84cb8c8 ld: generate SFrame stack trace info for .plt.got
PR/32298 sframe: no SFrame stack trace info generated for .plt.got

Add support to generate SFrame stack trace info for .plt.got section.
Enhance the current definition of struct elf_x86_sframe_plt to include
initialized SFrame FDE/FREs applicable for .plt.got section.  There are
two variants of .plt.got entries: 16 byte and 8 byte.

8 byte:
    ff 25 00 00 00 00     jmpq  *name@GOTPCREL(%rip)
    66 90                 xchg  %ax,%ax

16 byte:
    f3 0f 1e fa           endbr64
    ff 25 66 2f 00 00     jmpq  *name@GOTPCREL(%rip)
    66 0f 1f 44 00 00     nopw   0x0(%rax,%rax,1)

For the testcase, define some application symbols such that their PLT
entry is placed in .plt.got and ensure SFrame information is generated
with and without -z ibtplt.

ChangeLog:
	PR/32298
	* bfd/elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
	PLT GOT entry size is different for IBT vs non IBT PLTs.
	* bfd/elfxx-x86.c (enum dynobj_sframe_plt_type): New enum for
	SFRAME_PLT_GOT.
	(_bfd_x86_elf_create_sframe_plt): Handle SFRAME_PLT_GOT.
	(_bfd_x86_elf_write_sframe_plt): Likewise.
	(_bfd_x86_elf_late_size_sections): Likewise.
	(_bfd_x86_elf_finish_dynamic_sections): Likewise.
	* bfd/elfxx-x86.h (struct elf_x86_sframe_plt): Add new members
	to keep information about PLT GOT entries.
	(struct elf_x86_link_hash_table): Add support for creating
	SFrame section for .plt.got.
	* ld/testsuite/ld-x86-64/x86-64.exp: Add new tests.
	* ld/testsuite/ld-x86-64/sframe-pltgot-1.d: New test.
	* ld/testsuite/ld-x86-64/sframe-pltgot-1.s: New test.
	* ld/testsuite/ld-x86-64/sframe-pltgot-2.d: New test.
2024-10-30 08:42:25 -07:00
..
config
ld-aarch64
ld-alpha
ld-arc
ld-arm arm: Handle undefweak with ST_BRANCH_UNKNOWN 2024-09-11 15:34:32 +00:00
ld-auto-import
ld-avr
ld-bootstrap
ld-bpf
ld-cdtest
ld-checks
ld-cris
ld-crx
ld-csky
ld-ctf
ld-cygwin
ld-d10v
ld-discard
ld-dynamic
ld-elf ld/ELF: Add --image-base command line option to the ELF linker 2024-10-29 19:38:39 +10:30
ld-elfcomm
ld-elfvers
ld-elfweak
ld-fastcall
ld-frv
ld-gc
ld-h8300
ld-i386 ld: Ignore .note.gnu.build-id when placing orphaned notes 2024-09-26 19:43:08 +08:00
ld-ia64
ld-ifunc
ld-kvx
ld-libs
ld-linkonce
ld-loongarch-elf LoongArch: Check PC-relative relocations for shared libraries 2024-10-17 21:01:52 +08:00
ld-m68hc11
ld-m68k
ld-mep
ld-metag
ld-mips-elf Revert "MIPS: correct macro use in gas and ld testsuites" 2024-08-15 09:49:33 -07:00
ld-misc
ld-mmix
ld-mn10300
ld-msp430-elf
ld-nds32
ld-nios2
ld-or1k
ld-pdp11
ld-pe ld/pdb: Handle DEBUG_S_INLINEELINES data 2024-09-24 02:33:08 +01:00
ld-pie
ld-plugin PR32300, --dependency-file: link dependencies are not all collected 2024-10-26 10:25:38 +10:30
ld-powerpc
ld-pru
ld-riscv-elf RISC-V: process rs_align_code also when relaxing 2024-08-23 09:22:30 +02:00
ld-s12z
ld-s390
ld-scripts
ld-selective
ld-sframe
ld-sh
ld-shared
ld-size
ld-sparc
ld-spu
ld-srec
ld-tic6x
ld-tilegx
ld-tilepro
ld-undefined
ld-unique
ld-v850
ld-vax-elf
ld-visium
ld-vsb
ld-vxworks
ld-x86-64 ld: generate SFrame stack trace info for .plt.got 2024-10-30 08:42:25 -07:00
ld-xstormy16
ld-xtensa
ld-z8k
ld-z80
lib Move uses_elf_em to ld-lib.exp 2024-09-28 15:45:50 +09:30
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-9303