This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 1/4] libebl: new backend attribute ra_offset.


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   | 6 ++++++
 libebl/eblabicfi.c | 6 ++++++
 libebl/libebl.h    | 6 ++++++
 libebl/libeblP.h   | 6 ++++++
 4 files changed, 24 insertions(+)

diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index d040c08..a1a1022 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -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
diff --git a/libebl/eblabicfi.c b/libebl/eblabicfi.c
index 6b0e18e..8bf189f 100644
--- a/libebl/eblabicfi.c
+++ b/libebl/eblabicfi.c
@@ -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;
+}
diff --git a/libebl/libebl.h b/libebl/libebl.h
index 7dbf460..efcb6d6 100644
--- a/libebl/libebl.h
+++ b/libebl/libebl.h
@@ -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
diff --git a/libebl/libeblP.h b/libebl/libeblP.h
index dbd67f3..5b339b3 100644
--- a/libebl/libeblP.h
+++ b/libebl/libeblP.h
@@ -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,
-- 
2.3.4

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]