gcc/libgcc/config
Szabolcs Nagy b097c7a27f libgcc: fix the handling of return address mangling [PR94891]
Mangling, currently only used on AArch64 for return address signing,
is an internal representation that should not be exposed via

  __builtin_return_address return value,
  __builtin_eh_return handler argument,
  _Unwind_DebugHook handler argument.

Note that a mangled address might not even fit into a void *, e.g.
with AArch64 ilp32 ABI the return address is stored as 64bit, so
the mangled return address cannot be accessed via _Unwind_GetPtr.

This patch changes the unwinder hooks as follows:

MD_POST_EXTRACT_ROOT_ADDR is removed: root address comes from
__builtin_return_address which is not mangled.

MD_POST_EXTRACT_FRAME_ADDR is renamed to MD_DEMANGLE_RETURN_ADDR,
it now operates on _Unwind_Word instead of void *, so the hook
should work when return address signing is enabled on AArch64 ilp32.
(But for that __builtin_aarch64_autia1716 should be fixed to operate
on 64bit input instead of a void *.)

MD_POST_FROB_EH_HANDLER_ADDR is removed: it is the responsibility of
__builtin_eh_return to do the mangling if necessary.

2020-07-13  Szabolcs Nagy  <szabolcs.nagy@arm.com>

libgcc/ChangeLog:

	PR target/94891
	* config/aarch64/aarch64-unwind.h (MD_POST_EXTRACT_ROOT_ADDR): Remove.
	(MD_POST_FROB_EH_HANDLER_ADDR): Remove.
	(MD_POST_EXTRACT_FRAME_ADDR): Rename to ...
	(MD_DEMANGLE_RETURN_ADDR): This.
	(aarch64_post_extract_frame_addr): Rename to ...
	(aarch64_demangle_return_addr): This.
	(aarch64_post_frob_eh_handler_addr): Remove.
	* unwind-dw2.c (uw_update_context): Demangle return address.
	(uw_frob_return_addr): Remove.
2020-07-13 13:49:20 +01:00
..
aarch64 libgcc: fix the handling of return address mangling [PR94891] 2020-07-13 13:49:20 +01:00
alpha Update copyright years. 2020-01-01 12:51:42 +01:00
arc [ARC] Make libgcc compatible with ARC's reduced register set config. 2020-01-27 14:51:03 +02:00
arm arm: unified syntax for libgcc when built with -Os [PR94220] 2020-03-26 10:59:34 +00:00
avr Fix typo in ChangeLog 2020-06-24 10:10:56 -04:00
bfin Update copyright years. 2020-01-01 12:51:42 +01:00
bpf
c6x Update copyright years. 2020-01-01 12:51:42 +01:00
cr16 Update copyright years. 2020-01-01 12:51:42 +01:00
cris libgcc: cris: Remove support for crisv32-*-* and cris*-*-linux 2020-05-09 03:00:38 +02:00
csky Update copyright years. 2020-01-01 12:51:42 +01:00
epiphany Update copyright years. 2020-01-01 12:51:42 +01:00
fr30 Update copyright years. 2020-01-01 12:51:42 +01:00
frv Fix libgcc build failure for FRV with recent versions of gas. 2020-02-10 14:12:32 -07:00
ft32 Update copyright years. 2020-01-01 12:51:42 +01:00
gcn [amdgcn] Remove dependency on stdint.h in libgcc 2020-01-10 23:19:41 +00:00
h8300 Update copyright years. 2020-01-01 12:51:42 +01:00
i386 x86: Move cpuinfo.h from libgcc to common/config/i386 2020-06-24 05:47:34 -07:00
ia64 Missing __divtf3@@GCC_4.4.0 on ia64 2020-06-04 09:56:32 +02:00
iq2000 Update copyright years. 2020-01-01 12:51:42 +01:00
libbid Add missing ChangeLog entries. 2020-05-05 16:10:13 +02:00
lm32 Update copyright years. 2020-01-01 12:51:42 +01:00
m32c Update copyright years. 2020-01-01 12:51:42 +01:00
m32r Update copyright years. 2020-01-01 12:51:42 +01:00
m68k Update copyright years. 2020-01-01 12:51:42 +01:00
mcore Update copyright years. 2020-01-01 12:51:42 +01:00
microblaze Update copyright years. 2020-01-01 12:51:42 +01:00
mips Emit .note.GNU-stack for hard-float linux targets. 2020-01-23 17:00:03 +01:00
mmix Update copyright years. 2020-01-01 12:51:42 +01:00
moxie Update copyright years. 2020-01-01 12:51:42 +01:00
msp430 Update copyright years. 2020-01-01 12:51:42 +01:00
nds32 Update copyright years. 2020-01-01 12:51:42 +01:00
nios2 nios2: Support for GOT-relative DW_EH_PE_datarel encoding. 2020-01-31 16:46:50 -08:00
nvptx Update copyright years. 2020-01-01 12:51:42 +01:00
or1k Update copyright years. 2020-01-01 12:51:42 +01:00
pa Update copyright years. 2020-01-01 12:51:42 +01:00
pdp11
pru Update copyright years. 2020-01-01 12:51:42 +01:00
riscv RISC-V: Make __divdi3 handle div by zero same as hardware. 2020-06-02 11:44:44 -07:00
rl78 Update copyright years. 2020-01-01 12:51:42 +01:00
rs6000 aix: Add GCC64 configuration and FAT target libraries. 2020-06-21 14:14:46 -04:00
rx Update copyright years. 2020-01-01 12:51:42 +01:00
s390 S/390 zTPF: Handle skip trace addresses when unwinding 2020-04-03 08:46:11 +02:00
score Update copyright years. 2020-01-01 12:51:42 +01:00
sh Update copyright years. 2020-01-01 12:51:42 +01:00
sol2 Update copyright years. 2020-01-01 12:51:42 +01:00
sparc Update copyright years. 2020-01-01 12:51:42 +01:00
stormy16 Update copyright years. 2020-01-01 12:51:42 +01:00
tilegx
tilepro Update copyright years. 2020-01-01 12:51:42 +01:00
v850 Update copyright years. 2020-01-01 12:51:42 +01:00
vax Update copyright years. 2020-01-01 12:51:42 +01:00
visium Update copyright years. 2020-01-01 12:51:42 +01:00
vms Update copyright years. 2020-01-01 12:51:42 +01:00
xtensa xtensa: libgcc: fix PR target/95571 2020-06-08 18:30:07 -07:00
darwin10-unwind-find-enc-func.c
darwin-64.c Update copyright years. 2020-01-01 12:51:42 +01:00
darwin-crt3.c Update copyright years. 2020-01-01 12:51:42 +01:00
darwin-crt-tm.c Update copyright years. 2020-01-01 12:51:42 +01:00
gthr-lynx.h Update copyright years. 2020-01-01 12:51:42 +01:00
gthr-rtems.h Update copyright years. 2020-01-01 12:51:42 +01:00
gthr-vxworks-cond.c Update copyright years. 2020-01-01 12:51:42 +01:00
gthr-vxworks-thread.c Update copyright years. 2020-01-01 12:51:42 +01:00
gthr-vxworks-tls.c Update copyright years. 2020-01-01 12:51:42 +01:00
gthr-vxworks.c Update copyright years. 2020-01-01 12:51:42 +01:00
gthr-vxworks.h Guard inclusion of vxAtomicLib.h from gthr-vxworks.h 2020-01-05 12:45:54 +00:00
hardfp.c Update copyright years. 2020-01-01 12:51:42 +01:00
libgcc-glibc.ver Update copyright years. 2020-01-01 12:51:42 +01:00
libgcc-libsystem.ver
no-sfp-machine.h
no-unwind.h
t-crtfm
t-crtstuff-pic
t-darwin
t-dfprules
t-eh-dw2-dip
t-fdpbit
t-fixedpoint-gnu-prefix
t-fpbit
t-freebsd-thread
t-gnu-prefix
t-gthr-noweak
t-gthr-vxworks
t-gthr-vxworksae
t-hardfp Update copyright years. 2020-01-01 12:51:42 +01:00
t-hardfp-sfdf Update copyright years. 2020-01-01 12:51:42 +01:00
t-libgcc-pic
t-libunwind
t-libunwind-elf Update copyright years. 2020-01-01 12:51:42 +01:00
t-linux
t-openbsd-thread
t-rtems
t-slibgcc Update copyright years. 2020-01-01 12:51:42 +01:00
t-slibgcc-darwin
t-slibgcc-elf-ver
t-slibgcc-fuchsia Update copyright years. 2020-01-01 12:51:42 +01:00
t-slibgcc-gld
t-slibgcc-gld-nover
t-slibgcc-hpux
t-slibgcc-libgcc Update copyright years. 2020-01-01 12:51:42 +01:00
t-slibgcc-nolc-override
t-slibgcc-sld
t-slibgcc-vms
t-softfp Update copyright years. 2020-01-01 12:51:42 +01:00
t-softfp-compat
t-softfp-excl
t-softfp-sfdf
t-softfp-sfdftf
t-softfp-tf
t-stack
t-tls
t-vxcrtstuff
t-vxworks
t-vxworks7
t-vxworksae
unwind-dw2-fde-darwin.c Update copyright years. 2020-01-01 12:51:42 +01:00
vxcache.c Update copyright years. 2020-01-01 12:51:42 +01:00
vxcrtstuff.c Fix typo in macro name guarding conditional in vxcrtstuff.c 2019-12-30 21:11:22 +00:00