public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Matthew Malcomson <matmal01@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/vendors/ARM/heads/morello)] Override -finhibit-size-directive when building crtstuff
Date: Tue, 21 Sep 2021 09:13:34 +0000 (GMT)	[thread overview]
Message-ID: <20210921091334.E4356385840E@sourceware.org> (raw)

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


                 reply	other threads:[~2021-09-21  9:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210921091334.E4356385840E@sourceware.org \
    --to=matmal01@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).