https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83074
--- Comment #3 from Stefan Vargyas <stvar at yahoo dot com> --- > > Why do you expect you can use a PIE as a shared library? > Well, with `-pie' one can issue 'foo.so' by itself: $ ./foo.so foo.so: version 0.1 This feature is quite useful in practice -- for example, the GNU C library is runnable this way too: $ /lib64/libc.so.6 GNU C Library stable release version 2.11.3 (20110527), by Roland McGrath et al. ... On the other hand, I deem the above use-case to be not that useful whilest developing a library -- when one may use e.g. `--coverage'. Therefore, I myself have no problem with my (real) Makefile discriminating 'LDFLAGS' as below: ifeq (${COVERAGE},yes) CFLAGS += --coverage LDFLAGS += --coverage -shared else LDFLAGS += -pie endif