This is the mail archive of the sid@sources.redhat.com mailing list for the SID 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: SID ELF loader using wrong load address?


Approved by fche and committed.

Dave Brolley wrote:

> Hi,
>
> I have a linker script for an application on an ELF target which
> contains something like the following:
>
> .reloc_section 0x1000 : AT (LOADADDR(.text)+SIZEOF(.text))
> {
>    *(.reloc_section)
> }
>
> This is a section of code which should be loaded at the end of the .text
> section and is intended to be copied (by the application itself) to
> address 0x1000 before being executed. However, the SID ELF loader
> currently loads this section at address 0x1000 (the VMA) instead of at
> the given LMA. Visual inspection of a hex dump of my executable shows
> that, for elf32, the address being used at offset 8 of the section
> header is indeed the VMA and that the LMA is at offset 12 (can anyone
> confirm this?).
>
> The attached patch gets the section loaded at the proper LMA and has
> been tested against my port (an internal one) and against xstormy16. I
> would not expect any regressions since the LMA and the VMA are the same
> unless one plays linker script tricks like the one above.
>
> OK to commit?
>
> Dave
>
>   ------------------------------------------------------------------------
>                     Name: lma.ChangeLog
>    lma.ChangeLog    Type: Plain Text (text/plain)
>                 Encoding: 7bit
>
>                     Name: lma.patch.txt
>    lma.patch.txt    Type: Plain Text (text/plain)
>                 Encoding: 7bit


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