Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/hpc/stand/hpcboot Load ".symtab" section before ".s...
details: https://anonhg.NetBSD.org/src/rev/d71a9b1446bc
branches: trunk
changeset: 556655:d71a9b1446bc
user: uwe <uwe%NetBSD.org@localhost>
date: Tue Dec 23 04:59:44 2003 +0000
description:
Load ".symtab" section before ".strtab". The code to pack the symbol
table (kern_ksyms.c:addsymtab) relies on that order.
diffstat:
sys/arch/hpc/stand/hpcboot/load_elf.cpp | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
diffs (66 lines):
diff -r 0a7f777101e2 -r d71a9b1446bc sys/arch/hpc/stand/hpcboot/load_elf.cpp
--- a/sys/arch/hpc/stand/hpcboot/load_elf.cpp Tue Dec 23 04:49:04 2003 +0000
+++ b/sys/arch/hpc/stand/hpcboot/load_elf.cpp Tue Dec 23 04:59:44 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: load_elf.cpp,v 1.8 2003/12/18 12:19:49 uwe Exp $ */
+/* $NetBSD: load_elf.cpp,v 1.9 2003/12/23 04:59:44 uwe Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -150,8 +150,8 @@
// ELF header
// section header
// shstrtab
+// symtab
// strtab
-// symtab
//
size_t
ElfLoader::symbol_block_size()
@@ -217,18 +217,18 @@
}
// set Section Headers for symbol/string table
- _sym_blk.shstr->sh_offset = shstrtab_offset + shstrsize;
- _sym_blk.shsym->sh_offset = shstrtab_offset + shstrsize +
- ROUND4(_sym_blk.shstr->sh_size);
+ _sym_blk.shsym->sh_offset = shstrtab_offset + shstrsize;
+ _sym_blk.shstr->sh_offset = shstrtab_offset + shstrsize +
+ ROUND4(_sym_blk.shsym->sh_size);
_sym_blk.enable = TRUE;
- DPRINTF((TEXT("+[(symbol block: header %d string %d symbol %d byte)"),
- _sym_blk.header_size,_sym_blk.shstr->sh_size,
- _sym_blk.shsym->sh_size));
+ DPRINTF((TEXT("+[(symbol block: header %d symbol %d string %d byte)"),
+ _sym_blk.header_size,_sym_blk.shsym->sh_size,
+ _sym_blk.shstr->sh_size));
// return total amount of symbol block
- return (_sym_blk.header_size + ROUND4(_sym_blk.shstr->sh_size) +
- _sym_blk.shsym->sh_size);
+ return (_sym_blk.header_size + ROUND4(_sym_blk.shsym->sh_size) +
+ _sym_blk.shstr->sh_size);
}
void
@@ -243,14 +243,14 @@
_load_memory(kv, _sym_blk.header_size, _sym_blk.header);
kv += _sym_blk.header_size;
+ // load symbol table
+ sz = _sym_blk.shsym->sh_size;
+ _load_segment(kv, sz, _sym_blk.symoff, sz);
+ kv += ROUND4(sz);
+
// load string table
sz = _sym_blk.shstr->sh_size;
_load_segment(kv, sz, _sym_blk.stroff, sz);
- kv += ROUND4(sz);
-
- // load symbol table
- sz = _sym_blk.shsym->sh_size;
- _load_segment(kv, sz, _sym_blk.symoff, sz);
}
BOOL
Home |
Main Index |
Thread Index |
Old Index