This is the mail archive of the binutils@sourceware.cygnus.com 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]

can't get vma != lma to work



Hi, 

I'm using binutils 000309 built on a Linux-386 host for arm-elf
target and can not figure out how to generate a file where the
VMA and LMA are different.

Here's my linker command file::

------------------------------link.ld------------------------------
OUTPUT_FORMAT(elf32-bigarm)

SECTIONS
{
    .boot0  0x100000 : AT ( 0 ) { *(.boot0) }
    .boot1 0x3fe0000 : AT ( 0x10000 ) { *(.boot1) }
    system_entry = 0x100;
}
--------------------------------------------------------------------

Here's the linker command line:

$ arm-elf-ld -o boot.out boot.o -Map boot.map -T link.ld

And in the resultin object file, the "AT" directive in link.ld
seems to have been ignored.  What am I doing wrong??

$ arm-elf-objdump --headers test.out

boot.out:     file format elf32-bigarm

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .boot0        00000030  00100000  00100000  00008058  2**0
                  CONTENTS, READONLY
  1 .boot1        00000058  03fe0000  03fe0000  00008088  2**0
                  CONTENTS, READONLY
  2 .text         00000000  03fe0058  03fe0058  00008058  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  3 .glue_7t      00000000  03fe0058  03fe0058  00008058  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  4 .glue_7       00000000  03fe0058  03fe0058  00008058  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  5 .data         00000000  03fe0058  03fe0058  00008058  2**0
                  CONTENTS, ALLOC, LOAD, DATA
  6 .bss          00000000  00000000  00000000  00008000  2**0
                  ALLOC
  7 .stab         000000d8  03fe0058  03fe0058  000080e0  2**2
                  CONTENTS, READONLY, DEBUGGING
  8 .stabstr      00000008  03fe0130  03fe0130  000081b8  2**0
                  CONTENTS, READONLY, DEBUGGING

The map shows the LMA to be what I requested, but objcopy
agrees with objdump and generates output with the load addresses
set to 0x100000 and 0x3fe0000 instead of the load addresses shown
in the map file:

------------------------------boot.map------------------------------
Memory Configuration

Name             Origin             Length             Attributes
*default*        0x00000000         0xffffffff

Linker script and memory map

LOAD boot.o

.boot0          0x00100000       0x30 load address 0x00000000
 *(.boot0)
  .boot0         0x00100000       0x30 boot.o
  
.boot1          0x03fe0000       0x58 load address 0x00010000
 *(.boot1)
  .boot1         0x03fe0000       0x58 boot.o

[...]
--------------------------------------------------------------------



P.S. Is there a way to tell ld to set the "LOAD" flag for
     sections .boot1 and .boot0?  I know I can do it with
     objcopy, but I wondered if there was a way to tell the
     linker to do it.

-- 
Grant Edwards
grante@visi.com

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