summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2015-12-10 12:00:29 -0800
committerDoug Evans <dje@google.com>2015-12-10 12:00:29 -0800
commit2504c7b071262e2ee2a2e331f4550eabc7e25520 (patch)
tree4aea6e4302cae18891df579117b58cb237d962cf
parent5280a7a34ac72b2aeb5004fc8508b92c54c6e765 (diff)
downloadbinutils-gdb-2504c7b071262e2ee2a2e331f4550eabc7e25520.tar.gz
patch ../102425721.patch
-rw-r--r--README.google8
-rw-r--r--bfd/elf.c14
2 files changed, 16 insertions, 6 deletions
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 <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.
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;
}