summaryrefslogtreecommitdiffstats
path: root/cpukit/libdl/rtl-mdreloc-sparc.c
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2016-12-07 17:20:38 +1100
committerChris Johns <chrisj@rtems.org>2016-12-14 09:07:16 +1100
commitc6eead1353e03542e5bad9efda3b6553125520d8 (patch)
treef2495a17c8d001a8249b0e6f785c3428df721a1d /cpukit/libdl/rtl-mdreloc-sparc.c
parentscore: Prevent thread_dispatch_disable_level < 0. (diff)
downloadrtems-c6eead1353e03542e5bad9efda3b6553125520d8.tar.bz2
libdl: Add C++ exception support to loaded modules.
This has been tested on SPARC, i386, PowerPC and ARM. Closes #2767.
Diffstat (limited to 'cpukit/libdl/rtl-mdreloc-sparc.c')
-rw-r--r--cpukit/libdl/rtl-mdreloc-sparc.c43
1 files changed, 36 insertions, 7 deletions
diff --git a/cpukit/libdl/rtl-mdreloc-sparc.c b/cpukit/libdl/rtl-mdreloc-sparc.c
index 509b62fb4a..38b385070e 100644
--- a/cpukit/libdl/rtl-mdreloc-sparc.c
+++ b/cpukit/libdl/rtl-mdreloc-sparc.c
@@ -41,6 +41,8 @@
#include "rtl-elf.h"
#include "rtl-error.h"
#include "rtl-trace.h"
+#include "rtl-unwind.h"
+#include "rtl-unwind-dw2.h"
/*
* The following table holds for each relocation type:
@@ -128,6 +130,13 @@ static const int reloc_target_bitmask[] = {
};
#define RELOC_VALUE_BITMASK(t) (reloc_target_bitmask[t])
+uint32_t
+rtems_rtl_elf_section_flags (const rtems_rtl_obj_t* obj,
+ const Elf_Shdr* shdr)
+{
+ return 0;
+}
+
bool
rtems_rtl_elf_rel_resolve_sym (Elf_Word type)
{
@@ -220,21 +229,22 @@ rtems_rtl_elf_relocate_rela (const rtems_rtl_obj_t* obj,
value &= mask;
if (RELOC_UNALIGNED(type)) {
- /* Handle unaligned relocations. */
- char *ptr = (char *)where;
+ /*
+ * Handle unaligned relocations.
+ */
+ char *ptr = (char*) where;
int i, size = RELOC_TARGET_SIZE (type) / 8;
/* Read it in one byte at a time. */
- for (i=0; i<size; i++)
+ for (i = size - 1; i >= 0; i--)
tmp = (tmp << 8) | ptr[i];
tmp &= ~mask;
tmp |= value;
/* Write it back out. */
- for (i=0; i<size; i++)
- ptr[i] = ((tmp >> (8*i)) & 0xff);
-
+ for (i = size - 1; i >= 0; i--, tmp >>= 8)
+ ptr[i] = tmp & 0xff;
} else {
*where &= ~mask;
*where |= value;
@@ -245,7 +255,6 @@ rtems_rtl_elf_relocate_rela (const rtems_rtl_obj_t* obj,
printf ("rtl: %s %p @ %p in %s\n",
reloc_names[type], (void *)tmp, where, rtems_rtl_obj_oname (obj));
-
return true;
}
@@ -260,3 +269,23 @@ rtems_rtl_elf_relocate_rel (const rtems_rtl_obj_t* obj,
printf ("rtl: rel type record not supported; please report\n");
return false;
}
+
+bool
+rtems_rtl_elf_unwind_parse (const rtems_rtl_obj_t* obj,
+ const char* name,
+ uint32_t flags)
+{
+ return rtems_rtl_elf_unwind_dw2_parse (obj, name, flags);
+}
+
+bool
+rtems_rtl_elf_unwind_register (rtems_rtl_obj_t* obj)
+{
+ return rtems_rtl_elf_unwind_dw2_register (obj);
+}
+
+bool
+rtems_rtl_elf_unwind_deregister (rtems_rtl_obj_t* obj)
+{
+ return rtems_rtl_elf_unwind_dw2_deregister (obj);
+}