/mnt/c/cosmopolitan1 ¬ printf %s '
> main() {
> printf("hello world\n");
> }
> ' >hello.c
/mnt/c/cosmopolitan1 ¬ gcc -g -Os -static -fno-pie -no-pie -mno-red-zone -nostdlib -nostdinc \
> -fno-omit-frame-pointer -pg -mnop-mcount \
> -o hello.com.dbg hello.c -Wl,--gc-sections -fuse-ld=bfd \
> -Wl,-T,ape.lds -include cosmopolitan.h crt.o ape.o cosmopolitan.a
/usr/bin/ld.bfd: warning: .note.gnu.build-id section discarded, --build-id ignored
/mnt/c/cosmopolitan1 ¬ objcopy -S -O binary hello.com.dbg
hello.com/mnt/c/cosmopolitan1 ¬ ls
ape-no-modify-self.o ape.lds ape.o cosmopolitan.a cosmopolitan.h crt.o hello.c
hello.com hello.com.dbg
/mnt/c/cosmopolitan1 ¬ sh
hello.comhello.com: 8: cannot create : Directory nonexistent
/mnt/c/cosmopolitan1 ¬ ./
hello.com/mnt/c/cosmopolitan1 ¬ ./
hello.com/mnt/c/cosmopolitan1 ¬ sh
hello.comhello.com: 27: Syntax error: "(" unexpected
/mnt/c/cosmopolitan1 ¬ readelf -h
hello.comELF Header:
Magic: 7f 45 4c 46 02 01 01 09 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - FreeBSD
ABI Version: 0
Type: EXEC (Executable file)
Machine: Advanced Micro Devices X86-64
Version: 0x1
Entry point address: 0x40210b
Start of program headers: 2840 (bytes into file)
Start of section headers: 0 (bytes into file)
Flags: 0x0
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 4
Size of section headers: 0 (bytes)
Number of section headers: 0
Section header string table index: 0
/mnt/c/cosmopolitan1 ¬