MetallicPriest
MetallicPriest

Reputation: 30835

Structure of glibc?

Since glibc automatically gets linked when you compile your program with gcc, many people including me don't know about it very much. So my question is, what is glibc composed of. What are the object, shared object files related to glibc? In which directory are they placed. Secondly, by default, does gcc only used the shared object files of glibc or the objects files are needed too? Which of the shared objects of glibc are linked by gcc automatically?

Upvotes: 4

Views: 1153

Answers (2)

LeleDumbo
LeleDumbo

Reputation: 9340

So my question is, what is glibc composed of

GNU C Library Functionality

What are the object, shared object files related to glibc?

Did you mean which links to glibc? Or which glibc links to? The former is everything that uses C library functions provided by it (not necessarily gcc generated programs), while the latter is kernel libraries.

In which directory are they placed

AFAIK it depends on the distro, could be /usr/local/glibc, /usr/lib/glibc, etc.

Secondly, by default, does gcc only used the shared object files of glibc or the objects files are needed too?

Only glibc shared object, however there are some object files that contain startup code of all gcc generated programs that are automatically linked by gcc (when you tell it to link as well).

Upvotes: 0

Jesper
Jesper

Reputation: 206996

glibc is the GNU implementation of the standard C library, with extra functionality beyond the standard.

The manual tells you exactly what it consists of and how to use it.

Upvotes: 2

Related Questions