[PATCH] D43228: [ELF] Allow redefining LMA for a section inside a segment.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 14:50:23 PST 2018


Igor Kudrin <ikudrin at accesssoftek.com> writes:

> Hi Rafael,
>
> GNU ld's doc has a nice example of this https://sourceware.org/binutils/docs/ld/Output-Section-LMA.html.
>
> For a ROM image, everything goes in one big chunk. There are linker script symbols which help to find where the blocks, which to be copied to the actual memory, are located.

At runtime the ELF file should be parsed based on the program
headers. The example in the manual works by creating multiple PT_LOADs,
which is fine.

The problem is when both sections should be in a single PT_LOAD:

--------------------------------
| ... | SecA | .... | SecB| ...|
--------------------------------

SecB and can be at offset from SecA, but the difference in offsets,
virtual addresses and physical addresses will all be the same.

Cheers,
Rafael


More information about the llvm-commits mailing list