mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-27 16:19:20 +08:00
libdl: Add C++ exception support to loaded modules.
This has been tested on SPARC, i386, PowerPC and ARM. Closes #2767.
This commit is contained in:
@@ -152,6 +152,7 @@ rtems_rtl_alloc_indirect_del (rtems_rtl_alloc_tag_t tag,
|
||||
bool
|
||||
rtems_rtl_alloc_module_new (void** text_base, size_t text_size,
|
||||
void** const_base, size_t const_size,
|
||||
void** eh_base, size_t eh_size,
|
||||
void** data_base, size_t data_size,
|
||||
void** bss_base, size_t bss_size)
|
||||
{
|
||||
@@ -173,7 +174,20 @@ rtems_rtl_alloc_module_new (void** text_base, size_t text_size,
|
||||
const_size, false);
|
||||
if (!*const_base)
|
||||
{
|
||||
rtems_rtl_alloc_module_del (text_base, const_base, data_base, bss_base);
|
||||
rtems_rtl_alloc_module_del (text_base, const_base, eh_base,
|
||||
data_base, bss_base);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (eh_size)
|
||||
{
|
||||
*eh_base = rtems_rtl_alloc_new (RTEMS_RTL_ALLOC_READ,
|
||||
eh_size, false);
|
||||
if (!*eh_base)
|
||||
{
|
||||
rtems_rtl_alloc_module_del (text_base, const_base, eh_base,
|
||||
data_base, bss_base);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -184,7 +198,8 @@ rtems_rtl_alloc_module_new (void** text_base, size_t text_size,
|
||||
data_size, false);
|
||||
if (!*data_base)
|
||||
{
|
||||
rtems_rtl_alloc_module_del (text_base, const_base, data_base, bss_base);
|
||||
rtems_rtl_alloc_module_del (text_base, const_base, eh_base,
|
||||
data_base, bss_base);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -195,7 +210,8 @@ rtems_rtl_alloc_module_new (void** text_base, size_t text_size,
|
||||
bss_size, false);
|
||||
if (!*bss_base)
|
||||
{
|
||||
rtems_rtl_alloc_module_del (text_base, const_base, data_base, bss_base);
|
||||
rtems_rtl_alloc_module_del (text_base, const_base, eh_base,
|
||||
data_base, bss_base);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -206,12 +222,14 @@ rtems_rtl_alloc_module_new (void** text_base, size_t text_size,
|
||||
void
|
||||
rtems_rtl_alloc_module_del (void** text_base,
|
||||
void** const_base,
|
||||
void** eh_base,
|
||||
void** data_base,
|
||||
void** bss_base)
|
||||
{
|
||||
rtems_rtl_alloc_del (RTEMS_RTL_ALLOC_READ_WRITE, *bss_base);
|
||||
rtems_rtl_alloc_del (RTEMS_RTL_ALLOC_READ_WRITE, *data_base);
|
||||
rtems_rtl_alloc_del (RTEMS_RTL_ALLOC_READ, *eh_base);
|
||||
rtems_rtl_alloc_del (RTEMS_RTL_ALLOC_READ, *const_base);
|
||||
rtems_rtl_alloc_del (RTEMS_RTL_ALLOC_READ_EXEC, *text_base);
|
||||
*text_base = *const_base = *data_base = *bss_base = NULL;
|
||||
*text_base = *const_base = *eh_base = *data_base = *bss_base = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user