summaryrefslogtreecommitdiffstats
path: root/libcxxabi/src/cxa_personality.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxxabi/src/cxa_personality.cpp')
-rw-r--r--libcxxabi/src/cxa_personality.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libcxxabi/src/cxa_personality.cpp b/libcxxabi/src/cxa_personality.cpp
index c2ee3fdf18a..1c80898cbeb 100644
--- a/libcxxabi/src/cxa_personality.cpp
+++ b/libcxxabi/src/cxa_personality.cpp
@@ -314,8 +314,18 @@ static const void* read_target2_value(const void* ptr)
uintptr_t offset = *reinterpret_cast<const uintptr_t*>(ptr);
if (!offset)
return 0;
+ // "ARM EABI provides a TARGET2 relocation to describe these typeinfo
+ // pointers. The reason being it allows their precise semantics to be
+ // deferred to the linker. For bare-metal they turn into absolute
+ // relocations. For linux they turn into GOT-REL relocations."
+ // https://gcc.gnu.org/ml/gcc-patches/2009-08/msg00264.html
+#if LIBCXXABI_BAREMETAL
+ return reinterpret_cast<const void*>(reinterpret_cast<uintptr_t>(ptr) +
+ offset);
+#else
return *reinterpret_cast<const void **>(reinterpret_cast<uintptr_t>(ptr) +
offset);
+#endif
}
static const __shim_type_info*
OpenPOWER on IntegriCloud