summaryrefslogtreecommitdiff
path: root/gold/output.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-03-12 04:38:42 +0000
committerIan Lance Taylor <iant@google.com>2008-03-12 04:38:42 +0000
commitaecd402e46d37c5c7e20e7cf59b476fab73d0a8e (patch)
treeecc1d2faedfbb4093e53353475f11030fcb738c6 /gold/output.cc
parent6ea49776678bea0498f214b7e605bf5e90af31f0 (diff)
downloadbinutils-redhat-aecd402e46d37c5c7e20e7cf59b476fab73d0a8e.tar.gz
Combine read-only .eh_frame sections with read-write .eh_frame
sections.
Diffstat (limited to 'gold/output.cc')
-rw-r--r--gold/output.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/gold/output.cc b/gold/output.cc
index 622e983786..044a035828 100644
--- a/gold/output.cc
+++ b/gold/output.cc
@@ -2376,6 +2376,27 @@ Output_segment::add_output_section(Output_section* os,
pdl->push_back(os);
}
+// Remove an Output_section from this segment. It is an error if it
+// is not present.
+
+void
+Output_segment::remove_output_section(Output_section* os)
+{
+ // We only need this for SHT_PROGBITS.
+ gold_assert(os->type() == elfcpp::SHT_PROGBITS);
+ for (Output_data_list::iterator p = this->output_data_.begin();
+ p != this->output_data_.end();
+ ++p)
+ {
+ if (*p == os)
+ {
+ this->output_data_.erase(p);
+ return;
+ }
+ }
+ gold_unreachable();
+}
+
// Add an Output_data (which is not an Output_section) to the start of
// a segment.