From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27002 invoked by alias); 19 Dec 2007 22:19:41 -0000 Received: (qmail 26991 invoked by uid 22791); 19 Dec 2007 22:19:41 -0000 X-Spam-Check-By: sourceware.org Received: from 63-148-72-226.dia.static.qwest.net (HELO corpcboert01.edocorp.com) (63.148.72.226) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 19 Dec 2007 22:19:37 +0000 Received: from corpcboemb01.edocorp.com ([10.33.16.14]) by corpcboert01.edocorp.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 19 Dec 2007 17:19:35 -0500 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: LMA XXX Overlaps Previous Sections When Using PHDRS Date: Wed, 19 Dec 2007 22:19:00 -0000 Message-ID: <3517CACAE247DD498B74D4B65A379E95270856@corpcboemb01.edocorp.com> From: "DeRosa, Anthony" To: Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2007-12/txt/msg00116.txt.bz2 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=20 { ram_0 : ORIGIN =3D 0x00001000, LENGTH =3D 32 ram_1 : ORIGIN =3D 0x00001020, LENGTH =3D 32 } PHDRS { phdr_0 PT_LOAD AT (0x4000); phdr_1 PT_LOAD AT (0x5000); } SECTIONS { .section_0 : {=20 *(.text) *(.data) *(.bss) *(.text_0)=20 } >ram_0 : phdr_0 .section_1 : { *(.text_1)=20 } >ram_1 : phdr_1 =20=20=20=20 }