From 71e3d1b0078099d824996032f954c7af8830362d Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Wed, 2 Sep 2020 20:33:00 +0100 Subject: [PATCH] Darwin, Arm64 : Make trampoline templates linker-visible. 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. --- gcc/config/darwin.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index 993e683a1845..2b1da90e1711 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -826,6 +826,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)