2

i am trying to build a custom version of the linux kernel 3.8 and i want my linker to behave a bit different so i changed its ldscripts. Specifically I configure binutils -> make -> change ldscripts -> make install. However when i try to compile libc using my linker the only thing i see is this :

GNU ld (GNU Binutils) 2.23
  Supported emulations:
   elf32_sparc
   sparclinux
   elf64_sparc
   sun4
using internal linker script:
==================================================
/* Script for --shared -z combreloc: shared library, combine & sort relocs */

etc

The thing is that i have changed my ldscripts and prepended a tag at the beginning of each script in order to recognize them but my compiler does not seem to care. However i don't have any other elf scripts in my system so the option of searching the wrong library path is not actually an option.

Is there something i am missing here?

Notice that i am cross compiling for sparc

2 Answers 2

1

You can pass a custom linker script to ld:

ld -T <path/to/file> ...

or to gcc:

gcc -Wl,-T,<path/tofile> ...
0

Default ld scripts get compiled into compiler driver (gcc) so you should at least rebuild the toolchain.

That's also probably the case that gcc will not look at any linker scripts other than built into it, so you'll have to modify them in toolchain (it's probably in spec files somewhere).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.