0

I want the GCC to exclude the startup code it link automatically with building process

what should i do?

So that i have my Own Startup assembly code defining labels (_start, _exit,..etc)

iwahdan
  • 429
  • 1
  • 5
  • 14

1 Answers1

1

GCC provides the -nostartfiles, -nodefaultlibs and -nostdlib options. See documentation.

Alternatively, you can call linker (ld) directly: it doesn't add anything by default, all objects (including the linker script) has to be specified manually. For an example of the ld invocation, run gcc with -v option: it would print full command lines of all other tools (including linker) it invokes.

Dummy00001
  • 16,630
  • 5
  • 41
  • 63