rtld: Clang fixes
authorJohn Marino <draco@marino.st>
Sat, 14 Jan 2012 12:28:14 +0000 (13:28 +0100)
committerJohn Marino <draco@marino.st>
Sat, 14 Jan 2012 13:42:55 +0000 (14:42 +0100)
commit8301820ef8df692f611b357f285fe4ddca9e5710
tree94d9c9a531c059ac1d630c79590a5fc57aef005f
parenteb5c3aeb86a1259db800715c417403716a2675df
rtld: Clang fixes

1) Fix clang warnings
2) Fix r_debug_state function

The r_debug_state function is a hook required for gdb.  Clang will inline
the function, but because it is empty, it won't generate any calls to it.
This results in gdb backtraces being corrupted.  Fixed with the following
hack obtained from FreeBSD SVN 225366.

Fix it by marking the function __noinline, and inserting an empty asm
statement that pretends to clobber memory.  This forces the compiler to
emit calls to the r_debug_state() function throughout rtld.c
libexec/rtld-elf/rtld.c