Search notes:

gcc -fpic / -fPIC

With the -fpic or -fPIC flag, gcc creates an object file with position independent code. This is usually necessary when creating a shared object.
Apparently, on a x86 environment, -fpic and -fPIC are equivalent. On other architectures, there is a difference.

Preprocessor macros

When compiling with -fpic, the compiler defines the macro __pic__ and __PIC__ to 1. When copmiling with -fPIC, these macros are defined to 2.

TODO

GOT, the global offset table.

See also

gcc -shared

Index