aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Bucur <stefanb@zytor.com>2008-07-25 00:57:16 -0700
committerStefan Bucur <stefan@stefan-ubumac.(none)>2009-03-15 10:08:55 +0200
commit4f01f5f493a83d3e04d380895be16931c3c3b9e4 (patch)
treebb7ecedf8cd688bb7cd791d2c1463b3bd536b40a
parentc3926ce6eaecb5f62b702e5977ef473f3d832140 (diff)
downloadsyslinux-elf-4f01f5f493a83d3e04d380895be16931c3c3b9e4.tar.gz
syslinux-elf-4f01f5f493a83d3e04d380895be16931c3c3b9e4.tar.xz
syslinux-elf-4f01f5f493a83d3e04d380895be16931c3c3b9e4.zip
Klibc dynamic loading almost complete.
-rw-r--r--com32/elflink/elf_module.c11
-rw-r--r--com32/elflink/test_com32.c4
2 files changed, 14 insertions, 1 deletions
diff --git a/com32/elflink/elf_module.c b/com32/elflink/elf_module.c
index 44ac23b6..4d4d2b2a 100644
--- a/com32/elflink/elf_module.c
+++ b/com32/elflink/elf_module.c
@@ -731,7 +731,6 @@ static int check_symbols(struct elf_module *module) {
int strong_count;
int weak_count;
- // The chain count gives the number of symbols
for (i = 1; i < module->symtable_size; i++) {
crt_sym = (Elf32_Sym*)(module->sym_table + i * module->syment_size);
crt_name = module->str_table + crt_sym->st_name;
@@ -860,6 +859,16 @@ int module_load_shallow(struct elf_module *module) {
print_elf_symbols(module);
#endif // ELF_DEBUG
+ // Check the symbols for duplicates / missing definitions
+ CHECKED(res, check_symbols(module), error);
+
+ // Add the module at the beginning of the module list
+ list_add(&module->list, &modules);
+
+ // The file image is no longer needed
+ image_unload(module);
+
+
return 0;
error:
diff --git a/com32/elflink/test_com32.c b/com32/elflink/test_com32.c
index 9be31cd0..90643937 100644
--- a/com32/elflink/test_com32.c
+++ b/com32/elflink/test_com32.c
@@ -52,6 +52,10 @@ int main(int argc, char **argv) {
// Initializing the module subsystem
res = modules_com32_setup();
+ // Load klibc
+ mod_klibc = module_alloc(ELF_DIRECTORY KLIBC_NAME);
+ module_load(mod_klibc);
+
if (res != 0) {
printf("ERROR: Could not fully initialize the module!\n");
return res;