Re: Using GCC to produce small executables (OSX)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> If I try and pass the entry point to LD, I get:
> gcc tiny.c -c -nostdlib -m32
> ld tiny.o -e main
> ld: could not find entry point "main" (perhaps missing crt1.o) for
> inferred architecture i386

On my machine, that would work just fine - maybe gcc mangles function
names slightly on OSX, like prefixing with an '_'? Try running nm on
tiny.o and you'll see all its symbols - from your source, you should
only see one, the symbol marking the start of main(). Use the name of
that symbol as the -e argument to ld.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux