This is the mail archive of the
ecos-devel@sourceware.org
mailing list for the eCos project.
.bss and RedBoot problem
- From: "Kai Niu" <cnvampire at gmail dot com>
- To: ecos-devel at ecos dot sourceware dot org
- Date: Sat, 23 Jun 2007 07:28:11 -0400
- Subject: .bss and RedBoot problem
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=KVslJ4fmH5z4tV2131Fz2uSM3z7DRgqFDxhZ0uky0aUzLww94YTCetkQqdf7N16Xdu8/iVUPd/21AIWY9E0CIBNpkAF5bR/t39xLEHZFRbHFVu1QX0DLPm6teXs9IuPOOrvssln0zS5oVyTHCZexPtzlyvdO6xjd1luNbpav9f4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=EZfJ3a+KycTcf5rsKjWTw7GxfUiEnru0FDmMG5cAyFhgppNSy8BgXUbp080av1cg95bJFyY/ttO8M/T6ZcKNNxioM26f7SHjnsNRM3pdBPKcdTkKU6eWOsGuIbVVdKsQWwSOHB51fP5OEBWaMrd7VAakwQmt+/z3xmuy9rCdhpE=
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