This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ld: can not edit toc Invalid operation
- From: Olaf Hering <olh at suse dot de>
- To: binutils at sources dot redhat dot com
- Date: Sun, 13 Feb 2005 13:44:46 +0100
- Subject: Re: ld: can not edit toc Invalid operation
- References: <20050212225221.GA11623@suse.de> <20050213072708.GG22790@bubble.modra.org> <20050213085821.GB21230@suse.de> <20050213123550.GH22790@bubble.modra.org>
On Sun, Feb 13, Alan Modra wrote:
> On Sun, Feb 13, 2005 at 09:58:21AM +0100, Olaf Hering wrote:
> > On Sun, Feb 13, Alan Modra wrote:
> > > > /home/abuild/binhead/bin/ld: can not edit toc Invalid operation
> > >
> > > This is the real error. The segfault is a consequence of
> > > ppc64elf.em:ppc_before_allocation not calling the elf32.em
> > > before_allocation function. I guess I should make this a fatal
> > > error..
> > >
> > > Can you find out why ppc64_elf_edit_toc is returning FALSE?
> >
> > _bfd_elf_link_read_relocs() returns NULL, line 7018
>
> Silly me. It's quite possible to have a toc section that has no
> relocs.
>
> * elf64-ppc.c (ppc64_elf_edit_toc): Skip toc if size is zero.
> Skip toc reloc adjust if reloc_count is zero.
>
> This tidies up the error situation. I chose to leave most of the errors
> non-fatal, which means we need to continue on with normal processing in
> these functions rather than just returning.
>
> * emultempl/ppc64elf.em (ppc_create_output_section_statements): Make
> an error creating fake bfd fatal.
> (ppc_before_allocation): Continue on after errors.
> (gld${EMULATION_NAME}_finish): Likewise.
That patch fixed it, thanks.