]> gcc.gnu.org Git - gcc.git/commitdiff
Darwin : Make trampoline templates linker-visible.
authorIain Sandoe <iain@sandoe.co.uk>
Wed, 2 Sep 2020 19:33:00 +0000 (20:33 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Thu, 14 Apr 2022 05:26:20 +0000 (06:26 +0100)
For aarch64, the alignment of the LTRAMPn symbols matters.

Actually, the LTRAMPn  symbols _are_ 8 byte aligned, but because
they are Local, the linker doesn't know that this guarantee can be met.
It assumes that they are not necessarily more aligned than the
containing section (ld64 atoms strike again).

The fix is to publish the trampoline symbol for the linker to access
directly - it can then see that the atom is suitably aligned.

Fixes issue #11 on the development branch.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/ChangeLog:

* config/darwin.h (ASM_GENERATE_INTERNAL_LABEL): Add LTRAMP
to the list of symbol prefixes that must be made linker-
visible.

(cherry picked from commit f1e2879ecfc8897df0e25a53e81d1868363c5e08)

gcc/config/darwin.h

index 35fc62497e979b759ac8d4037a3d5149e6c75b65..a9c1c75f9a8e3e0069efbebfaffad1ed397551de 100644 (file)
@@ -842,6 +842,8 @@ extern GTY(()) section * darwin_sections[NUM_DARWIN_SECTIONS];
       sprintf (LABEL, "*%s%ld", "lubsan_type", (long)(NUM));\
     else if (strcmp ("LASAN", PREFIX) == 0)    \
       sprintf (LABEL, "*%s%ld", "lASAN", (long)(NUM));\
+    else if (strcmp ("LTRAMP", PREFIX) == 0)   \
+      sprintf (LABEL, "*%s%ld", "lTRAMP", (long)(NUM));\
     else                                               \
       sprintf (LABEL, "*%s%ld", PREFIX, (long)(NUM));  \
   } while (0)
This page took 0.069117 seconds and 5 git commands to generate.