summaryrefslogtreecommitdiffstats
path: root/backends
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2014-06-14 17:15:37 +0200
committerMark Wielaard <[email protected]>2014-06-22 13:47:48 +0200
commitc1c1c06e30f0b3b4ae66fcfec6318a93b8f31569 (patch)
treee5b811236c230f2ea82749f0ad9c2c4ac1bcf396 /backends
parentba9e5156207e3c2bb85adc747376e774af3c0df6 (diff)
libebl: Add ebl_func_addr_mask plus ARM backend implementation.
The ARM EABI says that the zero bit of function symbol st_value indicates whether the symbol points to a THUMB or ARM function. Also the return value address in an unwind will contain the same extra bit to indicate whether to return to a regular ARM or THUMB function. Add a new ebl function to mask off such bits and turn a function value into a function address so that we get the actual value that a function symbol or return address points to. It isn't easily possible to reuse the existing ebl_resolve_sym_value for this purpose, so we end up with another hook that can be used from dwfl_module_getsym, handle_cfi and elflint. Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'backends')
-rw-r--r--backends/ChangeLog4
-rw-r--r--backends/arm_init.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/backends/ChangeLog b/backends/ChangeLog
index 7eda035c..c846a958 100644
--- a/backends/ChangeLog
+++ b/backends/ChangeLog
@@ -1,3 +1,7 @@
+2014-06-17 Mark Wielaard <[email protected]>
+
+ * arm_init.c (arm_init): Set func_addr_mask.
+
2014-06-20 Petr Machata <[email protected]>
* alpha_retval.c (alpha_return_value_location): Call
diff --git a/backends/arm_init.c b/backends/arm_init.c
index 92e6cd51..3283c978 100644
--- a/backends/arm_init.c
+++ b/backends/arm_init.c
@@ -69,5 +69,8 @@ arm_init (elf, machine, eh, ehlen)
eh->frame_nregs = 16;
HOOK (eh, set_initial_registers_tid);
+ /* Bit zero encodes whether an function address is THUMB or ARM. */
+ eh->func_addr_mask = ~(GElf_Addr)1;
+
return MODVERSION;
}