aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-12-31 03:48:46 +0000
committerIan Lance Taylor <ian@airs.com>2009-12-31 03:48:46 +0000
commitd7bb5745008bb111becc3dc87e7ce243f59b7170 (patch)
tree90278a6e9c9daca6652c0e8c90ddfc77ef9accee /gold/layout.cc
parentfc59c57250878209dbcacd68712643d88b1c7adc (diff)
downloadgdb-d7bb5745008bb111becc3dc87e7ce243f59b7170.zip
gdb-d7bb5745008bb111becc3dc87e7ce243f59b7170.tar.gz
gdb-d7bb5745008bb111becc3dc87e7ce243f59b7170.tar.bz2
PR 10979
* script.cc (read_input_script): If we see a new SECTIONS clause, and we have added an input section, give an error. * layout.h (class Layout): Add have_added_input_section function. Add have_added_input_section_ field. * layout.cc (Layout::Layout): Initialize have_added_input_section_. (Layout::layout): Set have_added_input_section_. (Layout::layout_eh_frame): Likewise.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/gold/layout.cc b/gold/layout.cc
index 5462532..8bbeebe 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -192,6 +192,7 @@ Layout::Layout(int number_of_input_files, Script_options* script_options)
debug_info_(NULL),
group_signatures_(),
output_file_size_(-1),
+ have_added_input_section_(false),
sections_are_attached_(false),
input_requires_executable_stack_(false),
input_with_gnu_stack_note_(false),
@@ -610,6 +611,7 @@ Layout::layout(Sized_relobj<size, big_endian>* object, unsigned int shndx,
*off = os->add_input_section(object, shndx, name, shdr, reloc_shndx,
this->script_options_->saw_sections_clause());
+ this->have_added_input_section_ = true;
return os;
}
@@ -818,6 +820,7 @@ Layout::layout_eh_frame(Sized_relobj<size, big_endian>* object,
bool saw_sections_clause = this->script_options_->saw_sections_clause();
*off = os->add_input_section(object, shndx, name, shdr, reloc_shndx,
saw_sections_clause);
+ this->have_added_input_section_ = true;
}
return os;