diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2012-12-16 21:23:33 +0100 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2012-12-16 21:28:41 +0100 |
commit | 47f6d77690abb7bc92cf515684f9b26385d80d25 (patch) | |
tree | c08c5cda221ae0a8fc1e219e11d8bf9115d51468 /utils/imxtools | |
parent | 1e2e79d66809ad0f1ff598bf9dbed8e322a1f8ea (diff) | |
download | rockbox-47f6d77690abb7bc92cf515684f9b26385d80d25.tar.gz rockbox-47f6d77690abb7bc92cf515684f9b26385d80d25.zip |
imxtools/sbtools: "fix" address handling in ELF
This is a common problem that proprietary tools don't handle ELF
files correctly. ELF sections use a virtual address and the
virtual -> physical translation is done though segments. This
allows to have a load (physical) address different from the
virtual one. Here is the trick: proprietary tools usually don't
take the pain to do the translation and just grab the virtual
address. This commit implements proper translation in elftosb1
knowing that this introduce a deviation from the behaviour of the
proprietary tool.
Change-Id: I91721a3a8dead382a0603f84ae3b35c5eb9704eb
Diffstat (limited to 'utils/imxtools')
-rw-r--r-- | utils/imxtools/sbtools/elftosb1.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/imxtools/sbtools/elftosb1.c b/utils/imxtools/sbtools/elftosb1.c index a654b6b34a..417f7eeb46 100644 --- a/utils/imxtools/sbtools/elftosb1.c +++ b/utils/imxtools/sbtools/elftosb1.c | |||
@@ -377,7 +377,7 @@ static int load_elf(struct sb1_file_t *sb, const char *filename, int act) | |||
377 | fclose(fd); | 377 | fclose(fd); |
378 | if(!loaded) | 378 | if(!loaded) |
379 | bug("error loading elf file '%s'\n", filename); | 379 | bug("error loading elf file '%s'\n", filename); |
380 | //elf_translate_addresses(&elf); | 380 | elf_translate_addresses(&elf); |
381 | elf_sort_by_address(&elf); | 381 | elf_sort_by_address(&elf); |
382 | 382 | ||
383 | struct elf_section_t *esec = elf.first_section; | 383 | struct elf_section_t *esec = elf.first_section; |