Skip to content

Commit

Permalink
Darwin, Arm64 : Make trampoline templates linker-visible.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
iains committed Sep 21, 2020
1 parent b8504c4 commit 581c0a2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gcc/config/darwin.h
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,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)
Expand Down

0 comments on commit 581c0a2

Please sign in to comment.