This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

objcopy doesn't generate srecords for all the memory regions


I have an elf image that links without error.  I believe that I have
something wrong though because when I use objcopy to generate my
srecords I am missing the record for the reset vector (x86 platform)
which is in my .rvector section.  Also, the label that that is at the
start of the .revector section is marked as "fffffff0 N reset_vect" by
nm.

What did I do wrong?

--------------------------------------------

The linker scrip looks something like this (shortened for brevity)

MEMORY {
  RAM : ORIGIN = @RAMBASE@, LENGTH = @RAMSIZE@
  ROM1 : ORIGIN = @ROMBASE@, LENGTH = @ROMSIZE@
  ROM2 : ORIGIN = @RESETVECT@, LENGTH = @RESETVECTLENGTH@
}

SECTIONS {
  .text : { .... } >ROM1 =0
     <snip>
  .data: { ... } >RAM
     <snip>
  .rvector : { ... } > ROM2
}


This generates an elf file that has the following:

Program Header:
    LOAD off    0x00000000 vaddr 0x00001000 paddr 0x00001000 align 2**12
         filesz 0x000006a0 memsz 0x00002000 flags rw-
    LOAD off    0x00002000 vaddr 0xffff0000 paddr 0xffff0000 align 2**12
         filesz 0x00006760 memsz 0x00006760 flags r-x
    LOAD off    0x00009000 vaddr 0x00001000 paddr 0xffff6760 align 2**12
         filesz 0x000006a0 memsz 0x000006a0 flags rw-

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00005a74  ffff0000  ffff0000  00002000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .rodata       00000ce0  ffff5a80  ffff5a80  00007a80  2**5
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .data         000006a0  00001000  ffff6760  00009000  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  3 .bss          00001960  000016a0  000016a0  000006a0  2**3
                  ALLOC
  4 .rvector      00000005  fffffff0  fffffff0  000096a0  2**0
                  CONTENTS, READONLY
  5 .comment      00000168  00000000  00000000  000096a5  2**0
                  CONTENTS, READONLY


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