aboutsummaryrefslogtreecommitdiff
path: root/gold/output.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gold/output.cc')
-rw-r--r--gold/output.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/gold/output.cc b/gold/output.cc
index 37ec8b3..6878034 100644
--- a/gold/output.cc
+++ b/gold/output.cc
@@ -1911,6 +1911,7 @@ Output_section::Output_section(const char* name, elfcpp::Elf_Word type,
generate_code_fills_at_write_(false),
is_entsize_zero_(false),
section_offsets_need_adjustment_(false),
+ is_noload_(false),
tls_offset_(0),
checkpoint_(NULL),
merge_section_map_(),
@@ -2588,8 +2589,9 @@ Output_section::do_reset_address_and_file_offset()
{
// An unallocated section has no address. Forcing this means that
// we don't need special treatment for symbols defined in debug
- // sections. We do the same in the constructor.
- if ((this->flags_ & elfcpp::SHF_ALLOC) == 0)
+ // sections. We do the same in the constructor. This does not
+ // apply to NOLOAD sections though.
+ if (((this->flags_ & elfcpp::SHF_ALLOC) == 0) && !this->is_noload_)
this->set_address(0);
for (Input_section_list::iterator p = this->input_sections_.begin();