Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

Custom Linker Script

Dear all,

I have to add an output section in the final binary called "EXTSec". Therefore, I modified the makefile to point to a linkerscript.lds. Then I copied the original likerscript.x contents, which is located in ./bsp folder, and pasted it into my linkerscript.lds. After that, I added the following output section

.EXTsec :

{

./obj/CRT1.o

} > SDRAM

As a result, I got the following error

./obj/CRT1.o: In function `Task_CRT1':

multiple definition of `Task_CRT1'

obj/CRT1.o CRT1.c:19: first defined here

collect2: ld returned 1 exit status

make: ***[App.elf] Error 1

I need to put all input sections in that object file at the same output section contiguously.

12 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I'd check the symbol tables of the vmm.o and utils.o - I think you'll find that they both have definitions for the symbols (possibly where they are used).

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    You have to make sure that the linker will not read the content of the same object file twice. For example, you cannot direct the linker through the linker script to put some content of an object file in certain addresses while that object file is part of a library that is passed to the linker.

    --- Quote End ---

    Can you please inform me how to do this? Using eclipse here and I'm at my witts end with it!! Same error and feel like I've tried everything! Thanks