gcc and -fPIC

Alan Modra amodra@bigpond.net.au
Wed Oct 20 01:14:00 GMT 2004


On Tue, Oct 19, 2004 at 03:40:05PM +0200, Andreas Schwab wrote:
> Alan Modra <amodra@bigpond.net.au> writes:
> 
> > On Mon, Oct 18, 2004 at 10:11:50PM +0200, Andreas Schwab wrote:
> >> -      addr = bed->plt_sym_val (i, plt, p);
> >> +      addr = bed->plt_sym_val (abfd, i, plt, p);
> >
> > There's no need to pass abfd here.  You can use plt->owner in your
> > target function.
> 
> Hmm, I tried that first and got a segfault, but I can't reproduce that any
> more.

The only sections that can't use "owner" to access their bfd are
bfd_{abs,und,com,ind}_section.  (Which is a bfd design bug IMO.  See the
comment in struct bfd_symbol.)

> 2004-10-19  Andreas Schwab  <schwab@suse.de>
> 
> 	* elf32-m68k.c (elf_m68k_plt_sym_val): New fuction.
> 	(elf_backend_plt_sym_val): Define.

OK, thanks.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list