This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
objcopy doesn't generate srecords for all the memory regions
- From: "Smith, Stephen \(SWCOE\)" <Stephen dot Smith at honeywell dot com>
- To: <binutils at sources dot redhat dot com>
- Date: Tue, 20 Mar 2007 17:29:53 -0700
- Subject: objcopy doesn't generate srecords for all the memory regions
- References: <D54AC102-676C-46C4-A2E6-82FA54BC8B75@monami-software.com> <45D2D66A.8090605@redhat.com> <22E7A5AF-8D62-427A-9CBE-8E1E406FA9B3@monami-software.com> <45D33D6A.70808@redhat.com> <DD1844E2-79FB-4D10-930C-8E9A244CB084@monami-software.com> <45D47C48.1040404@redhat.com>
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