public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/ARM/heads/morello)] Temporary Morello hack for C only personality function
@ 2021-12-10 16:50 Matthew Malcomson
  0 siblings, 0 replies; only message in thread
From: Matthew Malcomson @ 2021-12-10 16:50 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:1297be8deb70b9858bb84f2bf70fc7e28fac15f4

commit 1297be8deb70b9858bb84f2bf70fc7e28fac15f4
Author: Matthew Malcomson <matthew.malcomson@arm.com>
Date:   Fri Dec 10 16:31:33 2021 +0000

    Temporary Morello hack for C only personality function
    
    As a temporary step, we are using old landing-pad information which
    specifies an offset from the call site record.  This offset does not
    include the LSB needed for a pure capability ABI.  Here we add that LSB.
    
    The final ABI records landing pad capabilities which are loaded by the
    personality function.  These capabilities will come with the relevant
    LSB.  Hence this change will not be needed for the final ABI.
    
    Since this is a hack commit, also including a TODO comment about one of
    the things we'll need to adjust when this gets cleaned up.

Diff:
---
 libgcc/unwind-c.c           | 16 +++++++++++++++-
 libgcc/unwind-dw2-fde-dip.c |  1 +
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/libgcc/unwind-c.c b/libgcc/unwind-c.c
index d1831bed92c..8054f9fd8d4 100644
--- a/libgcc/unwind-c.c
+++ b/libgcc/unwind-c.c
@@ -204,6 +204,8 @@ PERSONALITY_FUNCTION (int version,
     {
       _Unwind_Ptr cs_start, cs_len, cs_lp;
       _uleb128_t cs_action;
+      /* MORELLO TODO
+	 This is where we should handle the LSDA information.  */
 
       /* Note that all call-site encodings are "absolute" displacements.  */
       p = read_encoded_value (0, info.call_site_encoding, p, &cs_start);
@@ -217,7 +219,19 @@ PERSONALITY_FUNCTION (int version,
       else if (ip < info.Start + cs_start + cs_len)
 	{
 	  if (cs_lp)
-	    landing_pad = info.LPStart + cs_lp;
+	    {
+	      landing_pad = info.LPStart + cs_lp;
+#  ifdef __CHERI_PURE_CAPABILITY__
+	      /* MORELLO TODO temporary hack to use unmodified landing pad
+		 information.  The landing pad we calculate does not have the
+		 LSB set.  When we eventually implement the specified landing
+		 pad Morello information we'll be given a capability which
+		 correctly has the LSB set (and for that matter will be sealed,
+		 and will not be an offset from LPStart but a capability
+		 directly etc).  */
+	      landing_pad += 1;
+#  endif
+	    }
 	  goto found_something;
 	}
     }
diff --git a/libgcc/unwind-dw2-fde-dip.c b/libgcc/unwind-dw2-fde-dip.c
index 6e50405da08..31fb1548005 100644
--- a/libgcc/unwind-dw2-fde-dip.c
+++ b/libgcc/unwind-dw2-fde-dip.c
@@ -178,6 +178,7 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
   struct object ob;
   _Unwind_Ptr pc_low = 0, pc_high = 0;
 
+  /* MORELLO TODO Update types here dlpi_addr should hold uintptr_t.  */
   struct ext_dl_phdr_info
     {
       ElfW(Addr) dlpi_addr;


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

only message in thread, other threads:[~2021-12-10 16:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10 16:50 [gcc(refs/vendors/ARM/heads/morello)] Temporary Morello hack for C only personality function 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).