summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2006-05-08 20:37:01 +0000
committerderaadt <deraadt@openbsd.org>2006-05-08 20:37:01 +0000
commit665ee60ccac3b9f859ddb406f43f6dca8556b1a2 (patch)
tree8a80c3379cab0231fcc426b95f3be3a7b0fa0b20
parentfix printf. (diff)
downloadwireguard-openbsd-665ee60ccac3b9f859ddb406f43f6dca8556b1a2.tar.xz
wireguard-openbsd-665ee60ccac3b9f859ddb406f43f6dca8556b1a2.zip
more spacing
-rw-r--r--libexec/ld.so/dl_prebind.c4
-rw-r--r--libexec/ld.so/library_subr.c4
-rw-r--r--libexec/ld.so/loader.c4
-rw-r--r--libexec/ld.so/mips64/archdep.h6
-rw-r--r--libexec/ld.so/powerpc/rtld_machine.c4
-rw-r--r--libexec/ld.so/prebind/objarray.c22
-rw-r--r--libexec/ld.so/prebind/prebind.c13
-rw-r--r--libexec/ld.so/prebind_strip/prebind_strip.c4
8 files changed, 31 insertions, 30 deletions
diff --git a/libexec/ld.so/dl_prebind.c b/libexec/ld.so/dl_prebind.c
index 5e6c6016196..888fd59d220 100644
--- a/libexec/ld.so/dl_prebind.c
+++ b/libexec/ld.so/dl_prebind.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dl_prebind.c,v 1.5 2006/05/08 20:34:36 deraadt Exp $ */
+/* $OpenBSD: dl_prebind.c,v 1.6 2006/05/08 20:37:01 deraadt Exp $ */
/*
* Copyright (c) 2006 Dale Rahn <drahn@dalerahn.com>
*
@@ -629,7 +629,7 @@ dump_prelink(Elf_Addr base, u_long size)
prebind_dump_symcache(symcachetab, footer->symcache_cnt);
prebind_dump_nameidx(nameidx, footer->numlibs, nametab);
- for(i = 0; i < footer->fixup_cnt; i++) {
+ for (i = 0; i < footer->fixup_cnt; i++) {
_dl_printf("fixup %d cnt %d idx %d\n", i, fixupcnt[i], fixupidx[i]);
fixup = prebind_map + fixupidx[i];
prebind_dump_fixup(fixup, fixupcnt[i]);
diff --git a/libexec/ld.so/library_subr.c b/libexec/ld.so/library_subr.c
index 6c590ce030d..1e9f5cc0209 100644
--- a/libexec/ld.so/library_subr.c
+++ b/libexec/ld.so/library_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: library_subr.c,v 1.25 2006/05/08 20:34:36 deraadt Exp $ */
+/* $OpenBSD: library_subr.c,v 1.26 2006/05/08 20:37:01 deraadt Exp $ */
/*
* Copyright (c) 2002 Dale Rahn
@@ -431,7 +431,7 @@ _dl_unload_dlopen(void)
if (node->data == _dl_objects)
continue;
- while(node->data->opencount > 0) {
+ while (node->data->opencount > 0) {
node->data->opencount--;
_dl_notify_unload_shlib(node->data);
_dl_run_all_dtors();
diff --git a/libexec/ld.so/loader.c b/libexec/ld.so/loader.c
index 46819fc7886..9a0502e3337 100644
--- a/libexec/ld.so/loader.c
+++ b/libexec/ld.so/loader.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: loader.c,v 1.102 2006/05/08 20:34:36 deraadt Exp $ */
+/* $OpenBSD: loader.c,v 1.103 2006/05/08 20:37:01 deraadt Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -249,7 +249,7 @@ _dl_load_dep_libs(elf_object_t *object, int flags, int booting)
int depflags;
dynobj = object;
- while(dynobj) {
+ while (dynobj) {
DL_DEB(("examining: '%s'\n", dynobj->load_name));
libcount = 0;
diff --git a/libexec/ld.so/mips64/archdep.h b/libexec/ld.so/mips64/archdep.h
index 12d47ce6bfa..637143d4e88 100644
--- a/libexec/ld.so/mips64/archdep.h
+++ b/libexec/ld.so/mips64/archdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: archdep.h,v 1.4 2004/09/23 12:42:05 pefo Exp $ */
+/* $OpenBSD: archdep.h,v 1.5 2006/05/08 20:37:01 deraadt Exp $ */
/*
* Copyright (c) 1998-2002 Opsycon AB, Sweden.
@@ -55,7 +55,7 @@ do { \
#define RELOC_RELA(rela, sym, ptr, val) \
do { \
_dl_exit(20); /* We don't do RELA now */ \
-} while(0)
+} while (0)
struct elf_object;
@@ -95,7 +95,7 @@ do { \
sp++; \
} \
__dynld->status |= STAT_GOT_DONE; \
-} while(0)
+} while (0)
#define GOT_PERMS PROT_READ
diff --git a/libexec/ld.so/powerpc/rtld_machine.c b/libexec/ld.so/powerpc/rtld_machine.c
index e7f1e3787b9..c97e166efea 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.40 2005/12/02 20:17:21 kurt Exp $ */
+/* $OpenBSD: rtld_machine.c,v 1.41 2006/05/08 20:37:01 deraadt Exp $ */
/*
* Copyright (c) 1999 Dale Rahn
@@ -380,7 +380,7 @@ _dl_printf(" symn [%s] val 0x%x\n", symn, val);
src_loff = _dl_find_symbol(symn, &cpysrc,
SYM_SEARCH_OTHER|SYM_WARNNOTFOUND| SYM_NOTPLT,
sym, object, NULL);
- if(cpysrc != NULL) {
+ if (cpysrc != NULL) {
size = sym->st_size;
if (sym->st_size != cpysrc->st_size) {
_dl_printf("symbols size differ [%s] \n",
diff --git a/libexec/ld.so/prebind/objarray.c b/libexec/ld.so/prebind/objarray.c
index de4bd564223..583f25d1f92 100644
--- a/libexec/ld.so/prebind/objarray.c
+++ b/libexec/ld.so/prebind/objarray.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: objarray.c,v 1.5 2006/05/08 20:34:36 deraadt Exp $ */
+/* $OpenBSD: objarray.c,v 1.6 2006/05/08 20:37:01 deraadt Exp $ */
/*
* Copyright (c) 2006 Dale Rahn <drahn@dalerahn.com>
*
@@ -199,7 +199,7 @@ elf_prep_lib_prebind(struct elf_object *object)
nametablen = 0;
for (i = 0; i < object->nchains; i++) {
- if (symcache[i].sym == NULL)
+ if (symcache[i].sym == NULL)
continue;
ref_obj = symcache[i].obj->dyn.null;
symcache_cnt++;
@@ -214,7 +214,7 @@ elf_prep_lib_prebind(struct elf_object *object)
symcache_cnt = 0;
for (i = 0; i < object->nchains; i++) {
- if (symcache[i].sym == NULL)
+ if (symcache[i].sym == NULL)
continue;
symcachetab[symcache_cnt].idx = i;
symcachetab[symcache_cnt].obj_idx =
@@ -224,7 +224,7 @@ elf_prep_lib_prebind(struct elf_object *object)
symcache_cnt++;
}
for (i = 0; i < object->nchains; i++) {
- if (pltsymcache[i].sym == NULL)
+ if (pltsymcache[i].sym == NULL)
continue;
ref_obj = pltsymcache[i].obj->dyn.null;
pltsymcache_cnt++;
@@ -239,7 +239,7 @@ elf_prep_lib_prebind(struct elf_object *object)
pltsymcache_cnt = 0;
for (i = 0; i < object->nchains; i++) {
- if (pltsymcache[i].sym == NULL)
+ if (pltsymcache[i].sym == NULL)
continue;
pltsymcachetab[pltsymcache_cnt].idx = i;
pltsymcachetab[pltsymcache_cnt].obj_idx =
@@ -333,7 +333,7 @@ elf_prep_bin_prebind(struct proglist *pl)
/* do got */
symcache_cnt = 0;
for (i = 0; i < object->nchains; i++) {
- if (symcache[i].sym != NULL)
+ if (symcache[i].sym != NULL)
symcache_cnt++;
}
@@ -341,7 +341,7 @@ elf_prep_bin_prebind(struct proglist *pl)
symcache_cnt = 0;
for (i = 0; i < object->nchains; i++) {
- if (symcache[i].sym == NULL)
+ if (symcache[i].sym == NULL)
continue;
symcachetab[symcache_cnt].idx = i;
symcachetab[symcache_cnt].obj_idx =
@@ -354,14 +354,14 @@ elf_prep_bin_prebind(struct proglist *pl)
/* now do plt */
pltsymcache_cnt = 0;
for (i = 0; i < object->nchains; i++) {
- if (pltsymcache[i].sym != NULL)
+ if (pltsymcache[i].sym != NULL)
pltsymcache_cnt++;
}
pltsymcachetab = calloc(pltsymcache_cnt , sizeof(struct symcachetab));
pltsymcache_cnt = 0;
for (i = 0; i < object->nchains; i++) {
- if (pltsymcache[i].sym == NULL)
+ if (pltsymcache[i].sym == NULL)
continue;
pltsymcachetab[pltsymcache_cnt].idx = i;
pltsymcachetab[pltsymcache_cnt].obj_idx =
@@ -396,7 +396,7 @@ elf_prep_bin_prebind(struct proglist *pl)
pl->libmapcnt = calloc(numlibs, sizeof(u_int32_t));
/* have to do both got and plt fixups */
- for(i = 0; i < numlibs; i++) {
+ for (i = 0; i < numlibs; i++) {
for (j = 0; j < pl->fixupcnt[2*i]; j++) {
pl->fixup[2*i][j].targobj_idx =
libmap[pl->fixup[2*i][j].targobj_idx];
@@ -674,7 +674,7 @@ elf_clear_prog_load(int fd, struct elf_object *object)
ehdr = (Elf_Ehdr *) buf;
phdr = (Elf_Phdr *)((char *)buf + ehdr->e_phoff);
- if(ehdr->e_type != ET_EXEC) {
+ if (ehdr->e_type != ET_EXEC) {
goto done;
}
diff --git a/libexec/ld.so/prebind/prebind.c b/libexec/ld.so/prebind/prebind.c
index b69ea4b0b42..422c5803b4e 100644
--- a/libexec/ld.so/prebind/prebind.c
+++ b/libexec/ld.so/prebind/prebind.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: prebind.c,v 1.14 2006/05/08 20:34:36 deraadt Exp $ */
+/* $OpenBSD: prebind.c,v 1.15 2006/05/08 20:37:01 deraadt Exp $ */
/*
* Copyright (c) 2006 Dale Rahn <drahn@dalerahn.com>
*
@@ -271,7 +271,7 @@ load_file(const char *filename, int objtype)
goto done;
}
- if ((ifstat.st_mode & S_IFMT) != S_IFREG)
+ if ((ifstat.st_mode & S_IFMT) != S_IFREG)
goto done;
if (ifstat.st_size < sizeof (Elf_Ehdr)) {
@@ -297,7 +297,7 @@ load_file(const char *filename, int objtype)
goto done;
}
- if( ehdr->e_machine != ELF_TARG_MACH) {
+ if (ehdr->e_machine != ELF_TARG_MACH) {
if (verbose > 0)
printf("%s: wrong arch\n", filename);
goto done;
@@ -699,9 +699,9 @@ map_to_virt(Elf_Phdr *phdr, Elf_Ehdr *ehdr, Elf_Addr base, u_long *vaddr)
for (i = 0; i < ehdr->e_phnum; i++) {
switch (phdr[i].p_type) {
case PT_LOAD:
- if(phdr[i].p_vaddr > *vaddr)
+ if (phdr[i].p_vaddr > *vaddr)
continue;
- if(phdr[i].p_vaddr + phdr[i].p_memsz < *vaddr)
+ if (phdr[i].p_vaddr + phdr[i].p_memsz < *vaddr)
continue;
#ifdef DEBUG1
printf("input address %lx translated to ", *vaddr);
@@ -754,8 +754,9 @@ load_lib(const char *name, struct elf_object *parent)
ignore_hints = 0;
- if(strchr(name, '/')) {
+ if (strchr(name, '/')) {
char *lpath, *lname;
+
lpath = strdup(name);
lname = strrchr(lpath, '/');
if (lname == NULL || lname[1] == '\0') {
diff --git a/libexec/ld.so/prebind_strip/prebind_strip.c b/libexec/ld.so/prebind_strip/prebind_strip.c
index 7063f02e071..a7b433af230 100644
--- a/libexec/ld.so/prebind_strip/prebind_strip.c
+++ b/libexec/ld.so/prebind_strip/prebind_strip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: prebind_strip.c,v 1.3 2006/05/08 20:34:36 deraadt Exp $ */
+/* $OpenBSD: prebind_strip.c,v 1.4 2006/05/08 20:37:01 deraadt Exp $ */
/*
* Copyright (c) 2006 Dale Rahn <drahn@dalerahn.com>
*
@@ -137,7 +137,7 @@ prebind_remove_load_section(int fd, char *name)
loadsection = ehdr->e_phnum - 1;
- if(ehdr->e_type != ET_EXEC ||
+ if (ehdr->e_type != ET_EXEC ||
(phdr[loadsection].p_flags & 0x08000000) == 0) {
goto done;
}