public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/ARM/heads/morello)] Override -finhibit-size-directive when building crtstuff
@ 2021-09-21  9:13 Matthew Malcomson
  0 siblings, 0 replies; only message in thread
From: Matthew Malcomson @ 2021-09-21  9:13 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:bf2146886b94651a4eec149e6bbe38ea8cdaa3ec

commit bf2146886b94651a4eec149e6bbe38ea8cdaa3ec
Author: Matthew Malcomson <matthew.malcomson@arm.com>
Date:   Mon Aug 9 10:52:41 2021 +0100

    Override -finhibit-size-directive when building crtstuff
    
    This is a bit of a dangerous change since we don't know why this flag is
    used.  Without using the .size directives the linker doesn't know the
    size of functions and hence can't satisfy the MORELLO_CAPINIT
    relocation.
    
    From manual inspection it doesn't look like there's any particular
    reason to use this flag, but hopefully the testing it receives in use
    will be enough to trigger any problem.

Diff:
---
 libgcc/config/aarch64/t-aarch64 | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/libgcc/config/aarch64/t-aarch64 b/libgcc/config/aarch64/t-aarch64
index fce36be7480..b0527da512e 100644
--- a/libgcc/config/aarch64/t-aarch64
+++ b/libgcc/config/aarch64/t-aarch64
@@ -19,3 +19,20 @@
 # <http://www.gnu.org/licenses/>.
 
 LIB2ADD += $(srcdir)/config/aarch64/sync-cache.c
+
+# TODO lots of testing ;-)
+# crtbegin.o and crtend.o are compiled including -finhibit-size-directive.
+# As the name implies, this means we don't emit the .size directive.
+# For morello that's a problem, since the CAPINIT relocation should be made
+# against a symbol that has a size (otherwise the linker does not know what
+# bounds to put on the capability) and there are a few functions we need the
+# CAPINIT relocation against.
+#
+# I've looked at the emitted assembly for crtbegin.o, and AFAICS there are no
+# problems that the .size directive would cause (though this kind of manual
+# inspection is very error-prone).  So we're overriding that command line flag
+# for now.
+#
+# TODO It would be nice to only use this flag when building purecap crtstuff.c
+# Doesn't seem worth the effort to look into right now.
+CRTSTUFF_T_CFLAGS = -fno-inhibit-size-directive


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

only message in thread, other threads:[~2021-09-21  9:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-21  9:13 [gcc(refs/vendors/ARM/heads/morello)] Override -finhibit-size-directive when building crtstuff Matthew Malcomson

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).