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:
@@ -42,7 +42,7 @@
|
|||||||
# Activates a hack that allows single-stepping under qemu
|
# Activates a hack that allows single-stepping under qemu
|
||||||
# to work.
|
# to work.
|
||||||
|
|
||||||
#load_symbols true
|
load_symbols true
|
||||||
# load kernel and kernel add-on symbols, default is off
|
# load kernel and kernel add-on symbols, default is off
|
||||||
|
|
||||||
#apm true
|
#apm true
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include <boot/arch.h>
|
#include <boot/arch.h>
|
||||||
#include <boot/platform.h>
|
#include <boot/platform.h>
|
||||||
#include <boot/stage2.h>
|
#include <boot/stage2.h>
|
||||||
|
#include <driver_settings.h>
|
||||||
#include <elf32.h>
|
#include <elf32.h>
|
||||||
#include <kernel.h>
|
#include <kernel.h>
|
||||||
|
|
||||||
@@ -24,6 +25,17 @@
|
|||||||
#endif
|
#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
|
static status_t
|
||||||
verify_elf_header(struct Elf32_Ehdr &header)
|
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_symbols = NULL;
|
||||||
image->debug_string_table = NULL;
|
image->debug_string_table = NULL;
|
||||||
|
|
||||||
// ToDo: this should be enabled by kernel settings!
|
if (_loadElfSymbols)
|
||||||
if (1)
|
|
||||||
load_elf_symbol_table(fd, image);
|
load_elf_symbol_table(fd, image);
|
||||||
|
|
||||||
free(programHeaders);
|
free(programHeaders);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include <boot/vfs.h>
|
#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(Directory *directory, const char *path);
|
||||||
extern status_t elf_load_image(int fd, preloaded_image *image);
|
extern status_t elf_load_image(int fd, preloaded_image *image);
|
||||||
|
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ load_kernel(stage2_args *args, Directory *volume)
|
|||||||
|
|
||||||
dprintf("load kernel...\n");
|
dprintf("load kernel...\n");
|
||||||
|
|
||||||
|
elf_init();
|
||||||
status_t status = elf_load_image(fd, &gKernelArgs.kernel_image);
|
status_t status = elf_load_image(fd, &gKernelArgs.kernel_image);
|
||||||
|
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|||||||
Reference in New Issue
Block a user