aboutsummaryrefslogtreecommitdiff
path: root/gold/dwp.cc
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2012-12-15 00:57:30 +0000
committerCary Coutant <ccoutant@google.com>2012-12-15 00:57:30 +0000
commit2a77e2ab1828db0bfd0c28d5e2a38715a19dc9ad (patch)
tree317a45dafd9f76cc3c1333236f8269d0bc3be6bf /gold/dwp.cc
parentfcb94e69be6cf3a538f62bfae7c6072dd30c13e7 (diff)
downloadgdb-2a77e2ab1828db0bfd0c28d5e2a38715a19dc9ad.zip
gdb-2a77e2ab1828db0bfd0c28d5e2a38715a19dc9ad.tar.gz
gdb-2a77e2ab1828db0bfd0c28d5e2a38715a19dc9ad.tar.bz2
gold/
* dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs. (Dwp_output_file::Dwp_index::enter_set): Add assert.
Diffstat (limited to 'gold/dwp.cc')
-rw-r--r--gold/dwp.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/gold/dwp.cc b/gold/dwp.cc
index 3f7d7bb..a81839c 100644
--- a/gold/dwp.cc
+++ b/gold/dwp.cc
@@ -1532,8 +1532,11 @@ Dwp_output_file::add_cu_set(uint64_t dwo_id,
debug_loc, debug_str_offsets, debug_macinfo,
debug_macro };
unsigned int slot;
- this->cu_index_.find_or_add(dwo_id, &slot);
- this->cu_index_.enter_set(slot, cu_set);
+ if (!this->cu_index_.find_or_add(dwo_id, &slot))
+ this->cu_index_.enter_set(slot, cu_set);
+ else
+ gold_warning(_("%s: duplicate entry for CU (dwo_id 0x%llx)"),
+ this->name_, (unsigned long long)dwo_id);
}
// Lookup a type signature and return TRUE if we have already seen it.
@@ -1617,6 +1620,7 @@ Dwp_output_file::Dwp_index::enter_set(unsigned int slot,
this->shndx_pool_.push_back(0);
// Enter the signature and pool index into the hash table.
+ gold_assert(this->hash_table_[slot] == 0);
this->hash_table_[slot] = set.signature;
this->index_table_[slot] = pool_index;
++this->used_;