This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Probleme with ram rom data sections
- From: Gary Thomas <gary at mlbassoc dot com>
- To: Matthieu dot GIRARDIN at fr dot thalesgroup dot com
- Cc: ecos-discuss at sources dot redhat dot com
- Date: 10 Oct 2003 06:10:28 -0600
- Subject: Re: [ECOS] Probleme with ram rom data sections
- Organization: MLB Associates
- References: <66CE949D18BCB249ABE8D9AF48C4F1CE94B199@helios.clb.tcfr.thales>
On Fri, 2003-10-10 at 05:38, Matthieu.GIRARDIN@fr.thalesgroup.com wrote:
> Well good afternoon everybody !
>
> I tried to modify my memory layout. I want 4 Mo ROM at 0x4000000 and 2Mo RAM
> at 0x000.
> I modify my mlt files as follow :
>
> mlt_powerpc_mbx_rom.ldi:
>
> MEMORY
> {
> ram : ORIGIN = 0, LENGTH = 0x200000
> rom : ORIGIN = 0x4000000, LENGTH = 0x400000
> }
>
> SECTIONS
> {
> SECTIONS_BEGIN
> SECTION_vectors (rom, 0x4000000, LMA_EQ_VMA)
> SECTION_text (rom, ALIGN (0x4), LMA_EQ_VMA)
> SECTION_fini (rom, ALIGN (0x4), LMA_EQ_VMA)
> SECTION_rodata1 (rom, ALIGN (0x8), LMA_EQ_VMA)
> SECTION_rodata (rom, ALIGN (0x8), LMA_EQ_VMA)
> SECTION_fixup (rom, ALIGN (0x4), LMA_EQ_VMA)
> SECTION_gcc_except_table (rom, ALIGN (0x1), LMA_EQ_VMA)
> CYG_LABEL_DEFN(__reserved_vectors) = 0; . =
> CYG_LABEL_DEFN(__reserved_vectors) + 0x3000;
> CYG_LABEL_DEFN(__reserved_vsr_table) = ALIGN (0x1); . =
> CYG_LABEL_DEFN(__reserved_vsr_table) + 0x200;
> CYG_LABEL_DEFN(__reserved_virtual_table) = ALIGN (0x1); . =
> CYG_LABEL_DEFN(__reserved_virtual_table) + 0x100;
> SECTION_data (ram, ALIGN (0x10), FOLLOWING(.gcc_except_table))
> //SECTION_data (ram, ALIGN (0x10), AT(0x4200000))
> SECTION_sbss (ram, ALIGN (0x4), LMA_EQ_VMA)
> SECTION_bss (ram, ALIGN (0x10), LMA_EQ_VMA)
> CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
> SECTIONS_END
> }
>
>
> mlt_powerpc_mbx_rom.h:
>
> #ifndef __ASSEMBLER__
> #include <cyg/infra/cyg_type.h>
> #include <stddef.h>
>
> #endif
> #define CYGMEM_REGION_ram (0)
> #define CYGMEM_REGION_ram_SIZE (0x200000)
> #define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
> #define CYGMEM_REGION_rom (0x4000000)
> #define CYGMEM_REGION_rom_SIZE (0x400000)
> #define CYGMEM_REGION_rom_ATTR (CYGMEM_REGION_ATTR_R)
> #ifndef __ASSEMBLER__
> extern char CYG_LABEL_NAME (__reserved_vectors) [];
> #endif
> #define CYGMEM_SECTION_reserved_vectors (CYG_LABEL_NAME
> (__reserved_vectors))
> #define CYGMEM_SECTION_reserved_vectors_SIZE (0x3000)
> #ifndef __ASSEMBLER__
> extern char CYG_LABEL_NAME (__reserved_vsr_table) [];
> #endif
> #define CYGMEM_SECTION_reserved_vsr_table (CYG_LABEL_NAME
> (__reserved_vsr_table))
> #define CYGMEM_SECTION_reserved_vsr_table_SIZE (0x200)
> #ifndef __ASSEMBLER__
> extern char CYG_LABEL_NAME (__reserved_virtual_table) [];
> #endif
> #define CYGMEM_SECTION_reserved_virtual_table (CYG_LABEL_NAME
> (__reserved_virtual_table))
> #define CYGMEM_SECTION_reserved_virtual_table_SIZE (0x100)
> #ifndef __ASSEMBLER__
> extern char CYG_LABEL_NAME (__heap1) [];
> #endif
> #define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
> #define CYGMEM_SECTION_heap1_SIZE (0x400000 - (size_t) CYG_LABEL_NAME
> (__heap1))
>
> Well now, my problem is :
> when I read the nm output from my file generated (powerpc-eabi-nm) I can see
> (result 1 just under) the right symbol __rom_data_start at the end of the
> rom but when I transform it into S-Record file (Motorola standard file)
> before to flash it I can see (result 2 just under) that there is nothing
> after this adress; as if the data section was empty...
> If someone can help it would be great.
>
> Result 1:
>
> 04023498 V typeinfo name for std::bad_cast
> 040234a4 V typeinfo name for std::type_info
> 040234b4 W raise
> 04023570 A _etext
> 0402442c r hex.2
> 040258ac A __FIXUP_START__
> 04025a1c A __EXCEPT_END__
> 04025a1c A __EXCEPT_START__
> 04025a1c A __FIXUP_END__
> 04025a20 A __rom_data_start
>
> Result 2:
>
> S3190402598004023364040233680402336C040233700402337CC6
> S3190402599404023380040233840402338804023394040233981E
> S319040259A80402339C040233A0040233AC040233B0040233B476
> S319040259BC040233B8040233BC040233C0040233C4040233C8EE
> S319040259D0040233CC040233D0040233D4040233D8040233DC76
> S319040259E4040233E0040233E4040233E8040233EC040233F0FE
> S319040259F8040233F4040233F8040233FC040234000402340484
> S30D04025A0C040234080000000044 <-- the end
> of the rom
>
> nothing in data section
> S31900003300000000003B9ACA00000000640400AA040400AC044A <-- the
> beginning of the ram
> S319000033140400D0E40400D0EC0400AD900400AD980400B05C8D
> S319000033280400A9380400B08C0400B1A00400B2600400B398AC
> S3190000333C0400D0E40400D0EC0400B5440400B56C0400B5D450
What does "powerpc-eabi-objdump -h <FILE>.elf" show?
What does your command to create the S-record file look like?
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss