[Top][All Lists]

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

[Bug binutils/3679] New: sh_entsize not set for .dyn.rel cause an assert

From: chombourger at nexwave-solutions dot com
Subject: [Bug binutils/3679] New: sh_entsize not set for .dyn.rel cause an assert to detonate with mips-linux-elf-ld -shared -q
Date: 8 Dec 2006 11:50:41 -0000

I have an assert detonating in bfd/elflink.c with the following code linked with
mips-linux-elf-ld -shared -q:


/* 'a' goes into .data */
int a = 1; 

/* 'b' goes into .rodata and creates a reloc for .rodata against .data */
const int *b = &a; 

when linking with mips-linux-elf-ld version 2.17, we end-up with:

mips-linux-elf-ld: BFD 2.17 assertion fail elflink.c:7973

After some investigations, I have observed the following:

   - the section for which we have an assert is '.rel.dyn'
   - sh_entsize for this section is zero
   - we reach this code because reloc_count is greater than zero (and is equals
to sec->reloc_count because of the -q option passed to ld)
   - '.rel.dyn' section is created by mips_elf_rel_dyn_section()
   - room is reserved for our .rel.dyn section by
   - I have a '.rel.rel.dyn' section in the output

I was surprised to see in mips_elf_allocate_dynamic_relocations() that
reloc_count is incremented only for the 1st entries and ins't for subsequent
entries. I was under the impression that asection::reloc_count is the number
of relocations to be applied to a section; is it the number of relocs for
a relocation section.

I have the feeling that the incrementation of reloc_count in
bfd/elfxx-mips.c:mips_elf_allocate_dynamic_relocations:4710 should be removed
but are we breaking something with this change?

           Summary: sh_entsize not set for .dyn.rel cause an assert to
                    detonate with mips-linux-elf-ld -shared -q
           Product: binutils
           Version: 2.17
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: chombourger at nexwave-solutions dot com
                CC: bug-binutils at gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: mips-linux-elf


------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

reply via email to

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