summaryrefslogtreecommitdiff
path: root/sys/lib/libsa
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2008-05-08 14:09:19 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2008-05-08 14:09:19 +0000
commitf14647e73b76f146d0c1698e205a0a4b5f3e5714 (patch)
tree0e9ec073ea6a56ceaea97da1b225099b78ab49c2 /sys/lib/libsa
parent619a6db4259fc5de8b7d9aaa2c2eaf25b5b4d904 (diff)
KNF
Diffstat (limited to 'sys/lib/libsa')
-rw-r--r--sys/lib/libsa/loadfile_elf.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sys/lib/libsa/loadfile_elf.c b/sys/lib/libsa/loadfile_elf.c
index 516648d3578..383a003d488 100644
--- a/sys/lib/libsa/loadfile_elf.c
+++ b/sys/lib/libsa/loadfile_elf.c
@@ -1,5 +1,5 @@
/* $NetBSD: loadfile.c,v 1.10 2000/12/03 02:53:04 tsutsui Exp $ */
-/* $OpenBSD: loadfile_elf.c,v 1.3 2008/05/08 14:03:09 jsing Exp $ */
+/* $OpenBSD: loadfile_elf.c,v 1.4 2008/05/08 14:09:18 jsing Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -120,7 +120,7 @@ ELFNAME(exec)(int fd, Elf_Ehdr *elf, u_long *marks, int flags)
PROGRESS(("%s%lu", first ? "" : "+",
(u_long)phdr[i].p_filesz));
- if (lseek(fd, (off_t)phdr[i].p_offset, SEEK_SET) == -1) {
+ if (lseek(fd, (off_t)phdr[i].p_offset, SEEK_SET) == -1) {
WARN(("lseek text"));
FREE(phdr, sz);
return 1;
@@ -131,11 +131,12 @@ ELFNAME(exec)(int fd, Elf_Ehdr *elf, u_long *marks, int flags)
FREE(phdr, sz);
return 1;
}
- first = 0;
+ first = 0;
}
- if ((IS_TEXT(phdr[i]) && (flags & (LOAD_TEXT|COUNT_TEXT))) ||
- (IS_DATA(phdr[i]) && (flags & (LOAD_DATA|COUNT_TEXT)))) {
+
+ if ((IS_TEXT(phdr[i]) && (flags & (LOAD_TEXT | COUNT_TEXT))) ||
+ (IS_DATA(phdr[i]) && (flags & (LOAD_DATA | COUNT_TEXT)))) {
pos = phdr[i].p_paddr;
if (minp > pos)
minp = pos;
@@ -144,7 +145,7 @@ ELFNAME(exec)(int fd, Elf_Ehdr *elf, u_long *marks, int flags)
maxp = pos;
}
- /* Zero out bss. */
+ /* Zero out BSS. */
if (IS_BSS(phdr[i]) && (flags & LOAD_BSS)) {
PROGRESS(("+%lu",
(u_long)(phdr[i].p_memsz - phdr[i].p_filesz)));
@@ -163,10 +164,10 @@ ELFNAME(exec)(int fd, Elf_Ehdr *elf, u_long *marks, int flags)
* Copy the ELF and section headers.
*/
elfp = maxp = roundup(maxp, sizeof(Elf_Addr));
- if (flags & (LOAD_HDR|COUNT_HDR))
+ if (flags & (LOAD_HDR | COUNT_HDR))
maxp += sizeof(Elf_Ehdr);
- if (flags & (LOAD_SYM|COUNT_SYM)) {
+ if (flags & (LOAD_SYM | COUNT_SYM)) {
if (lseek(fd, (off_t)elf->e_shoff, SEEK_SET) == -1) {
WARN(("lseek section headers"));
return 1;
@@ -184,7 +185,7 @@ ELFNAME(exec)(int fd, Elf_Ehdr *elf, u_long *marks, int flags)
maxp += roundup(sz, sizeof(Elf_Addr));
/*
- * Now load the symbol sections themselves. Make sure the
+ * Now load the symbol sections themselves. Make sure the
* sections are aligned. Don't bother with string tables if
* there are no symbol sections.
*/
@@ -246,5 +247,6 @@ ELFNAME(exec)(int fd, Elf_Ehdr *elf, u_long *marks, int flags)
marks[MARK_NSYM] = 1; /* XXX: Kernel needs >= 0 */
marks[MARK_SYM] = LOADADDR(elfp);
marks[MARK_END] = LOADADDR(maxp);
+
return 0;
}