Re: How to create a ROM library using GNU gcc and ld?
- From: wyse03br@xxxxxxxxxxxx
- Date: Mon, 31 Mar 2008 11:11:18 -0700 (PDT)
Hi,
On Mar 31, 2:59 am, Arlet <usene...@xxxxxxxxxx> wrote:
You could use partial linking.
Use: ld -r with your object files and libraries to generate another .o
file.
Name this .o file explicitly in your linker script to put it in the
ROM area.
If I understood correctly, compilation and linking will be done in
2 steps - first compile the ROM library functions generating an a.aux
intermediary file and second link it when compilling the non ROM
library functions (main(), for instance):
% ppc-elf-gcc -g lib.c -lm -Wl,-T lib.lnk -Wl,-r -o a.aux -DROM #-
DROM selects the ROM-based routines
% ppc-elf-gcc lib.c -Wl,-T lib_aux.lnk a.aux -o a.out
This strategy doesn't work so well, because some symbols are
introduced twice (apparently by CRT0):
/lib/gcc-lib/ppc-elf/3.3.2/crtsavres.o(.text+0x1cc): In function
`_restgpr_31_x':
: multiple definition of `_restgpr_31_x'
a.aux(.text+0x1578): first defined here
collect2: ld returned 1 exit status
Have I misundestood something? Any workaround?
Tks
.
- Follow-Ups:
- Re: How to create a ROM library using GNU gcc and ld?
- From: Arlet Ottens
- Re: How to create a ROM library using GNU gcc and ld?
- References:
- How to create a ROM library using GNU gcc and ld?
- From: wyse03br
- Re: How to create a ROM library using GNU gcc and ld?
- From: Arlet
- How to create a ROM library using GNU gcc and ld?
- Prev by Date: Re: Cost of a microcontroller - is it very important?
- Next by Date: Re: How to create a ROM library using GNU gcc and ld?
- Previous by thread: Re: How to create a ROM library using GNU gcc and ld?
- Next by thread: Re: How to create a ROM library using GNU gcc and ld?
- Index(es):
Relevant Pages
|