The static linking with -fPIC is broken now

Alan Modra amodra@bigpond.net.au
Wed Jun 20 01:52:00 GMT 2001


On Wed, Jun 20, 2001 at 01:16:52AM -0700, H . J . Lu wrote:
> 
> What happens if h->got.refcount > 0 and s->_raw_size == 0? When it does

See elflink.c:_bfd_elf_create_got_section.  The .got starts off with
space allocated for the reserved entries.

> h->got.offset = s->_raw_size;
> 
> it sets
> 
> h->got.refcount = 0;

so this shouldn't be happening.  In any case, got.offset == 0 is an
OK value, at least for targets that don't reserve .got space.

> It happens on the bad relocation in anaconda. As the result, I got
> a global data symbol instead of a pointer to a static function.

Is the relocation sym local or global?  Any special visibility, or
other unusual flags?  I need some clues if I'm to help.

Alan



More information about the Binutils mailing list