Re: How to create a ROM library using GNU gcc and ld?



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
.



Relevant Pages

  • Re: How to create a ROM library using GNU gcc and ld?
    ... ld -r with your object files and libraries to generate another .o ... ROM area. ... compilation and linking will be done in ... First use gcc to convert .c file into .o file, then call ld manually to do partial link. ...
    (comp.arch.embedded)
  • Re: Microchip Introduces First 16-bit Microcontroller Product Line - the PIC24
    ... >>> You're going to recompile all the libraries with every job?!? ... >>> You find some calls to strcpythat reference ROM for the ... >>> second argument and some that reference RAM. ... I agree and therefore standard library functions will not suffice. ...
    (comp.arch.embedded)
  • Re: How to create a ROM library using GNU gcc and ld?
    ... ld -r with your object files and libraries to generate another .o ... ROM area. ... steps - first compile the ROM library functions generating an a.aux ...
    (comp.arch.embedded)
  • Re: pgm object/source comparison
    ... There may be plenty of reasons why compilation fails, ... ILE, like default activation groups, objects ... I moved the libraries, files and ... >>> seems fairly obvious that the source code in those two don't match ...
    (comp.sys.ibm.as400.misc)
  • Re: vc++ mfc project build is extremely slow taking hours
    ... How sophisticated are the "third party" libraries. ... in slower compilation, but not an hour. ... How fast is your network and file server? ... I am using precompiled headers and the environment variables point to ...
    (microsoft.public.vc.mfc)