
I'm not sure why, it just seems to be how ld works. The -nostdlib flag will cause any library found in this path to be effectively ignored. This will add a path to your library search directory. For kernels, it is usually the file that contains your assembly boilerplate that initiates the stack and in some cases GDT and such and then calls your kmain(). For userland programs, this is usually crt0.o or crtbegin.o. It is which file you want to be linked to the very beginning of the executable. Some commonly used formats are detailed below:ģ2-bit ELF format for the i386 architecture.Ħ4-bit ELF format for the x86-64 architecture.ģ2-bit PE format for the i386 architecture. To find out what output formats are supported by your system binutils and GCC, the objdump -i command may be used.

It specifies the output format of the executable.

The OUTPUT_FORMAT directive takes a single argument. The code pointed to by the symbol name provided will be the first byte of the. This keyword accepts the symbol name for the entry point of the linked program/kernel as a single argument. The ENTRY keyword is used for defining the entry point of an application, that being specifically the first executable instruction in the output file. Listed below are a selection of significant keywords used within linker scripts.
