summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/rtld.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 0f5aaba..874f4bc 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -144,7 +144,7 @@ static void ld_utrace_log(int, void *, void *, size_t, int, const char *);
static void rtld_fill_dl_phdr_info(const Obj_Entry *obj,
struct dl_phdr_info *phdr_info);
-void r_debug_state(struct r_debug *, struct link_map *);
+void r_debug_state(struct r_debug *, struct link_map *) __noinline;
/*
* Data declarations.
@@ -2782,6 +2782,14 @@ linkmap_delete(Obj_Entry *obj)
void
r_debug_state(struct r_debug* rd, struct link_map *m)
{
+ /*
+ * The following is a hack to force the compiler to emit calls to
+ * this function, even when optimizing. If the function is empty,
+ * the compiler is not obliged to emit any code for calls to it,
+ * even when marked __noinline. However, gdb depends on those
+ * calls being made.
+ */
+ __asm __volatile("" : : : "memory");
}
/*
OpenPOWER on IntegriCloud