Skip to content

Commit 69ea4a6

Browse files
iainscatap
authored andcommitted
Darwin : Make trampoline templates linker-visible.
For Arm64, 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. (cherry picked from commit 717057366d780cc3f54d5621e78334a3e63789d0)
1 parent d652c57 commit 69ea4a6

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
@@ -895,6 +895,8 @@ extern GTY(()) section * darwin_sections[NUM_DARWIN_SECTIONS];
895895
sprintf (LABEL, "*%s%ld", "lubsan_type", (long)(NUM));\
896896
else if (strcmp ("LASAN", PREFIX) == 0) \
897897
sprintf (LABEL, "*%s%ld", "lASAN", (long)(NUM));\
898+
else if (strcmp ("LTRAMP", PREFIX) == 0) \
899+
sprintf (LABEL, "*%s%ld", "lTRAMP", (long)(NUM));\
898900
else \
899901
sprintf (LABEL, "*%s%ld", PREFIX, (long)(NUM)); \
900902
} while (0)

0 commit comments

Comments
 (0)