Mercurial > flash_v2
comparison packages/redboot/current/src/load.c @ 1319:94e373b3fc8d
Fix ELF load when -b option used.
| author | gthomas |
|---|---|
| date | Fri, 17 Oct 2003 21:45:24 +0000 |
| parents | 9ecd8873f657 |
| children | 9a2e186be457 |
comparison
equal
deleted
inserted
replaced
| 1318:e7283a4a428c | 1319:94e373b3fc8d |
|---|---|
| 338 } | 338 } |
| 339 if (base) { | 339 if (base) { |
| 340 // Set address offset based on lowest address in file. | 340 // Set address offset based on lowest address in file. |
| 341 addr_offset = 0xFFFFFFFF; | 341 addr_offset = 0xFFFFFFFF; |
| 342 for (phx = 0; phx < ehdr.e_phnum; phx++) { | 342 for (phx = 0; phx < ehdr.e_phnum; phx++) { |
| 343 if (phdr[phx].p_paddr < addr_offset) { | 343 if ((phdr[phx].p_type == PT_LOAD) && (phdr[phx].p_paddr < addr_offset)) { |
| 344 addr_offset = phdr[phx].p_paddr; | 344 addr_offset = phdr[phx].p_paddr; |
| 345 } | 345 } |
| 346 } | 346 } |
| 347 addr_offset = (unsigned long)base - addr_offset; | 347 addr_offset = (unsigned long)base - addr_offset; |
| 348 } else { | 348 } else { |
