public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [pushed] Darwin : Make trampoline templates linker-visible.
@ 2021-11-05 21:05 Iain Sandoe
  0 siblings, 0 replies; only message in thread
From: Iain Sandoe @ 2021-11-05 21:05 UTC (permalink / raw)
  To: gcc-patches

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 #11 on the development branch.

Tested on x86_64-darwin, aarch64-darwin and x86_64-linux,
pushed to master, thanks
Iain

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.
---
 gcc/config/darwin.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 27cb3e4bb30..e54cbb11cee 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -921,6 +921,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)
-- 
2.24.3 (Apple Git-128)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-05 21:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-05 21:05 [pushed] Darwin : Make trampoline templates linker-visible Iain Sandoe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).