diff options
| author | joerg <joerg@NetBSD.org> | 2012-03-13 21:00:31 +0000 |
|---|---|---|
| committer | joerg <joerg@NetBSD.org> | 2012-03-13 21:00:31 +0000 |
| commit | ce4cd1027e818e6aa4e5529170d41b6a64b3abb0 (patch) | |
| tree | cac7c6d3379e3a3f6d4c88001a8f358b237e273a /libexec | |
| parent | ef05d8c2bb6986ae6ce750f264efd269ee25854b (diff) | |
Mark _rtld_debug_state as not to be inlined. Add an explicit instruction
barrier to prevent removal of calls to it.
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/ld.elf_so/rtld.c | 7 | ||||
| -rw-r--r-- | libexec/ld.elf_so/rtld.h | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/libexec/ld.elf_so/rtld.c b/libexec/ld.elf_so/rtld.c index 6d58dc80adc..7fe91124480 100644 --- a/libexec/ld.elf_so/rtld.c +++ b/libexec/ld.elf_so/rtld.c @@ -1,4 +1,4 @@ -/* $NetBSD: rtld.c,v 1.156 2012/02/16 23:00:39 joerg Exp $ */ +/* $NetBSD: rtld.c,v 1.157 2012/03/13 21:00:31 joerg Exp $ */ /* * Copyright 1996 John D. Polstra. @@ -40,7 +40,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: rtld.c,v 1.156 2012/02/16 23:00:39 joerg Exp $"); +__RCSID("$NetBSD: rtld.c,v 1.157 2012/03/13 21:00:31 joerg Exp $"); #endif /* not lint */ #include <sys/param.h> @@ -1385,7 +1385,8 @@ void _rtld_debug_state(void) { - /* do nothing */ + /* Prevent optimizer from removing calls to this function */ + __insn_barrier(); } void diff --git a/libexec/ld.elf_so/rtld.h b/libexec/ld.elf_so/rtld.h index 22ac7ef6ff1..29950d96f9e 100644 --- a/libexec/ld.elf_so/rtld.h +++ b/libexec/ld.elf_so/rtld.h @@ -1,4 +1,4 @@ -/* $NetBSD: rtld.h,v 1.108 2012/02/16 23:00:39 joerg Exp $ */ +/* $NetBSD: rtld.h,v 1.109 2012/03/13 21:00:32 joerg Exp $ */ /* * Copyright 1996 John D. Polstra. @@ -338,7 +338,7 @@ void _rtld_error(const char *, ...) __attribute__((__format__(__printf__,1,2))); void _rtld_die(void) __attribute__((__noreturn__)); void *_rtld_objmain_sym(const char *); -__dso_public void _rtld_debug_state(void); +__dso_public void _rtld_debug_state(void) __noinline; void _rtld_linkmap_add(Obj_Entry *); void _rtld_linkmap_delete(Obj_Entry *); void _rtld_objlist_push_head(Objlist *, Obj_Entry *); |
