From c6eead1353e03542e5bad9efda3b6553125520d8 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Wed, 7 Dec 2016 17:20:38 +1100 Subject: libdl: Add C++ exception support to loaded modules. This has been tested on SPARC, i386, PowerPC and ARM. Closes #2767. --- cpukit/libdl/rtl-mdreloc-sparc.c | 43 +++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) (limited to 'cpukit/libdl/rtl-mdreloc-sparc.c') 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= 0; i--) tmp = (tmp << 8) | ptr[i]; tmp &= ~mask; tmp |= value; /* Write it back out. */ - for (i=0; i> (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); +} -- cgit v1.2.3