Skip to content

Commit 44d4c62

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 <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 f1e2879)
1 parent 4dfbecb commit 44d4c62

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
@@ -842,6 +842,8 @@ extern GTY(()) section * darwin_sections[NUM_DARWIN_SECTIONS];
842842
sprintf (LABEL, "*%s%ld", "lubsan_type", (long)(NUM));\
843843
else if (strcmp ("LASAN", PREFIX) == 0) \
844844
sprintf (LABEL, "*%s%ld", "lASAN", (long)(NUM));\
845+
else if (strcmp ("LTRAMP", PREFIX) == 0) \
846+
sprintf (LABEL, "*%s%ld", "lTRAMP", (long)(NUM));\
845847
else \
846848
sprintf (LABEL, "*%s%ld", PREFIX, (long)(NUM)); \
847849
} while (0)

0 commit comments

Comments
 (0)