public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* LMA XXX Overlaps Previous Sections When Using PHDRS
@ 2007-12-19 22:15 DeRosa, Anthony
  0 siblings, 0 replies; 6+ messages in thread
From: DeRosa, Anthony @ 2007-12-19 22:15 UTC (permalink / raw)
  To: binutils



^ permalink raw reply	[flat|nested] 6+ messages in thread
* LMA XXX Overlaps Previous Sections When Using PHDRS
@ 2007-12-19 22:19 DeRosa, Anthony
  2007-12-24 17:21 ` Nick Clifton
  0 siblings, 1 reply; 6+ messages in thread
From: DeRosa, Anthony @ 2007-12-19 22:19 UTC (permalink / raw)
  To: binutils

Hello,

I want to install the contents of an ELF file on a flash device, using
the LMA of the sections (or rather p_paddr of program header) in the ELF
as the addresses in flash.  The VMA and LMA will thus be different.  I
am using "PHDRS" in my linker script in order to specify where the
various sections should be installed on flash.  The problem I am seeing
is the following message:

$ i686-elf-gcc -o test.elf test.S -T link.ld -nostartfiles

/opt/cross-tools/binutils-2.17-gcc-4.1.1-newlib-1.14.0/lib/gcc/i686-elf/
4.1.1/../../../../i686-elf/bin/ld: test.elf: section .section_0 lma
0x1000 overlaps previous sections

/opt/cross-tools/binutils-2.17-gcc-4.1.1-newlib-1.14.0/lib/gcc/i686-elf/
4.1.1/../../../../i686-elf/bin/ld: test.elf: section .section_1 lma
0x1020 overlaps previous sections


Is this a warning, an error, or neither?  Why does it say "lma 0x1000"?
I thought the VMA was 0x1000, and the LMA is 0x4000.

Here is the example code and a contrived linker script.

------------------------------------------------------------------------
----
-- code
------------------------------------------------------------------------
----

.global _start

.section .text_0, "ax"
_start:
    jmp foo

.section .text_1, "ax"
foo:
    jmp foo

------------------------------------------------------------------------
----
-- linker script
------------------------------------------------------------------------
----

ENTRY (_start)

MEMORY 
{
    ram_0 : ORIGIN = 0x00001000, LENGTH = 32
    ram_1 : ORIGIN = 0x00001020, LENGTH = 32
}

PHDRS
{
    phdr_0 PT_LOAD AT (0x4000);
    phdr_1 PT_LOAD AT (0x5000);
}


SECTIONS
{

    .section_0 :
    { 
        *(.text)
        *(.data)
        *(.bss)
        *(.text_0) 

    } >ram_0 : phdr_0

    .section_1 :
    {
        *(.text_1) 
    } >ram_1 : phdr_1
    
}


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-12-26 21:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-19 22:15 LMA XXX Overlaps Previous Sections When Using PHDRS DeRosa, Anthony
2007-12-19 22:19 DeRosa, Anthony
2007-12-24 17:21 ` Nick Clifton
2007-12-25 23:09   ` Alan Modra
2007-12-26 19:02     ` Nick Clifton
2007-12-26 21:40       ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).