[ARM/FDPIC v6 09/24] [ARM] FDPIC: Add support for taking address of nested function
authorChristophe Lyon <christophe.lyon@st.com>
Tue, 10 Sep 2019 07:52:02 +0000 (09:52 +0200)
committerChristophe Lyon <clyon@gcc.gnu.org>
Tue, 10 Sep 2019 07:52:02 +0000 (09:52 +0200)
commitbc87cffb13c836cc72b37dfd90544c7c21268702
tree9cadc55d9ee5879a42a2e6649c7a854f31eb2ba8
parent96ef8d00f70f076933eea68124043e9ba675412d
[ARM/FDPIC v6 09/24] [ARM] FDPIC: Add support for taking address of nested function

In FDPIC mode, the trampoline generated to support pointers to nested
functions looks like:

   .word trampoline address
   .word trampoline GOT address
   ldr  r12, [pc, #8]
   ldr  r9, [pc, #8]
   ldr pc, [pc, #8]
   .word static chain value
   .word GOT address
   .word function's address

because in FDPIC function pointers are actually pointers to function
descriptors, we have to actually generate a function descriptor for
the trampoline.

2019--09-10  Christophe Lyon  <christophe.lyon@st.com>
Mickaël Guêné <mickael.guene@st.com>

gcc/
* config/arm/arm.c (arm_asm_trampoline_template): Add FDPIC
support.
(arm_trampoline_init): Likewise.
(arm_trampoline_adjust_address): Likewise.
* config/arm/arm.h (TRAMPOLINE_SIZE): Likewise.

Co-Authored-By: Mickaël Guêné <mickael.guene@st.com>
From-SVN: r275571
gcc/ChangeLog
gcc/config/arm/arm.c
gcc/config/arm/arm.h