From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12204 invoked by alias); 21 Jul 2009 12:46:57 -0000 Received: (qmail 12195 invoked by uid 22791); 21 Jul 2009 12:46:57 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=BAYES_05 X-Spam-Check-By: sourceware.org Received: from relay01.alfahosting-server.de (HELO relay01.alfahosting-server.de) (80.86.191.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Jul 2009 12:46:48 +0000 Received: by relay01.alfahosting-server.de (Postfix, from userid 1001) id 4477720093E1E; Tue, 21 Jul 2009 14:46:44 +0200 (CEST) X-Spam-DCC: Misty: relay01.alfahosting-server.de 1170; Body=1 Fuz1=1 Fuz2=1 Received: from alfa3018.alfahosting-server.de (alfa3018.alfahosting-server.de [82.197.146.36]) by relay01.alfahosting-server.de (Postfix) with ESMTP id 978A020093DE4; Tue, 21 Jul 2009 14:46:41 +0200 (CEST) Received: from pc.martinlaabs.de (p5B0ED415.dip.t-dialin.net [91.14.212.21]) by alfa3018.alfahosting-server.de (Postfix) with ESMTP id 54C70515EDE7; Tue, 21 Jul 2009 14:46:41 +0200 (CEST) Message-ID: <4A65B8AE.8090204@martinlaabs.de> Date: Tue, 21 Jul 2009 12:46:00 -0000 From: Martin Laabs User-Agent: Thunderbird 2.0.0.19 (X11/20090226) MIME-Version: 1.0 To: ganesh kr , eCos Discuss References: <73f9997f0907192203h77494e62u58b44ccfc7a738f4@mail.gmail.com> In-Reply-To: <73f9997f0907192203h77494e62u58b44ccfc7a738f4@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checker-Version: clamassassin 1.2.4 with ClamAV 0.94.2/9593/Tue Jul 21 05:39:24 2009 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] dividing the elf object file file in to two binary files X-SW-Source: 2009-07/txt/msg00189.txt.bz2 Hi, ganesh kr wrote: > Hi, > > I am using ecos with lwip. I have two flash memory chips of 128 KB > each at addr 0x04000000 and 0x08000000. the binary file is 140KB. I > want to have two binary files from the elf object file so that i can > load one binary file in to each flash. Also I have two libraries > libapp.a and libtarget.a. please let me know how can i do this. You have to change the linker script to get two sections for .text. However - you have to give every section an unique name. To assign functions/files to each section you can use the linker script as well as the __attribute__ ((section ("
"))) attribute before any function or variable. At the end you get one elf file with different section that can be separated by objcopy/objdump. Here a short example from an old project: #define INSRAM_DATA __attribute__ ((section (".sram_data"))) #define INSRAM_TEXT __attribute__ ((section (".sram_text"))) cyg_uint32 rawData[20][64] INSRAM_DATA; //[Channel][TimeSlot] void INSRAM_TEXT reader(cyg_addrword_t data) { ... } Greetings, Martin Laabs PS: If you call function in one segment out of the other segment you have to use far jumps like that: void (*diag_printf_p)( const char *fmt, ... ) = &diag_printf; and then call diag_printf_p("calculating: %d %d %d\n", i, j, tap); instead of diag_printf(....) -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss