summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authoreeh <eeh@NetBSD.org>2002-01-06 03:54:42 +0000
committereeh <eeh@NetBSD.org>2002-01-06 03:54:42 +0000
commit0edae4622bceedd57b7e9fe9acdadbee1513aad8 (patch)
treeb12fa06965cf59ee306e927504f2623e2e11d89b /libexec
parent4d134efd61507aa2f15d18cc075f806fa91d5745 (diff)
Do not attempt to relocate any pltrela entries that are not JMP_SLOT on sparc64.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ld.elf_so/reloc.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/libexec/ld.elf_so/reloc.c b/libexec/ld.elf_so/reloc.c
index 5d124b1cd4e..51f61df11a6 100644
--- a/libexec/ld.elf_so/reloc.c
+++ b/libexec/ld.elf_so/reloc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: reloc.c,v 1.49 2001/12/20 06:54:25 thorpej Exp $ */
+/* $NetBSD: reloc.c,v 1.50 2002/01/06 03:54:42 eeh Exp $ */
/*
* Copyright 1996 John D. Polstra.
@@ -634,7 +634,7 @@ _rtld_bind(obj, reloff)
/*
* XXXX
*
- * The first for PLT entries are reserved. There
+ * The first four PLT entries are reserved. There
* is some disagreement whether they should have
* associated relocation entries. Both the SPARC
* 32-bit and 64-bit ELF specifications say that
@@ -761,6 +761,31 @@ _rtld_relocate_objects(first, bind_now, dodebug)
const Elf_Rela *rela;
for (rela = obj->pltrela; rela < obj->pltrelalim;
++rela) {
+#ifdef __sparc64__
+ if (ELF_R_TYPE(rela->r_info) !=
+ R_TYPE(JMP_SLOT)) {
+ /*
+ * XXXX
+ *
+ * The first four PLT entries are
+ * reserved. There is some
+ * disagreement whether they should
+ * have associated relocation
+ * entries. Both the SPARC 32-bit
+ * and 64-bit ELF specifications say
+ * that they should have relocation
+ * entries, but the 32-bit SPARC
+ * binutils do not generate them,
+ * and now the 64-bit SPARC binutils
+ * have stopped generating them too.
+ *
+ * To provide binary compatibility, we
+ * will skip any entries that are not
+ * of type JMP_SLOT.
+ */
+ continue;
+ }
+#endif
if (_rtld_relocate_plt_object(obj, rela,
NULL, bind_now, dodebug) < 0)
ok = 0;