diff options
Diffstat (limited to 'gold/script-sections.cc')
-rw-r--r-- | gold/script-sections.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gold/script-sections.cc b/gold/script-sections.cc index 2988d10..978f84d 100644 --- a/gold/script-sections.cc +++ b/gold/script-sections.cc @@ -3212,7 +3212,7 @@ Script_sections::create_segments(Layout* layout, uint64_t dot_alignment) is_current_seg_readonly = true; } - current_seg->add_output_section(*p, seg_flags, false); + current_seg->add_output_section_to_load(layout, *p, seg_flags); if (((*p)->flags() & elfcpp::SHF_WRITE) != 0) is_current_seg_readonly = false; @@ -3291,7 +3291,7 @@ Script_sections::create_note_and_tls_segments( Layout::section_flags_to_segment((*p)->flags()); Output_segment* oseg = layout->make_output_segment(elfcpp::PT_NOTE, seg_flags); - oseg->add_output_section(*p, seg_flags, false); + oseg->add_output_section_to_nonload(*p, seg_flags); // Incorporate any subsequent SHT_NOTE sections, in the // hopes that the script is sensible. @@ -3300,7 +3300,7 @@ Script_sections::create_note_and_tls_segments( && (*pnext)->type() == elfcpp::SHT_NOTE) { seg_flags = Layout::section_flags_to_segment((*pnext)->flags()); - oseg->add_output_section(*pnext, seg_flags, false); + oseg->add_output_section_to_nonload(*pnext, seg_flags); p = pnext; ++pnext; } @@ -3315,14 +3315,14 @@ Script_sections::create_note_and_tls_segments( Layout::section_flags_to_segment((*p)->flags()); Output_segment* oseg = layout->make_output_segment(elfcpp::PT_TLS, seg_flags); - oseg->add_output_section(*p, seg_flags, false); + oseg->add_output_section_to_nonload(*p, seg_flags); Layout::Section_list::const_iterator pnext = p + 1; while (pnext != sections->end() && ((*pnext)->flags() & elfcpp::SHF_TLS) != 0) { seg_flags = Layout::section_flags_to_segment((*pnext)->flags()); - oseg->add_output_section(*pnext, seg_flags, false); + oseg->add_output_section_to_nonload(*pnext, seg_flags); p = pnext; ++pnext; } @@ -3477,10 +3477,12 @@ Script_sections::attach_sections_using_phdrs_clause(Layout* layout) elfcpp::Elf_Word seg_flags = Layout::section_flags_to_segment(os->flags()); - r->second->add_output_section(os, seg_flags, false); - if (r->second->type() == elfcpp::PT_LOAD) + if (r->second->type() != elfcpp::PT_LOAD) + r->second->add_output_section_to_nonload(os, seg_flags); + else { + r->second->add_output_section_to_load(layout, os, seg_flags); if (in_load_segment) gold_error(_("section in two PT_LOAD segments")); in_load_segment = true; |