aboutsummaryrefslogtreecommitdiff
path: root/gold/output.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-06-24 19:48:51 +0000
committerIan Lance Taylor <ian@airs.com>2009-06-24 19:48:51 +0000
commit9c547ec3ac2440e1d81af5d465e1db1d5e28e43e (patch)
tree7bf396b5e00ba6c0276aa6deff32566652b38809 /gold/output.h
parent554585003d351dea8db3181866b89ebc9bf2f66c (diff)
downloadgdb-9c547ec3ac2440e1d81af5d465e1db1d5e28e43e.zip
gdb-9c547ec3ac2440e1d81af5d465e1db1d5e28e43e.tar.gz
gdb-9c547ec3ac2440e1d81af5d465e1db1d5e28e43e.tar.bz2
PR 10156
* layout.cc (Layout::choose_output_section): If we find an existing section, update the flags. (Layout::create_notes): New function, broken out of Layout::finalize. (Layout::finalize): Don't create note sections. (Layout::create_note): Don't crash if linker script discards section. (Layout::create_gold_note): Likewise. (Layout::create_build_id): Likewise. Don't set after_input_sections on the section. (Layout::create_executable_stack_info): Remove target parameter. Change caller. * layout.h (class Layout): Declare create_notes. Update declaration of create_executable_stack_info. * gold.cc (queue_middle_tasks): Call create_notes. * output.cc (Output_section::update_flags_for_input_section): Move here from output.h. If SHF_ALLOC flag is newly set, mark address invalid. * output.h (Output_data::mark_address_invalid): New function. (class Output_section): Only declare, not define, update_flags_for_input_section. Remove set_flags.
Diffstat (limited to 'gold/output.h')
-rw-r--r--gold/output.h22
1 files changed, 8 insertions, 14 deletions
diff --git a/gold/output.h b/gold/output.h
index 3e46ad8..f9cbfa6 100644
--- a/gold/output.h
+++ b/gold/output.h
@@ -330,6 +330,13 @@ class Output_data
// Functions that child classes may call.
+ // Reset the address. The Output_section class needs this when an
+ // SHF_ALLOC input section is added to an output section which was
+ // formerly not SHF_ALLOC.
+ void
+ mark_address_invalid()
+ { this->is_address_valid_ = false; }
+
// Set the size of the data.
void
set_data_size(off_t data_size)
@@ -1948,22 +1955,9 @@ class Output_section : public Output_data
flags() const
{ return this->flags_; }
- // Set the section flags. This may only be used with the Layout
- // code when it is prepared to move the section to a different
- // segment.
- void
- set_flags(elfcpp::Elf_Xword flags)
- { this->flags_ = flags; }
-
// Update the output section flags based on input section flags.
void
- update_flags_for_input_section(elfcpp::Elf_Xword flags)
- {
- this->flags_ |= (flags
- & (elfcpp::SHF_WRITE
- | elfcpp::SHF_ALLOC
- | elfcpp::SHF_EXECINSTR));
- }
+ update_flags_for_input_section(elfcpp::Elf_Xword flags);
// Return the entsize field.
uint64_t