From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26699 invoked by alias); 23 Jun 2007 11:28:20 -0000 Received: (qmail 26691 invoked by uid 22791); 23 Jun 2007 11:28:19 -0000 X-Spam-Status: No, hits=-0.1 required=5.0 tests=BAYES_20,DK_POLICY_SIGNSOME,DK_SIGNED,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from ik-out-1112.google.com (HELO ik-out-1112.google.com) (66.249.90.182) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 23 Jun 2007 11:28:15 +0000 Received: by ik-out-1112.google.com with SMTP id c28so876108ika for ; Sat, 23 Jun 2007 04:28:12 -0700 (PDT) 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= Received: by 10.64.28.3 with SMTP id b3mr461702qbb.1182598091894; Sat, 23 Jun 2007 04:28:11 -0700 (PDT) Received: by 10.65.241.15 with HTTP; Sat, 23 Jun 2007 04:28:11 -0700 (PDT) Message-ID: <71e353740706230428y76d2f69fia8c61b53b6d8276e@mail.gmail.com> Date: Sat, 23 Jun 2007 11:28:00 -0000 From: "Kai Niu" To: ecos-devel@ecos.sourceware.org Subject: .bss and RedBoot problem MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-IsSubscribed: yes Mailing-List: contact ecos-devel-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-devel-owner@ecos.sourceware.org X-SW-Source: 2007-06/txt/msg00008.txt.bz2 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 #include 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__ = (.) 0x0005f17c __DTOR_LIST__ = (.) *(SORT(.dtors*)) 0x0005f17c __DTOR_END__ = (.) *(.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 = (.) *(.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