From 9c547ec3ac2440e1d81af5d465e1db1d5e28e43e Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 24 Jun 2009 19:48:51 +0000 Subject: 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. --- gold/output.h | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'gold/output.h') 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 -- cgit v1.1