diff options
author | peter <peter@FreeBSD.org> | 2001-06-19 07:41:07 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2001-06-19 07:41:07 +0000 |
commit | 56e683fe9071d80a208ec0a824d812e6b4cf1b4f (patch) | |
tree | 2127a1c24c40ba0234625d4e477a999d0f960203 /sys/boot/common/load_elf.c | |
parent | 843008ffd29f9b726febd49912712cff5c4ce7c0 (diff) | |
download | FreeBSD-src-56e683fe9071d80a208ec0a824d812e6b4cf1b4f.zip FreeBSD-src-56e683fe9071d80a208ec0a824d812e6b4cf1b4f.tar.gz |
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
Diffstat (limited to 'sys/boot/common/load_elf.c')
-rw-r--r-- | sys/boot/common/load_elf.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/boot/common/load_elf.c b/sys/boot/common/load_elf.c index e0d5821..e63d85e 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) { |