This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ld and R_386_GOTOFF relocs
- From: "H. J. Lu" <hjl at lucon dot org>
- To: "Peter S. Mazinger" <ps dot m at gmx dot net>
- Cc: binutils at sourceware dot org, gcc at gcc dot gnu dot org
- Date: Wed, 11 May 2005 16:00:52 -0700
- Subject: Re: ld and R_386_GOTOFF relocs
- References: <Pine.LNX.4.44.0505120041300.7147-100000@lnx.bridge.intra>
On Thu, May 12, 2005 at 12:48:46AM +0200, Peter S. Mazinger wrote:
> Hello!
>
> I have gotten under peculiar circumstances following:
> (sysvinit) init.o: relocation R_386_GOTOFF against protected function
> `main' can not be used when making a shared object
>
> libc.so does not provide a weak 'main', main() is in crt1.o defined in asm
> as '.protected main'.
>
> init is built as -pie executable.
>
> I think this check is valid if a shared lib is created, but not valid for
> a PIE executable.
>
> I think, that a check info->shared should be changed to
> info->shared && !info->pie (or !info->executable), to allow pie to be
> linked, but I can't locate the one needed for this.
>
> Thanks, Peter
This is a gcc bug
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19520
H.J.