]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libebl: new backend attribute ra_offset.
authorJose E. Marchesi <jose.marchesi@oracle.com>
Tue, 8 Dec 2015 18:10:40 +0000 (19:10 +0100)
committerMark Wielaard <mjw@redhat.com>
Sun, 3 Jan 2016 09:26:30 +0000 (10:26 +0100)
Some backends need to fine-tune the return address as fetched from the
corresponding CFI register.  This patch adds a new backend attribute
ra_offset and the corresponding ebl_ra_offset getter function.

Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com>
libebl/ChangeLog
libebl/eblabicfi.c
libebl/libebl.h
libebl/libeblP.h

index d040c08fe17ac0fa32d5644452812eea297704ae..a1a102249200950c08892319243b9e56dce71a3b 100644 (file)
@@ -1,3 +1,9 @@
+2015-12-08  Jose E. Marchesi  <jose.marchesi@oracle.com>
+
+       * libebl.h: Prototype for ebl_ra_offset.
+       * eblabicfi.c (ebl_ra_offset): New function.
+       * libeblP.h (struct ebl): new field ra_offset;
+
 2015-09-24  Jose E. Marchesi  <jose.marchesi@oracle.com>
 
        * Makefile.am (AM_CFLAGS): Use -fPIC instead of -fpic to avoid
index 6b0e18e4d7ce0caf7821005ea52afe3ad2c6a5e5..8bf189f194f8925a4d7ed26e552fa1f92d15b537 100644 (file)
@@ -38,3 +38,9 @@ ebl_abi_cfi (Ebl *ebl, Dwarf_CIE *abi_info)
 {
   return ebl == NULL ? -1 : ebl->abi_cfi (ebl, abi_info);
 }
+
+int
+ebl_ra_offset (Ebl *ebl)
+{
+  return ebl->ra_offset;
+}
index 7dbf4608bcf323ffb7d5344a0640cb6d98f127c5..efcb6d609a8d9d1081d6ad6b00c7d1e33ed162cc 100644 (file)
@@ -422,6 +422,12 @@ extern bool ebl_set_initial_registers_tid (Ebl *ebl,
 extern size_t ebl_frame_nregs (Ebl *ebl)
   __nonnull_attribute__ (1);
 
+/* Offset to apply to the value of the return_address_register, as
+   fetched from a Dwarf CFI.  This is used by some backends, where the
+   return_address_register actually contains the call address.  */
+extern int ebl_ra_offset (Ebl *ebl)
+  __nonnull_attribute__ (1);
+
 /* Mask to use for function symbol or unwind return addresses in case
    the architecture adds some extra non-address bits to it.  This is
    different from ebl_resolve_sym_value which only works for actual
index dbd67f3ef5b44b3b49fdfd0feb1440e5428f3c16..5b339b31dfc7e1210cff3e4080d95074aee85eff 100644 (file)
@@ -64,6 +64,12 @@ struct ebl
      Ebl architecture can unwind iff FRAME_NREGS > 0.  */
   size_t frame_nregs;
 
+  /* Offset to apply to the value of the return_address_register, as
+     fetched from a Dwarf CFI.  This is used by some backends, where
+     the return_address_register actually contains the call
+     address.  */
+  int ra_offset;
+
   /* Mask to use to turn a function value into a real function address
      in case the architecture adds some extra non-address bits to it.
      If not initialized (0) then ebl_func_addr_mask will return ~0,