diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2007-11-27 16:42:20 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2007-11-27 16:42:20 +0000 |
commit | 33f3250176ebfd4d01c91b64a2db9a4281295ffc (patch) | |
tree | e9178cca85e50cc6aedcab0259fcf0ed91339151 /libexec/ld.so/arm/rtld_machine.c | |
parent | 71abb69ad5b56f2815e077a3ef725973b5a7e280 (diff) |
Make _dl_md_reloc_got() report errors, and take them into account.
Fixes PR #5579.
Diffstat (limited to 'libexec/ld.so/arm/rtld_machine.c')
-rw-r--r-- | libexec/ld.so/arm/rtld_machine.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libexec/ld.so/arm/rtld_machine.c b/libexec/ld.so/arm/rtld_machine.c index 84205cb5ae3..d81fc87b367 100644 --- a/libexec/ld.so/arm/rtld_machine.c +++ b/libexec/ld.so/arm/rtld_machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld_machine.c,v 1.11 2007/05/05 15:21:21 drahn Exp $ */ +/* $OpenBSD: rtld_machine.c,v 1.12 2007/11/27 16:42:19 miod Exp $ */ /* * Copyright (c) 2004 Dale Rahn @@ -161,7 +161,7 @@ _dl_md_reloc(elf_object_t *object, int rel, int relsz) { long i; long numrel; - long fails = 0; + int fails = 0; Elf_Addr loff; Elf_Rel *rels; struct load_list *llist; @@ -319,9 +319,10 @@ resolve_failed: * This is done by calling _dl_md_reloc on DT_JUMPREL for DL_BIND_NOW, * otherwise the lazy binding plt initialization is performed. */ -void +int _dl_md_reloc_got(elf_object_t *object, int lazy) { + int fails = 0; Elf_Addr *pltgot = (Elf_Addr *)object->Dyn.info[DT_PLTGOT]; Elf_Addr ooff; const Elf_Sym *this; @@ -329,7 +330,7 @@ _dl_md_reloc_got(elf_object_t *object, int lazy) Elf_Rel *rel; if (object->Dyn.info[DT_PLTREL] != DT_REL) - return; + return (0); object->got_addr = NULL; object->got_size = 0; @@ -357,7 +358,7 @@ _dl_md_reloc_got(elf_object_t *object, int lazy) object->plt_start = NULL; if (!lazy) { - _dl_md_reloc(object, DT_JMPREL, DT_PLTRELSZ); + fails = _dl_md_reloc(object, DT_JMPREL, DT_PLTRELSZ); } else { rel = (Elf_Rel *)(object->Dyn.info[DT_JMPREL]); num = (object->Dyn.info[DT_PLTRELSZ]); @@ -377,6 +378,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); } Elf_Addr |