From 22af9fd35cb3a598f2bb2021c42cc1bd1424270f Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 13 Aug 2001 14:28:57 +0000 Subject: * emultempl/elf32.em: For SEC_EXCLUDE sections, ensure that output_section is set non-NULL. --- ld/emultempl/elf32.em | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ld/emultempl') diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index d6d4729..ce06310 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -1084,7 +1084,7 @@ gld${EMULATION_NAME}_place_orphan (file, s) & (SEC_LOAD | SEC_ALLOC)) == 0)) { /* We already have an output section statement with this - name, and its bfd section has compatible flags. */ + name, and its bfd section, if any, has compatible flags. */ wild_doit (&os->children, s, os, file); return true; } @@ -1113,7 +1113,11 @@ gld${EMULATION_NAME}_place_orphan (file, s) (hold.os != NULL || (hold.os = lang_output_section_find (name)) != NULL) if (s->flags & SEC_EXCLUDE) - return true; + { + if (s->output_section == NULL) + s->output_section = bfd_abs_section_ptr; + return true; + } place = NULL; if ((s->flags & SEC_ALLOC) == 0) -- cgit v1.1