public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
* .bss and RedBoot problem
@ 2007-06-23 11:28 Kai Niu
  0 siblings, 0 replies; only message in thread
From: Kai Niu @ 2007-06-23 11:28 UTC (permalink / raw)
  To: ecos-devel

Hi all:
    I recently start working on eCos. here is some problem I have
after 2 week's study of eCos. I am working on platform TS7200
(www.embeddedarm.com), this platform prebuild eCos redboot.
I have already compiled the libtarget.a with "rom start-up" option.
when I am trying compile a very simple C program with this static
library. ld complains about .bss is not in the region of ram.
here is my mlt_arm_arm9_ts7200_ram.ldi dump:


#include <pkgconf/hal_arm_arm9_ts7200.h>
#include <cyg/infra/cyg_type.inc>

MEMORY
{
    ram : ORIGIN = 0x00044F88, LENGTH = 0x01F98078
}
SECTIONS
{
    SECTIONS_BEGIN
    SECTION_fixed_vectors (ram, 0x44F88, LMA_EQ_VMA)
    SECTION_rom_vectors (ram, 0x50000, 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)
    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);
    SECTIONS_END
}

Redboot prompt:
RAM: 0x00000000-0x02000000, [0x00044f88-0x01fdd000] available
FLASH: 0x60000000 - 0x60800000, 64 blocks of 0x00020000 bytes each.

Here is the section dump of linkage map file:
  .ctors.55435   0x0005f178        0x4
/home/neo/ecos-redboot/ecos/ts7200_install/lib/libtarget.a(infra_diag.o)
                0x0005f17c                __CTOR_END__ = <code 336> (.)
                0x0005f17c                __DTOR_LIST__ = <code 336> (.)
  *(SORT(.dtors*))
                0x0005f17c                __DTOR_END__ = <code 336> (.)
 *(.dynamic)
  *(.sdata*)
 *(.gnu.linkonce.s.*)
                0x0005f17c                . = ALIGN (0x4)
 *(.2ram.*)

.got            0x00009780        0x4
  .got           0x00009780        0x4
/usr/local/opt/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2/lib/gcc-lib/arm-linux/3.3.4/libgcc.a(_udivdi3.oS)

.got.plt        0x00009784        0xc
  .got.plt       0x00009784        0xc
/usr/local/opt/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2/lib/gcc-lib/arm-linux/3.3.4/libgcc.a(_udivdi3.oS)
                0x00009784                _GLOBAL_OFFSET_TABLE_
                0x0005ec40                __rom_data_start = LOADADDR (.data)
                0x00009790                __ram_data_end = .
                0x00009790                PROVIDE (__ram_data_end, .)
                0x00009790                _edata = .
                0x00009790                PROVIDE (edata, .)
                0x0005f17c                PROVIDE (__rom_data_end,
(LOADADDR (.data) + SIZEOF (.data)))

.bss            0x00009790     0x430c
                0x00009790                __bss_start = <code 336> (.)
  *(.scommon)
  *(.dynsbss)
  *(.sbss*)

Why the .bss did not follow the 0x50000 base address i specified? it
looked like .bss section follow the address of got.plt section. To
bypass this problem, I pass the Tbss=60000 option to ld. After all
this, I have executable file ready, I use redboot to load ELF file to
TS7200 by serial port(ymodem).  When I issue Go cmd on redboot prompt,
my system freeze. I tried either s-record and elf format. so the
question is
Dose redboot capable run ELF executable?
Dose redboot capable run s-record executable?
Do I need make sure that ram load base address must be the same as the
ELF program entry address?

PS. some question may off-topic, or even stupid. thank you all for
your patient and suggestion


                                                             NK

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-06-23 11:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-23 11:28 .bss and RedBoot problem Kai Niu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).