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

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

Re: Latest BFD snapshot doesn't fix problem


From: Alan Modra
Subject: Re: Latest BFD snapshot doesn't fix problem
Date: Mon, 15 Oct 2001 22:28:48 +0930
User-agent: Mutt/1.3.17i

On Thu, Oct 11, 2001 at 05:12:59PM +0000, address@hidden wrote:
> 
> /usr/i486-suse-linux/bin/ld: BFD internal error, aborting at elf32-i386.c
> line 1871 in elf_i386_relocate_section

I'm about to commit the following patch, which should help track down
why you're having this problem.  You should get a message something
like

"farmas.a(some_file)(some_section+0x12345678): reloc against `some_sym':
 error 2"

if the error occurred in an object file stored in your archive.  Extract
the file from the archive, and report back the results of
"objdump -h some_file".  I'm guessing that the size of "some_section"
is smaller than the reloc offset (the hex number in the error message).

bfd/ChangeLog
        * elf32-i386.c (elf_i386_relocate_section): Report some detail on
        bfd_reloc_outofrange and similar errors.

-- 
Alan Modra

Index: bfd/elf32-i386.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-i386.c,v
retrieving revision 1.56
diff -c -p -r1.56 elf32-i386.c
*** elf32-i386.c        2001/10/15 09:45:46     1.56
--- elf32-i386.c        2001/10/15 12:42:23
*************** elf_i386_relocate_section (output_bfd, i
*** 2037,2074 ****
                                    contents, rel->r_offset,
                                    relocation, (bfd_vma) 0);
  
!       switch (r)
        {
!       case bfd_reloc_ok:
!         break;
  
!       case bfd_reloc_overflow:
!         {
!           const char *name;
  
!           if (h != NULL)
!             name = h->root.root.string;
!           else
!             {
!               name = bfd_elf_string_from_elf_section (input_bfd,
!                                                       symtab_hdr->sh_link,
!                                                       sym->st_name);
!               if (name == NULL)
!                 return false;
!               if (*name == '\0')
!                 name = bfd_section_name (input_bfd, sec);
!             }
!           if (! ((*info->callbacks->reloc_overflow)
!                  (info, name, howto->name, (bfd_vma) 0,
!                   input_bfd, input_section, rel->r_offset)))
!             return false;
!         }
!         break;
  
!       default:
!       case bfd_reloc_outofrange:
!         abort ();
!         break;
        }
      }
  
--- 2037,2076 ----
                                    contents, rel->r_offset,
                                    relocation, (bfd_vma) 0);
  
!       if (r != bfd_reloc_ok)
        {
!         const char *name;
  
!         if (h != NULL)
!           name = h->root.root.string;
!         else
!           {
!             name = bfd_elf_string_from_elf_section (input_bfd,
!                                                     symtab_hdr->sh_link,
!                                                     sym->st_name);
!             if (name == NULL)
!               return false;
!             if (*name == '\0')
!               name = bfd_section_name (input_bfd, sec);
!           }
  
!         if (r == bfd_reloc_overflow)
!           {
  
!             if (! ((*info->callbacks->reloc_overflow)
!                    (info, name, howto->name, (bfd_vma) 0,
!                     input_bfd, input_section, rel->r_offset)))
!               return false;
!           }
!         else
!           {
!             (*_bfd_error_handler)
!               (_("%s(%s+0x%lx): reloc against `%s': error %d"),
!                bfd_archive_filename (input_bfd),
!                bfd_get_section_name (input_bfd, input_section),
!                (long) rel->r_offset, name, (int) r);
!             return false;
!           }
        }
      }
  



reply via email to

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