summaryrefslogtreecommitdiff
path: root/libexec/ld.so/sparc
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-11-27 16:42:20 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-11-27 16:42:20 +0000
commit33f3250176ebfd4d01c91b64a2db9a4281295ffc (patch)
treee9178cca85e50cc6aedcab0259fcf0ed91339151 /libexec/ld.so/sparc
parent71abb69ad5b56f2815e077a3ef725973b5a7e280 (diff)
Make _dl_md_reloc_got() report errors, and take them into account.
Fixes PR #5579.
Diffstat (limited to 'libexec/ld.so/sparc')
-rw-r--r--libexec/ld.so/sparc/rtld_machine.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libexec/ld.so/sparc/rtld_machine.c b/libexec/ld.so/sparc/rtld_machine.c
index cc3489b37bc..6510e745af5 100644
--- a/libexec/ld.so/sparc/rtld_machine.c
+++ b/libexec/ld.so/sparc/rtld_machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtld_machine.c,v 1.28 2007/05/05 15:21:21 drahn Exp $ */
+/* $OpenBSD: rtld_machine.c,v 1.29 2007/11/27 16:42:19 miod Exp $ */
/*
* Copyright (c) 1999 Dale Rahn
@@ -179,7 +179,7 @@ _dl_md_reloc(elf_object_t *object, int rel, int relasz)
{
long i;
long numrela;
- long fails = 0;
+ int fails = 0;
Elf_Addr loff;
Elf_RelA *relas;
struct load_list *llist;
@@ -360,9 +360,10 @@ _dl_bind(elf_object_t *object, int reloff)
return (value);
}
-void
+int
_dl_md_reloc_got(elf_object_t *object, int lazy)
{
+ int fails = 0;
Elf_Addr *pltgot;
extern void _dl_bind_start(void); /* XXX */
Elf_Addr ooff;
@@ -446,7 +447,7 @@ _dl_md_reloc_got(elf_object_t *object, int lazy)
}
if (object->obj_type == OBJTYPE_LDR || !lazy || pltgot == NULL) {
- _dl_md_reloc(object, DT_JMPREL, DT_PLTRELSZ);
+ fails = _dl_md_reloc(object, DT_JMPREL, DT_PLTRELSZ);
}
if (object->got_size != 0)
@@ -455,6 +456,8 @@ _dl_md_reloc_got(elf_object_t *object, int lazy)
if (object->plt_size != 0)
_dl_mprotect((void*)object->plt_start, object->plt_size,
PROT_READ|PROT_EXEC);
+
+ return (fails);
}