Re: How gcc links a C program with standard libraries?

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

 



On 14 December 2010 08:12, ali hagigat wrote:
> When using standard library functions, we use some include files which
> will add some extern function prototypes. But does gcc add the object
> files of those functions automatically to linker?

Yes, the standard C library is linked to by default.

> For a regular C program in free-standing mode we have to mention the
> names of the all the libraries we want to link, but how gcc can add
> those standard libraries(corresponding to the functions used) without
> forcing us to specify them for linker?

Because they're standard, so they're always linked to.

Use -nostdlib to override that behaviour.


[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