Add support uClibc++ excpetions. This involves additional handling for relative relation types, additional support for unwinding, as well as additional changes. The culmination of a big effort fromo Leo Aloe3132

This commit is contained in:
Gregory Nutt 2015-06-01 14:16:18 -06:00
parent 73419e77f4
commit 280e2ee385
2 changed files with 40 additions and 0 deletions

View File

@ -106,6 +106,13 @@ config ARMV7M_OABI_TOOLCHAIN
Most of the older buildroot toolchains are OABI and are named
arm-nuttx-elf- vs. arm-nuttx-eabi-
config ARMV7M_TARGET2_PREL
bool "R_ARM_TARGET2 is PC relative"
default n
depends on ELF
---help---
Perform a PC relative relocation for relocation type R_ARM_TARGET2
config ARMV7M_HAVE_STACKCHECK
bool
default n

View File

@ -48,6 +48,8 @@
#include <nuttx/arch.h>
#include <nuttx/binfmt/elf.h>
#ifdef CONFIG_ELF
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@ -60,6 +62,14 @@
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
#ifdef CONFIG_UCLIBCXX_EXCEPTION
extern void init_unwind_exidx(Elf32_Addr start, Elf32_Addr end);
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -204,6 +214,18 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
}
break;
#ifdef CONFIG_ARMV7M_TARGET2_PREL
case R_ARM_TARGET2: /* TARGET2 is a platform-specific relocation: gcc-arm-none-eabi
* performs a self relocation */
{
bvdbg("Performing TARGET2 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
(long)addr, (long)(*(uint32_t*)addr), sym, (long)sym->st_value);
*(uint32_t*)addr += sym->st_value - addr;
}
break;
#endif
case R_ARM_THM_CALL:
case R_ARM_THM_JUMP24:
{
@ -464,3 +486,14 @@ int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym,
bdbg("RELA relocation not supported\n");
return -ENOSYS;
}
#ifdef CONFIG_UCLIBCXX_EXCEPTION
int up_init_exidx(Elf32_Addr address, Elf32_Word size)
{
init_unwind_exidx(address, size);
return OK;
}
#endif
#endif /* CONFIG_ELF */