base: Add warning when failing to insert a whole symbol table
Current we drop the insertion of a whole symbol table if the name of one symbol already exists in the base table. Having similar symbols across different binaries is very common. This change adds a warning and recommends a fix instead of silently dropping the table. This is useful for debugging when there are two or more workloads, e.g. bootloader + kernel, are added separately. Change-Id: I9e4cf06037cd70926fb5cee3c4dab464daf0912e Signed-off-by: Hoa Nguyen <hn@hnpl.org>
This commit is contained in:
@@ -79,8 +79,11 @@ SymbolTable::insert(const SymbolTable &other)
|
||||
nameMap.begin(), nameMap.end(),
|
||||
std::inserter(intersection, intersection.begin()),
|
||||
nameMap.value_comp());
|
||||
if (!intersection.empty())
|
||||
if (!intersection.empty()) {
|
||||
warn("Cannot insert a new symbol table due to name collisions. "
|
||||
"Adding prefix to each symbol's name can resolve this issue.");
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const Symbol &symbol: other)
|
||||
insert(symbol);
|
||||
|
||||
Reference in New Issue
Block a user