Skip to content

Instantly share code, notes, and snippets.

@infosec-intern
Last active January 26, 2017 12:24
Show Gist options
  • Save infosec-intern/8e07f0688714cfddeb5077a667f969ee to your computer and use it in GitHub Desktop.
Save infosec-intern/8e07f0688714cfddeb5077a667f969ee to your computer and use it in GitHub Desktop.
Compile a C program without using the standard entry method. For example, if you supply your own _start function
gcc -nostdlib -o test test.c # don't use the standard library when compiling (enables using _start() directly)
gcc -m32 -o test test.c # compile a 32-bit executable
gcc -m64 -o test test.c # compile a 64-bit executable
gcc -c -o obj1.o obj1.c # create an object file, but do not link the result(s) into an executable
# Can be combined with -m{32,64}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment