summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-06-05 23:13:56 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-06-05 23:13:56 +0000
commitabf3149e898054b54aa5e5b11f0b87c74e2db550 (patch)
tree0e0e774c450c358acf60663d2c5929983c3a38c3 /libexec
parenta3326831a199f66c39d88dc75467dd8c4a080d47 (diff)
Cleanup/remove duplicate code that checks STAT_RELOC_DONE.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ld.so/alpha/rtld_machine.c4
-rw-r--r--libexec/ld.so/loader.c5
-rw-r--r--libexec/ld.so/mips/rtld_machine.c6
-rw-r--r--libexec/ld.so/powerpc/rtld_machine.c5
-rw-r--r--libexec/ld.so/sparc64/rtld_machine.c4
5 files changed, 13 insertions, 11 deletions
diff --git a/libexec/ld.so/alpha/rtld_machine.c b/libexec/ld.so/alpha/rtld_machine.c
index 0f486f72cc5..83c74885152 100644
--- a/libexec/ld.so/alpha/rtld_machine.c
+++ b/libexec/ld.so/alpha/rtld_machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtld_machine.c,v 1.11 2002/06/05 19:34:44 art Exp $ */
+/* $OpenBSD: rtld_machine.c,v 1.12 2002/06/05 23:13:55 art Exp $ */
/*
* Copyright (c) 1999 Dale Rahn
@@ -75,7 +75,7 @@ _dl_md_reloc(elf_object_t *object, int rel, int relasz)
numrela = object->Dyn.info[relasz] / sizeof(Elf64_Rela);
relas = (Elf64_Rela *)(object->Dyn.info[rel]);
- if ((object->status & STAT_RELOC_DONE) || !relas)
+ if (relas == NULL)
return(0);
/*
diff --git a/libexec/ld.so/loader.c b/libexec/ld.so/loader.c
index 6103497bdb3..3309ccbaaa0 100644
--- a/libexec/ld.so/loader.c
+++ b/libexec/ld.so/loader.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: loader.c,v 1.35 2002/05/28 00:34:53 deraadt Exp $ */
+/* $OpenBSD: loader.c,v 1.36 2002/06/05 23:13:55 art Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -469,6 +469,9 @@ _dl_rtld(elf_object_t *object)
if (object->next)
_dl_rtld(object->next);
+ if (object->status & STAT_RELOC_DONE)
+ return;
+
/*
* Do relocation information first, then GOT.
*/
diff --git a/libexec/ld.so/mips/rtld_machine.c b/libexec/ld.so/mips/rtld_machine.c
index fdd7ac7368e..1719433ea55 100644
--- a/libexec/ld.so/mips/rtld_machine.c
+++ b/libexec/ld.so/mips/rtld_machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtld_machine.c,v 1.4 2002/05/24 04:21:27 deraadt Exp $ */
+/* $OpenBSD: rtld_machine.c,v 1.5 2002/06/05 23:13:55 art Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -54,7 +54,7 @@ _dl_md_reloc(elf_object_t *object, int rel, int relsz)
numrel = object->Dyn.info[relsz] / sizeof(Elf32_Rel);
relocs = (Elf32_Rel *)(object->Dyn.info[rel]);
- if ((object->status & STAT_RELOC_DONE) || !relocs)
+ if (relocs == NULL)
return(0);
for (i = 0; i < numrel; i++, relocs++) {
@@ -102,7 +102,7 @@ _dl_md_reloc(elf_object_t *object, int rel, int relsz)
_dl_exit(1);
}
}
- object->status |= STAT_RELOC_DONE;
+
return(fails);
}
diff --git a/libexec/ld.so/powerpc/rtld_machine.c b/libexec/ld.so/powerpc/rtld_machine.c
index 0d3bfce382b..4b3ccdefac0 100644
--- a/libexec/ld.so/powerpc/rtld_machine.c
+++ b/libexec/ld.so/powerpc/rtld_machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtld_machine.c,v 1.9 2002/06/05 19:34:44 art Exp $ */
+/* $OpenBSD: rtld_machine.c,v 1.10 2002/06/05 23:13:55 art Exp $ */
/*
* Copyright (c) 1999 Dale Rahn
@@ -78,7 +78,7 @@ _dl_printf("object relocation size %x, numrela %x\n",
object->Dyn.info[relasz], numrela);
#endif
- if ((object->status & STAT_RELOC_DONE) || !relas)
+ if (relas == NULL)
return(0);
/* for plt relocation usage */
@@ -383,7 +383,6 @@ _dl_printf(" found other symbol at %x size %d\n",
_dl_exit(1);
}
}
- object->status |= STAT_RELOC_DONE;
load_list = object->load_list;
while (load_list != NULL) {
_dl_mprotect(load_list->start, load_list->size, load_list->prot);
diff --git a/libexec/ld.so/sparc64/rtld_machine.c b/libexec/ld.so/sparc64/rtld_machine.c
index 955e89fa51b..7122082b885 100644
--- a/libexec/ld.so/sparc64/rtld_machine.c
+++ b/libexec/ld.so/sparc64/rtld_machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtld_machine.c,v 1.15 2002/06/05 19:34:44 art Exp $ */
+/* $OpenBSD: rtld_machine.c,v 1.16 2002/06/05 23:13:55 art Exp $ */
/*
* Copyright (c) 1999 Dale Rahn
@@ -229,7 +229,7 @@ _dl_md_reloc(elf_object_t *object, int rel, int relasz)
numrela = object->Dyn.info[relasz] / sizeof(Elf64_Rela);
relas = (Elf64_Rela *)(object->Dyn.info[rel]);
- if ((object->status & STAT_RELOC_DONE) || !relas)
+ if (relas == NULL)
return(0);
/*