From: Doug Evans Date: Thu, 10 Dec 2015 20:00:29 +0000 (-0800) Subject: patch ../102425721.patch X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2504c7b071262e2ee2a2e331f4550eabc7e25520;p=thirdparty%2Fbinutils-gdb.git patch ../102425721.patch --- diff --git a/README.google b/README.google index a592883b5ce..355d20c271d 100644 --- a/README.google +++ b/README.google @@ -68,3 +68,11 @@ they are an ongoing maintenance burden. + * 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 ++ ++ 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. diff --git a/bfd/elf.c b/bfd/elf.c index 98460467d0c..2d551930fe8 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -2010,14 +2010,16 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) *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; }