aboutsummaryrefslogtreecommitdiff
path: root/gold/script-sections.cc
diff options
context:
space:
mode:
authorRafael Ávila de Espíndola <respindola@mozilla.com>2010-05-19 17:49:19 +0000
committerRafael Ávila de Espíndola <respindola@mozilla.com>2010-05-19 17:49:19 +0000
commitd103a984a7657828c654330e89ce670490ae5825 (patch)
treed79be20f535293f8fef502700f30aacdf96a0e81 /gold/script-sections.cc
parent28d3cf859d41459121c74042aa5dbad3450cafcb (diff)
downloadfsf-binutils-gdb-d103a984a7657828c654330e89ce670490ae5825.zip
fsf-binutils-gdb-d103a984a7657828c654330e89ce670490ae5825.tar.gz
fsf-binutils-gdb-d103a984a7657828c654330e89ce670490ae5825.tar.bz2
2010-05-19 Rafael Espindola <espindola@google.com>
* script-sections.cc (Output_section_definition::allocate_to_segment): Update the phdrs_list even when the output section is NULL. * testsuite/Makefile.am: Add test. * testsuite/Makefile.in: Regenerate. * testsuite/script_test_9.cc: New. * testsuite/script_test_9.sh: New. * testsuite/script_test_9.t: New.
Diffstat (limited to 'gold/script-sections.cc')
-rw-r--r--gold/script-sections.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/gold/script-sections.cc b/gold/script-sections.cc
index e778279..952444e 100644
--- a/gold/script-sections.cc
+++ b/gold/script-sections.cc
@@ -2169,13 +2169,16 @@ Output_section*
Output_section_definition::allocate_to_segment(String_list** phdrs_list,
bool* orphan)
{
+ // Update phdrs_list even if we don't have an output section. It
+ // might be used by the following sections.
+ if (this->phdrs_ != NULL)
+ *phdrs_list = this->phdrs_;
+
if (this->output_section_ == NULL)
return NULL;
if ((this->output_section_->flags() & elfcpp::SHF_ALLOC) == 0)
return NULL;
*orphan = false;
- if (this->phdrs_ != NULL)
- *phdrs_list = this->phdrs_;
return this->output_section_;
}