mirror of https://github.com/thesofproject/sof.git
rimage: use lma if available
some sections may use different lma than vma address, in such case rimage needs to use lma Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
This commit is contained in:
parent
932478abd6
commit
f23b2c2d07
|
@ -126,9 +126,16 @@ static uint32_t elf_to_file_offset(struct image *image,
|
||||||
struct sof_man_module *man_module,
|
struct sof_man_module *man_module,
|
||||||
Elf32_Shdr *section)
|
Elf32_Shdr *section)
|
||||||
{
|
{
|
||||||
uint32_t elf_addr = section->vaddr, file_offset = 0;
|
uint32_t elf_addr = section->vaddr, file_offset = 0, i;
|
||||||
|
|
||||||
if (section->type == SHT_PROGBITS || section->type == SHT_INIT_ARRAY) {
|
if (section->type == SHT_PROGBITS || section->type == SHT_INIT_ARRAY) {
|
||||||
|
/* check programs for lma/vma change */
|
||||||
|
for (i = 0; i < module->hdr.phnum; i++) {
|
||||||
|
if (section->vaddr == module->prg[i].vaddr) {
|
||||||
|
elf_addr = module->prg[i].paddr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (section->flags & SHF_EXECINSTR) {
|
if (section->flags & SHF_EXECINSTR) {
|
||||||
/* text segment */
|
/* text segment */
|
||||||
file_offset = elf_addr - module->text_start +
|
file_offset = elf_addr - module->text_start +
|
||||||
|
|
Loading…
Reference in New Issue