This code demonstrates how to build an executable using GCC without reliance on the C standard library.
  • C 93%
  • Shell 7%
Find a file
2026-07-24 11:04:48 +10:00
.gitignore Initial commit 2026-07-24 11:04:48 +10:00
build.sh Initial commit 2026-07-24 11:04:48 +10:00
main.c Initial commit 2026-07-24 11:04:48 +10:00
ReadMe.md Initial commit 2026-07-24 11:04:48 +10:00
UNLICENSE Initial commit 2026-07-24 11:04:48 +10:00

C Code Example without Standard Library

This code demonstrates how to build an executable using GCC without reliance on the C standard library.

It targets Linux x64.

Build

To build:

./build.sh

Run

To run the compiled executable:

./nostdlib Pete

This will print: Hello Pete

References

For info on calling conventions, clobbered registers, etc, refer to the System V Application Binary Interface specification.