bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: objcopy assertion failed in translating from ecoff to elf or vice v


From: Nick Clifton
Subject: Re: objcopy assertion failed in translating from ecoff to elf or vice versa
Date: 07 Feb 2003 13:12:30 +0000
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.1

Hi Aaron,

> I have some object files that need to be translated from ecoff-bigmips
> linker format to elf32-bigmips.  When I try to do this, I get a BFD
> assertion fail and a segfault.  Here is the complete output:
> 
>      /home/aa/obj/zlib> objcopy -I ecoff-bigmips -O elf32-bigmips zutil.o
>      BFD: BFD 2.13 assertion fail ../../binutils-2.13/bfd/elf.c:5395
>      Segmentation fault (core dumped)

Please try applying the attached patch.  It will change the seg fault
into an intelligible error message:

  BFD: Unable to find equivalent output section for symbol
   'gcc2_compiled.' which is supposed to be in section '*DEBUG*' 
  binutils/objcopy: /home/nickc/st0aiVjO: Invalid operation

Unfortunately it does not address the actual problem of what to do
about symbols in the *DEBUG* section.  Maybe you could strip them out
before trying to use objcopy ?

Cheers
        Nick

2003-02-07  Nick Clifton  <address@hidden>

        * elf.c (swap_out_syms): Generate an error message if an
        equivalent output section cannot be found for a symbol.

Index: bfd/elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.177
diff -c -3 -p -w -r1.177 elf.c
*** bfd/elf.c   4 Feb 2003 12:49:57 -0000       1.177
--- bfd/elf.c   7 Feb 2003 13:08:16 -0000
*************** swap_out_syms (abfd, sttp, relocatable_p
*** 5426,5432 ****
                     section of a symbol to be a section that is
                     actually in the output file.  */
                  sec2 = bfd_get_section_by_name (abfd, sec->name);
!                 BFD_ASSERT (sec2 != 0);
                  shndx = _bfd_elf_section_from_bfd_section (abfd, sec2);
                  BFD_ASSERT (shndx != -1);
                }
--- 5427,5442 ----
                     section of a symbol to be a section that is
                     actually in the output file.  */
                  sec2 = bfd_get_section_by_name (abfd, sec->name);
!                 if (sec2 == NULL)
!                   {
!                     _bfd_error_handler (_("\
! Unable to find equivalent output section for symbol '%s' from section '%s'"),
!                                         syms[idx]->name ? syms[idx]->name : 
"<Local sym>",
!                                         sec->name);
!                     bfd_set_error (bfd_error_invalid_operation);      
!                     return FALSE;
!                   }
!   
                  shndx = _bfd_elf_section_from_bfd_section (abfd, sec2);
                  BFD_ASSERT (shndx != -1);
                }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]