This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: relocation error: R_AMD64_PC32
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: asyropoulos at aol dot com
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 11 Mar 2011 18:22:06 +0000
- Subject: Re: relocation error: R_AMD64_PC32
- References: <8CDAE25CA480984-1E38-38B61@webmail-d009.sysops.aol.com>
On 11 March 2011 17:06, asyropoulos wrote:
>
> Well not really! ?The problem was that at a certain point during
> the configuration stage, the Configure script asks the following
> question:
>
> Any special flags to pass to x86_64-pc-solaris2.11-gcc to
> create a dynamically loaded library? [ -G -m64 -fstack-protector]
Notice that this is passing options to gcc, not ld
> And quite naturally (!) one presses enter because Solaris users
> know that the Solaris linker accepts the -G option. But for starnge
> reason this does not work. One has to enter the following:
>
> -shared -m64 -fstack-protector
>
> Now what is even more curious is that the man page of Solaris ld
> says among others the following:
>
> ? ? -G
> ? ? -shared
>
> ? ? ? ? In dynamic mode only, produces a ?shared ?object. ?Unde-
> ? ? ? ? fined ? symbols ?are ?allowed. ?See ?Chapter ?4, ?Shared
> ? ? ? ? Objects, in Linker and Libraries Guide.
But that's the ld man page, not the gcc man page.
> In different words, both -G and -shared are supposed to do the
For the linker, not for GCC.
> same thing but apparently they don't. Maybe, -shared forces GCC
> to some things, while the -G thing is passed directly to the linker
> without touching anything else.
GCC won't pass options through to the linker, and -G means something
else to GCC, it probably isn't passed to the linker at all.
If you use -shared (which is a valid GCC option) it will pass that
option through to ld.