newlib linker script summary for you own executable

After i build my newlib by “../newlib-2.1.0/configure –target=$TARGET –prefix=$PREFIX”, except the libc.a and crt0.o, i got these linker scripts. I am still thinking which one i should use for my own executables in my OS.

elf_i386.x Default linker script, for normal executables
elf_i386.xbn Script for -N: mix text and data on same page; don’t align data
elf_i386.xc Script for -z combreloc: combine and sort reloc sections
elf_i386.xd Script for ld -pie: link position independent executable
elf_i386.xdc Script for -pie -z combreloc: position independent executable, combine & sort relocs
elf_i386.xdw Script for -pie -z combreloc -z now -z relro: position independent executable, combine & sort relocs
elf_i386.xn Script for -n: mix text and data on same page
elf_i386.xr Script for ld -r: link without relocation
elf_i386.xs Script for ld –shared: link shared library
elf_i386.xsc Script for –shared -z combreloc: shared library, combine & sort relocs
elf_i386.xsw Script for –shared -z combreloc -z now -z relro: shared library, combine & sort relocs
elf_i386.xu Script for ld -Ur: link w/out relocation, do create constructors
elf_i386.xw Script for -z combreloc -z now -z relro: combine and sort reloc sections

 

Leave a Reply

Your email address will not be published. Required fields are marked *