From 5c9321595d3b1d8b78a2b238190e45ff965369d0 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Tue, 19 Jun 2001 07:41:07 +0000 Subject: [PATCH] Convert the elf loader to the new linker set layout for elf files. This should make dependencies at load time work like before. Oops. Noticed by: markm --- sys/boot/common/load_elf.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/boot/common/load_elf.c b/sys/boot/common/load_elf.c index e0d582188924..e63d85e4a2c9 100644 --- a/sys/boot/common/load_elf.c +++ b/sys/boot/common/load_elf.c @@ -570,17 +570,18 @@ elf_parse_modmetadata(struct preloaded_file *fp, elf_file_t ef) { struct mod_metadata md; Elf_Sym sym; - char *s, *v, **p; - long entries; + char *s, *v, **p, **p_stop; int modcnt; - if (elf_lookup_symbol(fp, ef, "modmetadata_set", &sym) != 0) + if (elf_lookup_symbol(fp, ef, "__start_set_modmetadata_set", &sym) != 0) return ENOENT; - COPYOUT(sym.st_value + ef->off, &entries, sizeof(entries)); + p = (char **)(sym.st_value + ef->off); + if (elf_lookup_symbol(fp, ef, "__stop_set_modmetadata_set", &sym) != 0) + return ENOENT; + p_stop = (char **)(sym.st_value + ef->off); modcnt = 0; - p = (char **)(sym.st_value + ef->off + sizeof(entries)); - while (entries--) { + while (p < p_stop) { COPYOUT(p++, &v, sizeof(v)); COPYOUT(v + ef->off, &md, sizeof(md)); switch(md.md_type) {