From c13526cafc27ecf6970b72acb1157e6e04af9e50 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 20 Aug 2010 15:01:45 +0000 Subject: [PATCH] * emultempl/elf32.em (_after_open): Check for get_elf_backend_data returning NULL. --- ld/ChangeLog | 5 +++++ ld/emultempl/elf32.em | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index e0873aecfb0..d417ef8ad26 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2010-08-20 Nick Clifton + + * emultempl/elf32.em (_after_open): Check for get_elf_backend_data + returning NULL. + 2010-08-19 Alan Modra * ld.texinfo (Expression Section): Detail expression evaluation. diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index 73839d61d71..2decd1868b9 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -1134,9 +1134,12 @@ gld${EMULATION_NAME}_after_open (void) const struct elf_backend_data *bed; bed = get_elf_backend_data (abfd); - s = bfd_make_section_with_flags (abfd, ".eh_frame_hdr", - bed->dynamic_sec_flags - | SEC_READONLY); + if (bed == NULL) + s = NULL; + else + s = bfd_make_section_with_flags (abfd, ".eh_frame_hdr", + bed->dynamic_sec_flags + | SEC_READONLY); if (s != NULL && bfd_set_section_alignment (abfd, s, 2)) htab->eh_info.hdr_sec = s; -- 2.30.2