aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl/elf32.em
diff options
context:
space:
mode:
Diffstat (limited to 'ld/emultempl/elf32.em')
-rw-r--r--ld/emultempl/elf32.em8
1 files changed, 6 insertions, 2 deletions
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)