summaryrefslogtreecommitdiffstats
path: root/cpukit/libdl/rtl-allocator.c
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2017-03-28 17:23:05 +1100
committerChris Johns <chrisj@rtems.org>2017-04-04 13:26:01 +1000
commitd2e31f70c12f6363cef79ffad781df6ec0acdfb5 (patch)
tree3ebf30b9233ccfbff397ef245f3b74f1f2bd69dd /cpukit/libdl/rtl-allocator.c
parentdosfs: Fix file name search (diff)
downloadrtems-d2e31f70c12f6363cef79ffad781df6ec0acdfb5.tar.bz2
libdl: Back port C++ exception throw and catch from 4.12.
Closes #2956.
Diffstat (limited to 'cpukit/libdl/rtl-allocator.c')
-rw-r--r--cpukit/libdl/rtl-allocator.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/cpukit/libdl/rtl-allocator.c b/cpukit/libdl/rtl-allocator.c
index 988094060f..39b4bcd1d0 100644
--- a/cpukit/libdl/rtl-allocator.c
+++ b/cpukit/libdl/rtl-allocator.c
@@ -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;
}