pam_debug.o: gp-relative relocation against dynamic symbol _pam_token_returns
When ever I attempt to compile Linux-Pam, I receive the following error immediately after running 'make':
/usr/bin/ld: dynamic/pam_debug.o: gp-relative relocation against dynamic symbol _pam_token_returns/usr/bin/ld: dynamic/pam_debug.o: gp-relative relocation against dynamic symbol _pam_token_returns
collect2: ld returned 1 exit status
make[2]: *** [pam_debug.so] Error 1
make[1]: *** [all] Error 1
make: *** [modules] Error 2
I've included the pertinent information supplied at
(http://www.kernel.org/pub/linux/docs/lkml/reporting-bugs.html), the actual error msg generated and system information. One other thing, I've tried different versions of "Binutils" but the error persists. I've even tried different versions of GCC but unfortunately GCC 2.96 was considered 'unacceptable' by the config script. Thank you, Will L G
Quoted 5 lines · Will L G
When ever I attempt to compile Linux-Pam, I receive the following error immediately after running 'make':
/usr/bin/ld:dynamic/pam_debug.o: gp-relative relocation against dynamic symbol_pam_token_returns
Always use '-fpic' in CFLAGS when compiling for shared objects (.so) Otherwise (as in your case) the compiler is allowed to emit machine code that may not work in shared objects.
When I was hit by this error, the offending library was istself linked to another, static library. This isn't allowed either. IIRC my fix was compiling that .a library with -fpic :)
Thorsten
Signature · 3 lines
| Thorsten Kranzkowski Internet: [email protected] | | Mobile: ++49 170 1876134 Snail: Kiebitzstr. 14, 49324 Melle, Germany | | Ampr: dl8bcu@db0lj.#rpl.deu.eu, [email protected] [44.130.8.19] |