binutils-gdb/ld/testsuite/ld-powerpc/notoc.wf

34 lines
974 B
Plaintext
Raw Normal View History

PowerPC64 EH info for _notoc linkage stubs This patch generates EH info for the new _notoc linkage stubs, to support unwinding from asynchronous signal handlers. Unwinding through the __tls_get_addr_opt stub was already supported, but that was just a single stub. With multiple stubs the EH opcodes need to be emitted and sized when iterating over stubs, so this is done when emitting and sizing the stub code. Emitting the CIEs and FDEs is done when sizing the stubs, as we did before in order to have the linker generated FDEs indexed in .eh_frame_hdr. I moved the final tweaks to FDEs from ppc64_elf_finish_dynamic_sections to ppc64_elf_build_stubs simply because it's tidier to be done with them at that point. bfd/ * elf64-ppc.c (struct map_stub): Delete tls_get_addr_opt_bctrl. Add lr_restore, eh_size and eh_base. (eh_advance, eh_advance_size): New functions. (build_tls_get_addr_stub): Emit EH info for stub. (ppc_build_one_stub): Likewise for _notoc stubs. (ppc_size_one_stub): Size EH info for stub. (group_sections): Init new map_stub fields. (stub_eh_frame_size): Delete. (ppc64_elf_size_stubs): Size EH info for stubs. Set up dummy EH program for stubs. (ppc64_elf_build_stubs): Reinit new map_stub fields. Set FDE offset to stub section here.. (ppc64_elf_finish_dynamic_sections): ..rather than here. ld/ * testsuite/ld-powerpc/notoc.s: Generate some cfi. * testsuite/ld-powerpc/notoc.d: Adjust. * testsuite/ld-powerpc/notoc.wf: New file. * testsuite/ld-powerpc/powerpc.exp: Run "ext" and "notoc" tests as run_ld_link_tests rather than run_dump_test.
2018-08-06 20:13:51 +08:00
Contents of the \.eh_frame section:
00000000 0000000000000010 00000000 CIE
Version: 1
Augmentation: "zR"
Code alignment factor: 4
Data alignment factor: -8
Return address column: 65
Augmentation data: 1b
DW_CFA_def_cfa: r1 ofs 0
00000014 0000000000000024 00000018 FDE cie=00000000 pc=00000000100000c0\.\.0000000010000140
DW_CFA_advance_loc: 24 to 00000000100000d8
DW_CFA_register: r65 in r12
DW_CFA_advance_loc: 8 to 00000000100000e0
DW_CFA_restore_extended: r65
DW_CFA_advance_loc: 40 to 0000000010000108
DW_CFA_register: r65 in r12
DW_CFA_advance_loc: 8 to 0000000010000110
DW_CFA_restore_extended: r65
DW_CFA_advance_loc: 16 to 0000000010000120
DW_CFA_register: r65 in r12
DW_CFA_advance_loc: 8 to 0000000010000128
DW_CFA_restore_extended: r65
DW_CFA_nop
DW_CFA_nop
0000003c 0000000000000010 00000040 FDE cie=00000000 pc=00000000100001cc\.\.00000000100001d0
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop