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: Linker script question? where is the fixed_vectorssection?ARM


On Thu, 2003-01-23 at 14:44, Qiang Huang wrote:
> Hi all:
>    In a rom startup linker script I saw these and I can't figure this
> out.(ARM target)
> 
> MEMORY
> {
>     ram : ORIGIN = 0, LENGTH = 0x8000000
>     rom : ORIGIN = 0x40000000, LENGTH = 0x100000
> }
> 
> SECTIONS
> {
>     SECTIONS_BEGIN
>     SECTION_rom_vectors (rom, 0x40000000, LMA_EQ_VMA)
>     SECTION_text (rom, ALIGN (0x4), LMA_EQ_VMA)
>     SECTION_fini (rom, ALIGN (0x4), LMA_EQ_VMA)
>     SECTION_rodata (rom, ALIGN (0x4), LMA_EQ_VMA)
>     SECTION_rodata1 (rom, ALIGN (0x4), LMA_EQ_VMA)
>     SECTION_fixup (rom, ALIGN (0x4), LMA_EQ_VMA)
>     SECTION_gcc_except_table (rom, ALIGN (0x4), LMA_EQ_VMA)
>     SECTION_fixed_vectors (ram, 0x20, LMA_EQ_VMA)
>     SECTION_data (ram, 0x8000, FOLLOWING (.gcc_except_table))
>     SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
>     CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
>     SECTIONS_END
> }
> 
> if the flash is originally located at 0x0000H, then if I create a S-record
> file and want to download it to the rom, where will be the section:
> fixed_vectors stored? because it is defined as:     SECTION_fixed_vectors
> (ram, 0x20, LMA_EQ_VMA),  according to LMA_EQ_VMA it should be stored at the
> same address as the VMA as here in the ram, how is this interpreted in the
> S-record file (file for downloading into the flash memory)? Thanks a lot.
> 
> BTW the order of the sections in the flash memory after the S-record file
> downloaded is:
> 0x0000H    1. rom_vectors
> continue.   2. text
> cont.           3. fini
> cont.           4. rodata
> cont.           5. rodata1
> cont.           6. fixup
> cont.           7. gcc_exception_table
> cont.           8. data
> 
> Is the correct? if so where is the fixed_vectors section stored in
> flash(rom).

The fixed_vectors, along with any static data, will be stored in the
ROM image just after the end of the TEXT segment.  If you look at any
ROM startup code, you'll see that it has to move this data from the
actual ROM space to the appropriate place in RAM before the system
can begin.

-- 
.--------------------------------------------------------.
|       Mind: Embedded Linux and eCos Development        |
|--------------------------------------------------------|
| Gary Thomas              email:  gary.thomas@mind.be   |
| Mind ( http://mind.be )  tel:    +1 (970) 229-1963     |
| gpg: http://www.chez-thomas.org/gary/gpg_key.asc       |
'--------------------------------------------------------'


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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