Re: pam_debug.o: gp-relative relocation against dynamic symbol _pam_token_returns

From: Thorsten Kranzkowski
Date: Wed Dec 17 2003 - 13:56:32 EST


On Tue, Dec 16, 2003 at 10:50:13PM -0600, Will L G wrote:
> 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


--
| Thorsten Kranzkowski Internet: dl8bcu@xxxxxxxxx |
| Mobile: ++49 170 1876134 Snail: Kiebitzstr. 14, 49324 Melle, Germany |
| Ampr: dl8bcu@db0lj.#rpl.deu.eu, dl8bcu@xxxxxxxxxxxxxxxxxxxxxx [44.130.8.19] |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/