Skip to content

Commit 92f4797

Browse files
committed
Darwin : Make trampoline templates linker-visible.
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 gcc-mirror#11 on the development branch. Signed-off-by: Iain Sandoe <[email protected]> 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 f1e2879)
1 parent 3b7661d commit 92f4797

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

gcc/config/darwin.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,8 @@ extern GTY(()) section * darwin_sections[NUM_DARWIN_SECTIONS];
839839
sprintf (LABEL, "*%s%ld", "lubsan_type", (long)(NUM));\
840840
else if (strcmp ("LASAN", PREFIX) == 0) \
841841
sprintf (LABEL, "*%s%ld", "lASAN", (long)(NUM));\
842+
else if (strcmp ("LTRAMP", PREFIX) == 0) \
843+
sprintf (LABEL, "*%s%ld", "lTRAMP", (long)(NUM));\
842844
else \
843845
sprintf (LABEL, "*%s%ld", PREFIX, (long)(NUM)); \
844846
} while (0)

0 commit comments

Comments
 (0)