Implemented TODO about not loading symbols at boot.

This saves ~0.5s of boot time here, but I suspect it might be better for CD.
Enabled loadSymbols in kernel settings so the behavior should be the same as before this change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34666 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Fredrik Holmqvist 2009-12-15 15:55:16 +00:00
parent 5868901fda
commit 5e972c0f3d
4 changed files with 16 additions and 3 deletions

View File

@ -42,7 +42,7 @@
# Activates a hack that allows single-stepping under qemu
# to work.
#load_symbols true
load_symbols true
# load kernel and kernel add-on symbols, default is off
#apm true

View File

@ -9,6 +9,7 @@
#include <boot/arch.h>
#include <boot/platform.h>
#include <boot/stage2.h>
#include <driver_settings.h>
#include <elf32.h>
#include <kernel.h>
@ -24,6 +25,17 @@
#endif
static bool _loadElfSymbols = false;
void
elf_init() {
void *settings = load_driver_settings("kernel");
_loadElfSymbols = !get_driver_boolean_parameter(settings, "load_symbols",
false, false);
}
static status_t
verify_elf_header(struct Elf32_Ehdr &header)
{
@ -370,8 +382,7 @@ elf_load_image(int fd, preloaded_image *image)
image->debug_symbols = NULL;
image->debug_string_table = NULL;
// ToDo: this should be enabled by kernel settings!
if (1)
if (_loadElfSymbols)
load_elf_symbol_table(fd, image);
free(programHeaders);

View File

@ -10,6 +10,7 @@
#include <boot/vfs.h>
extern void elf_init();
extern status_t elf_load_image(Directory *directory, const char *path);
extern status_t elf_load_image(int fd, preloaded_image *image);

View File

@ -60,6 +60,7 @@ load_kernel(stage2_args *args, Directory *volume)
dprintf("load kernel...\n");
elf_init();
status_t status = elf_load_image(fd, &gKernelArgs.kernel_image);
close(fd);