From 68b6574b4d15cd06198aac40c7ad9624a80c1bdb Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 16 Oct 2009 05:16:09 +0000 Subject: [PATCH] * layout.cc (Layout::relaxation_loop_body): Don't crash if we see program headers with no load segment if there is a linker script. --- gold/ChangeLog | 3 +++ gold/layout.cc | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index 6ebb5e8ba39..ea864a75746 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,5 +1,8 @@ 2009-10-15 Ian Lance Taylor + * layout.cc (Layout::relaxation_loop_body): Don't crash if we see + program headers with no load segment if there is a linker script. + * layout.cc (Layout::set_segment_offsets): Align the file offset to the segment aligment for -N or -n with no load segment. * output.cc (Output_segment::add_output_section): Don't crash if diff --git a/gold/layout.cc b/gold/layout.cc index 0b62c18b30e..028703ae1ce 100644 --- a/gold/layout.cc +++ b/gold/layout.cc @@ -1421,7 +1421,9 @@ Layout::relaxation_loop_body( != General_options::OBJECT_FORMAT_ELF) load_seg = NULL; - gold_assert(phdr_seg == NULL || load_seg != NULL); + gold_assert(phdr_seg == NULL + || load_seg != NULL + || this->script_options_->saw_sections_clause()); // Lay out the segment headers. if (!parameters->options().relocatable()) -- 2.30.2