Skip to content

Commit

Permalink
Do no error out if the image base address is not 0x0
Browse files Browse the repository at this point in the history
Now that we compute the length of the ELF in memory based on the
last runtime address of the ELF loaded in memory, we no longer
have to worry about base addresses not being `0x0`.

Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Michalis Pappas <michalis@unikraft.io>
GitHub-Closes: #64
  • Loading branch information
mogasergiu authored and razvand committed Jan 3, 2024
1 parent 484aa60 commit a6b343a
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions elf_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,6 @@ static int elf_load_parse(struct elf_prog *elf_prog, Elf *elf)
uk_pr_debug("%s: base: pie + 0x%"PRIx64", len: 0x%"PRIx64"\n",
elf_prog->name, elf_prog->lowerl, elf_prog->upperl - elf_prog->lowerl);

/* We do not support yet an img base other than 0 */
if (unlikely(elf_prog->lowerl != 0)) {
elferr_err("%s: Image base is not 0x0, unsupported\n",
elf_prog->name);
ret = -ENOEXEC;
goto err_out;
}

elf_prog->phdr.off = ehdr.e_phoff;
elf_prog->phdr.num = ehdr.e_phnum;
elf_prog->phdr.entsize = ehdr.e_phentsize;
Expand Down

0 comments on commit a6b343a

Please sign in to comment.