+ * dwarf2read.c (use_index_sections): New static global.
+ (read_index_from_section): Check it.
+ (_initialize_dwarf2_read): New option "use-index-sections".
+--- README.google 2015-09-05 15:21:34.000000000 -0700
++++ README.google 2015-09-05 15:24:02.000000000 -0700
++
++2015-09-05 Doug Evans <dje@google.com>
++
++ Temp fix for http://sourceware.org/bugzilla/show_bug.cgi?id=14704
++ * bfd/elf.c (bfd_section_from_shdr, case SHT_REL,SHT_RELA): Don't mark
++ the target section as having relocs if the reloc section is empty.
*hdr2 = *hdr;
*p_hdr = hdr2;
elf_elfsections (abfd)[shindex] = hdr2;
- target_sect->reloc_count += NUM_SHDR_ENTRIES (hdr);
- target_sect->flags |= SEC_RELOC;
- target_sect->relocation = NULL;
- target_sect->rel_filepos = hdr->sh_offset;
- /* In the section to which the relocations apply, mark whether
- its relocations are of the REL or RELA variety. */
+ /* Don't mark the target section as having relocs if this
+ section is empty. */
if (hdr->sh_size != 0)
{
+ target_sect->reloc_count += NUM_SHDR_ENTRIES (hdr);
+ target_sect->flags |= SEC_RELOC;
+ target_sect->relocation = NULL;
+ target_sect->rel_filepos = hdr->sh_offset;
+ /* In the section to which the relocations apply, mark whether
+ its relocations are of the REL or RELA variety. */
if (hdr->sh_type == SHT_RELA)
target_sect->use_rela_p = 1;
}