summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf/sparc64/rtld_machdep.h
diff options
context:
space:
mode:
authortmm <tmm@FreeBSD.org>2004-06-18 02:01:37 +0000
committertmm <tmm@FreeBSD.org>2004-06-18 02:01:37 +0000
commit1dc333167a3c4a3ac024082d3163cff84f6d7ca0 (patch)
tree1c3fadf8df4209377c2fc2f655828039760b581b /libexec/rtld-elf/sparc64/rtld_machdep.h
parent1bf2dcc89421e910eddce083cf5f62c1d123e35b (diff)
downloadFreeBSD-src-1dc333167a3c4a3ac024082d3163cff84f6d7ca0.zip
FreeBSD-src-1dc333167a3c4a3ac024082d3163cff84f6d7ca0.tar.gz
Fix the problem that surfaced with the new binutils import on sparc64
(and that is for now being worked around by a binutils patch). The rtld code tested &_DYNAMIC against 0 to see whether rtld itself was built as PIC or not. While the sparc64 MD code did not rely on the preset value of the GOT slot for _DYNAMIC any more due to previous binutils changes, it still used to not be 0, so that this check did work. The new binutils do however initialize this slot with 0. As a consequence, rtld would not properly initialize itself and crash. Fix that by introducing a new macro, RTLD_IS_DYNAMIC, to take the role of this test. For sparc64, it is implemented using the rtld_dynamic() code that was already there. If an architecture does not provide its own implementation, we default to the old check. While being there, mark _DYNAMIC as a weak symbol in the sparc64 rtld_start.S. This is needed in the LDSCRIPT case, which is however not currently supported for want of an actual ldscript. Sanity checked with md5 on alpha, amd64, i386 and ia64.
Diffstat (limited to 'libexec/rtld-elf/sparc64/rtld_machdep.h')
-rw-r--r--libexec/rtld-elf/sparc64/rtld_machdep.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libexec/rtld-elf/sparc64/rtld_machdep.h b/libexec/rtld-elf/sparc64/rtld_machdep.h
index d92055c..27276ee 100644
--- a/libexec/rtld-elf/sparc64/rtld_machdep.h
+++ b/libexec/rtld-elf/sparc64/rtld_machdep.h
@@ -37,7 +37,9 @@
struct Struct_Obj_Entry;
/* Return the address of the .dynamic section in the dynamic linker. */
-Elf_Dyn *rtld_dynamic(const struct Struct_Obj_Entry *);
+Elf_Dyn *rtld_dynamic_addr();
+#define rtld_dynamic(obj) rtld_dynamic_addr()
+#define RTLD_IS_DYNAMIC() (rtld_dynamic_addr() != NULL)
Elf_Addr reloc_jmpslot(Elf_Addr *, Elf_Addr,
const struct Struct_Obj_Entry *,
OpenPOWER on IntegriCloud