[ECOS] linker script problem

Neundorf, Alexander Alexander.Neundorf@jenoptik.com
Fri Apr 22 09:49:00 GMT 2005


in my application now more or less the complete available RAM is used and a second RAM had to be added.
The ldi file now looks like this with a new section "ram2":

#include <cyg/infra/cyg_type.inc>

    ram  : ORIGIN = 0x00000000, LENGTH = 0x04000000
    ram2 : ORIGIN = 0x04000000, LENGTH = 0x04000000

    SECTION_fixed_vectors	(ram, 0x20, LMA_EQ_VMA)
    SECTION_rom_vectors		(ram, 0x20000, LMA_EQ_VMA)
    SECTION_text		(ram, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_fini		(ram, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_rodata		(ram, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_rodata1		(ram, ALIGN (0x4), LMA_EQ_VMA)
    .romfs ALIGN(0x20) :	{*(.romfs)} > ram
    SECTION_fixup		(ram, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_gcc_except_table	(ram, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_data		(ram, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_bss			(ram, ALIGN (0x4), LMA_EQ_VMA)
    CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
    .ram2 (NOLOAD)		:        {*(.ram2)} > ram2

Now it works, but the produced elf file has become 32 MB bigger (from 5 to 37 MB). That's the size of the buffer I placed in the new ram2 section:

char RealBigBuffer[0x2000000} __attribute__ ((section("ram2")));

When this buffer was still in the default data section the elf file didn't "include" all this space.

This is what the list file says:

testapp:     file format elf32-littlearm
architecture: arm, flags 0x00000112:
start address 0x00020040

 17 .ram2         020000fa  04000000  04000000  00040000  2**0
                  CONTENTS, ALLOC, LOAD, DATA
040000fa g     O .ram2	02000000 RealBigBuffer
04000000 g     O .ram2	000000fa Buffer


Is this the intended behaviour ? Is there a way to remove the 32 MB for this buffer from the elf file ?

Any hints are very much appreciated

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

More information about the Ecos-discuss mailing list