PR ld/20401
bfd * coffgen.c (fini_reloc_cookie_rels): Check for the extistence
of the coff_section_data before using it.
+2016-07-27 Nick Clifton <nickc@redhat.com>
+
+ * Import this patch from the mainline:
+ 2016-07-27 Ozkan Sezer <sezeroz@gmail.com>
+ Nick Clifton <nickc@redhat.com>
+
+ PR ld/20401
+ * coffgen.c (fini_reloc_cookie_rels): Check for the extistence
+ of the coff_section_data before using it.
+
2016-07-01 Tristan Gingold <gingold@adacore.com>
* version.m4: Bump version to 2.26.90
fini_reloc_cookie_rels (struct coff_reloc_cookie *cookie,
asection *sec)
{
- if (cookie->rels && coff_section_data (NULL, sec)->relocs != cookie->rels)
+ if (cookie->rels
+ /* PR 20401. The relocs may not have been cached, so check first.
+ If the relocs were loaded by init_reloc_cookie_rels() then this
+ will be the case. FIXME: Would performance be improved if the
+ relocs *were* cached ? */
+ && coff_section_data (NULL, sec)
+ && coff_section_data (NULL, sec)->relocs != cookie->rels)
free (cookie->rels);
}