This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Load addresses for ELF program headers on ARM


On Sun, Oct 10, 2010 at 9:50 PM, Daniel Jacobowitz <dan@codesourcery.com> wrote:
> On Mon, Oct 11, 2010 at 12:25:06PM +1030, Alan Modra wrote:
>> On Sun, Oct 10, 2010 at 07:46:58PM -0500, Matt Fischer wrote:
>> > The linker created two program headers, one for TEXT, and one for
>> > DATA. ?The TEXT one looks fine--both vaddr and paddr are at 0. ?The
>> > DATA segment, however, has a problem. ?It's been given a vaddr of
>> > 0x10000000, and a paddr of 0x000000b4. ?The former is the section's
>> > relocation address, and the latter is its load address. ?However, the
>> > ARM spec for ELF states that segments should have vaddr set to their
>> > load address, and paddr set to 0.
>>
>> Which ARM ELF spec are you talking about? ?An old and buggy one, I'd
>> guess. ?If the one you're looking at says that it is clearly in
>> conflict with the parent SysV ELF ABI spec. ?This spec
>> http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044b/IHI0044B_aaelf.pdf
>> is silent on p_vaddr and p_paddr.
>
> My memory on this is a bit vague, but I think that the ARM debugger
> does behave as Matt described (or used to). ?You should be able to
> post-process the file, either with objcopy or a custom utility; it
> will be a simple one.

This is second-hand information, but what I've been told is that the
ARM debugger does indeed behave that way--that's the main use-case I'm
trying to cover here.  If that's the case, it sounds like the best way
forward is just to create an image with multiple program headers, and
then post-process them to have the load address in the vaddr field,
even though that's not to spec.  I'm new to objcopy--does it have
facilities for changing the program headers?  Most of its options just
seem to be geared around messing with the section headers.

--Matt


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]