aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/adaint.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2022-11-25 23:11:27 +0100
committerMarc Poulhiès <poulhies@adacore.com>2022-11-28 13:02:31 +0100
commitf2b30a724e6bf7ff8e591b176967d596cee7648e (patch)
tree60c5d21eb1ebae41a9159b4af76142d5f75952d2 /gcc/ada/adaint.c
parent83e8d37fe39d7c1afce19b61bbc2dd828fa37c6f (diff)
downloadgcc-f2b30a724e6bf7ff8e591b176967d596cee7648e.zip
gcc-f2b30a724e6bf7ff8e591b176967d596cee7648e.tar.gz
gcc-f2b30a724e6bf7ff8e591b176967d596cee7648e.tar.bz2
ada: Add PIE support to backtraces on Linux
gcc/ada/ * adaint.c [Linux]: Include <link.h>. (__gnat_get_executable_load_address) [Linux]: Enable.
Diffstat (limited to 'gcc/ada/adaint.c')
-rw-r--r--gcc/ada/adaint.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 199dbe0..d2604ca 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -3524,6 +3524,8 @@ __gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
#if defined (__APPLE__)
#include <mach-o/dyld.h>
+#elif defined (__linux__)
+#include <link.h>
#endif
const void *
@@ -3532,10 +3534,8 @@ __gnat_get_executable_load_address (void)
#if defined (__APPLE__)
return _dyld_get_image_header (0);
-#elif 0 && defined (__linux__)
- /* Currently disabled as it needs at least -ldl. */
+#elif defined (__linux__)
struct link_map *map = _r_debug.r_map;
-
return (const void *)map->l_addr;
#elif defined (_WIN32)