aboutsummaryrefslogtreecommitdiff
path: root/gold/output.h
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-11-07 18:29:34 +0000
committerIan Lance Taylor <iant@google.com>2007-11-07 18:29:34 +0000
commit91ea499d4ae67d29f4ef3aefc3335224a2837254 (patch)
treeb07d9444c7ef4ef8747202a7e9b8e62f73ee7f2f /gold/output.h
parent71fe8fb398bbfd79c5beadd1cce5656165f8ed37 (diff)
downloadbinutils-91ea499d4ae67d29f4ef3aefc3335224a2837254.zip
binutils-91ea499d4ae67d29f4ef3aefc3335224a2837254.tar.gz
binutils-91ea499d4ae67d29f4ef3aefc3335224a2837254.tar.bz2
Check that we don't set the output section index twice.
Diffstat (limited to 'gold/output.h')
-rw-r--r--gold/output.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/gold/output.h b/gold/output.h
index a615a71..b6c1245 100644
--- a/gold/output.h
+++ b/gold/output.h
@@ -1183,12 +1183,18 @@ class Output_section : public Output_data
// Return the section index in the output file.
unsigned int
do_out_shndx() const
- { return this->out_shndx_; }
+ {
+ gold_assert(this->out_shndx_ != -1U);
+ return this->out_shndx_;
+ }
// Set the output section index.
void
do_set_out_shndx(unsigned int shndx)
- { this->out_shndx_ = shndx; }
+ {
+ gold_assert(this->out_shndx_ == -1U);
+ this->out_shndx_ = shndx;
+ }
// Return the entsize field.
uint64_t