public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] .bss and RedBoot problem
       [not found] <71e353740706230428y76d2f69fia8c61b53b6d8276e@mail.gmail.com>
@ 2007-06-24 13:38 ` Kai Niu
  2007-06-24 23:58   ` Gary Thomas
  0 siblings, 1 reply; 2+ messages in thread
From: Kai Niu @ 2007-06-24 13:38 UTC (permalink / raw)
  To: ecos-discuss

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

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] .bss and RedBoot problem
  2007-06-24 13:38 ` [ECOS] .bss and RedBoot problem Kai Niu
@ 2007-06-24 23:58   ` Gary Thomas
  0 siblings, 0 replies; 2+ messages in thread
From: Gary Thomas @ 2007-06-24 23:58 UTC (permalink / raw)
  To: Kai Niu; +Cc: ecos-discuss

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kai Niu wrote:
> 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:

Don't use a RedBoot configuration to build user programs.

Start with a fresh directory, then configure eCos as necessary
and build your application there.  There is a lot of information
about this in the Getting Started Guide (see online documentation)
or look at my examples http://www.mlbassoc.com/examples

- --
- ------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
- ------------------------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFGfUkjmaKbSsQGV8ARAqJyAJ9QKIix86MQPwvCLizqXrR0nL8ZkgCeKa7g
hLm9wIVDW5knubovASEnf18=
=eAU9
-----END PGP SIGNATURE-----

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-06-23 16:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <71e353740706230428y76d2f69fia8c61b53b6d8276e@mail.gmail.com>
2007-06-24 13:38 ` [ECOS] .bss and RedBoot problem Kai Niu
2007-06-24 23:58   ` Gary Thomas

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).