This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos 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]

RE: trying to build ROM image for hello


Hi Chris,
I no nothing about your port to the MIPS architecture, but I wonder what
linker script you are using.  Typically, for ROM images, the linker script
arranges things so that initialized data gets appended to the end of the
code segment so that, when the application starts, the startup code can copy
it to RAM.  If you have rolled your own linker script, I would go back and
look at that, especially in comparison with the ROM scripts for other (MIPS
based) targets.  If you are using an unadulterated linker script, then I
might try a fresh build from scratch (i.e. ecosconfig new, ecosconfig tree,
make, etc...) just to make sure that nothing got confused since the last
time I did that.

--wpd


> -----Original Message-----
> From: ecos-discuss-owner@sources.redhat.com
> [mailto:ecos-discuss-owner@sources.redhat.com]On Behalf Of Chris Hanna
> Sent: Friday, February 08, 2002 4:40 PM
> To: ecos-discuss@sources.redhat.com
> Subject: [ECOS] trying to build ROM image for hello
>
>
> Hello.
>
> I'm using CYG_HAL_STARTUP = ROM, and i have built a .elf for the hello.c
> program.
> I'm trying to make a binary image or S-record file so I can burn a EPROM.
>
> The linker script locates RAM and ROM as shown:
>
> MEMORY
> {
>     ram : ORIGIN = 0x80000400, LENGTH = 0xfffc00
>     rom : ORIGIN = 0x9fc00000, LENGTH = 0x80000
> }
>
> I make a binary with (is this right?):
> $ objcopy --verbose -O binary -S -g -R .mdebug hello hello.img
>
> I get a huge file since RAM sections are being included.
>
> Below is the output of objdump, I only want the ROM sections, so what do i
> need to do ?
> are those .lit8 and .lit4 sections screwing things up ?
>
> Thanks,
> Chris
>
> $ objdump -h hello
>
> hello:     file format elf32-bigmips
>
> Sections:
> Idx Name          Size      VMA               LMA               File off
> Algn
>   0 .rom_vectors  00000498  000000009fc00000  000000009fc00000  00001000
> 2**0
>                   CONTENTS, ALLOC, LOAD, READONLY, CODE
>   1 .init         00000000  000000009fc004c0  000000009fc004c0  00014788
> 2**0
>                   CONTENTS
>   2 .text         00011d38  000000009fc004c0  000000009fc004c0  000014c0
> 2**2
>                   CONTENTS, ALLOC, LOAD, READONLY, CODE
>   3 .fini         00000000  000000009fc12200  000000009fc12200  00014788
> 2**0
>                   CONTENTS
>   4 .rodata       000009d4  000000009fc12200  000000009fc12200  00013200
> 2**3
>                   CONTENTS, ALLOC, LOAD, READONLY, DATA
>   5 .rodata1      00000000  000000009fc12c00  000000009fc12c00  00014788
> 2**0
>                   CONTENTS
>   6 .data         00000288  0000000080000400  000000009fc12c00  00014400
> 2**2
>                   CONTENTS, ALLOC, LOAD, DATA
>   7 .data1        00000000  00000000800006c0  00000000800006c0  00014788
> 2**0
>                   CONTENTS
>   8 .eh_frame     00000000  00000000800006c0  00000000800006c0  00014788
> 2**0
>                   CONTENTS
>   9 .gcc_except_table 00000000  00000000800006c0
> 00000000800006c0  00014788
> 2**0
>                   CONTENTS
>  10 .ctors        00000030  00000000800006c0  000000009fc12ec0  000146c0
> 2**2
>                   CONTENTS, ALLOC, LOAD, DATA
>  11 .dtors        00000020  0000000080000700  000000009fc12f00  00014700
> 2**2
>                   CONTENTS, ALLOC, LOAD, DATA
>  12 .devtab       00000040  0000000080000740  000000009fc12f40  00014740
> 2**3
>                   CONTENTS, ALLOC, LOAD, DATA
>  13 .got          00000000  0000000080000780  0000000080000780  00014788
> 2**0
>                   CONTENTS
>  14 .dynamic      00000000  0000000080000780  0000000080000780  00014788
> 2**0
>                   CONTENTS
>  15 .sdata        00000008  0000000080000780  000000009fc12f80  00014780
> 2**2
>                   CONTENTS, ALLOC, LOAD, DATA
>  16 .lit8         00000000  00000000800007c0  00000000800007c0  00014788
> 2**0
>                   CONTENTS, ALLOC, LOAD, DATA
>  17 .lit4         00000000  00000000800007c0  00000000800007c0  00014788
> 2**0
>                   CONTENTS, ALLOC, LOAD, DATA
>  18 .sbss         00000030  00000000800007c0  00000000800007c0  000007c0
> 2**3
>                   ALLOC
>  19 .bss          00004024  0000000080000800  0000000080000800  000007d0
> 2**4
>                   ALLOC
>  20 .reginfo      00000018  0000000000000000  0000000000000000  00014788
> 2**2
>                   CONTENTS, READONLY
>
>


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