From: ganesh kr <krganesh01@gmail.com>
To: eCos Discuss <ecos-discuss@ecos.sourceware.org>
Subject: Re: [ECOS] dividing the elf object file file in to two binary files
Date: Wed, 22 Jul 2009 04:53:00 -0000 [thread overview]
Message-ID: <73f9997f0907212153i743cfc7as86d2a1205c5dc7ab@mail.gmail.com> (raw)
In-Reply-To: <4A65B8AE.8090204@martinlaabs.de>
Thanks for the response Martin. Since I am new to ecos and GNU tools,
can any one please provide the reference linker script file to do the
same
On Tue, Jul 21, 2009 at 6:16 PM, Martin Laabs<info@martinlaabs.de> wrote:
> 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 ("<section name>"))) 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
next prev parent reply other threads:[~2009-07-22 4:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-20 5:03 ganesh kr
2009-07-21 12:46 ` Martin Laabs
2009-07-22 4:53 ` ganesh kr [this message]
2009-07-22 11:22 ` ganesh kr
2009-07-22 11:25 ` Simon Kallweit
[not found] ` <73f9997f0907222350y49e0773dr926c16b42518839c@mail.gmail.com>
2009-07-23 7:13 ` Simon Kallweit
[not found] ` <73f9997f0907282209l65073597m356c05a397bd3203@mail.gmail.com>
2009-07-29 6:18 ` Simon Kallweit
2009-08-05 13:07 ` [ECOS] " ganesh kr
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=73f9997f0907212153i743cfc7as86d2a1205c5dc7ab@mail.gmail.com \
--to=krganesh01@gmail.com \
--cc=ecos-discuss@ecos.sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).