Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Link to rom code

6 views
Skip to first unread message

Fabrice

unread,
Nov 12, 2009, 5:59:39 PM11/12/09
to
Hi,

I'm trying to link a program to some rom code. I have an elf file of
the rom code (rom.elf) which if fully relocated.
I use a linker script similar to this to link my application with the
rom code:

SECTIONS
{
.rommed 0xa00e0000 :
{
rom.elf
}

.text 0xa0000000 :
{
_ftext = . ;
*(.text)
. = ALIGN(4);
etext = . ;
}

.data:
{
_fdata = . ;
*(.data)
}
}


From the link process, I get an elf file app.elf, from which I create
a binary using the .text and .data section, but not the .rom section.

Now, this works fine, but one of my issue with that solution is that
my app.elf file include the whole rom code. Technically i guess i
should only need the symbols not the actual code itself.
The other issue is that i need to repeat the base address of the rom
code in my app linker script, but that information should already be
present in the rom.elf file.

Those are minor issues, but i'd like to solve them for various
reasons.

So i guess what I'm looking for is:

1) Is there a way to transform an elf file so that it only contains
the symbol information but not the actual code? i guess its similar
to .bss section which not does contain data but only symbols
information.

2) Is there a way to extract the start address of a section from an
input .elf file and use is as the start address of output section in
my linker script.

Thanks

0 new messages