This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [skanduru@earth.siliconrock.com: VMA different from LMA]
- From: Srinivasa Kanduru <skanduru at linux dot sadhanapath dot com>
- To: binutils at sources dot redhat dot com, echristo at redhat dot com,Ian Lance Taylor <ian at wasabisystems dot com>
- Cc: skanduru at siliconrock dot com
- Date: Wed, 4 Feb 2004 18:44:33 -0800
- Subject: Re: [skanduru@earth.siliconrock.com: VMA different from LMA]
- References: <20040203195243.GD30065@earth.siliconrock.com> <m3smhrc2jc.fsf@gossamer.airs.com>
Hi,
I defined a memory region for all the sections as follows:
I assume the address specified in Memory block is LMA and the location counter address would be the VMA. Is that correct ? But in the output, both seem to be in the same address range.
Secondly I am trying to cross-compile the netbsd code for Motorola security processor (mpc875). I used the generic powerpc cpu switch -mcpu=powerpc -mpowerpc to generate a 'hello world' program.
The ELF file is generated successfully, but the program hangs on the evalboard.
I would appreciate any insight into why it hangs.
Thanks,
Srini.
MEMORY
{
ram (rwx) : org = 0x50000, l = 0x50000
}
SECTIONS {
. = 0xff030000;
...
(all sections)
...
> ram }
The sections offsets and addresses show up like this.
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al [ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .init PROGBITS 00050018 000098 000040 00 AX 0 0 4 [ 2] .text PROGBITS 00050060 0000e0 004b00 00 WAX 0 0 16 [ 3] .fini PROGBITS 00054b60 004be0 000040 00 AX 0 0 4 [ 4] .rodata PROGBITS 00054ba0 004c20 000af8 00 A 0 0 8 [ 5] .sdata2 PROGBITS 00055698 005718 000000 00 A 0 0 4 [ 6] .data PROGBITS 00055698 005718 0005e4 00 WA 0 0 8...
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x000080 0x00050000 0x00050000 0x05ce0 0x0807c RWE 0x10
NOTE 0x000080 0x00050000 0x00050000 0x00018 0x00018 R 0x4
On Tue, Feb 03, 2004 at 03:48:39PM -0500, Ian Lance Taylor wrote:
> Srinivasa Kanduru <skanduru@earth.siliconrock.com> writes:
>
> > I am using gcc-3.2.2.1 as cross-compiler and binutils-2.13.1-1. How can I
> > specify VMA different from LMA for all sections of an executable in ldscripts ?
>
> Look for the AT attribute in the manual.
> http://sources.redhat.com/binutils/docs-2.12/ld.info/Output-Section-LMA.html#Output%20Section%20LMA
>
> Ian