From 91ea499d4ae67d29f4ef3aefc3335224a2837254 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 7 Nov 2007 18:29:34 +0000 Subject: Check that we don't set the output section index twice. --- gold/output.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gold/output.h') 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 -- cgit v1.1