mirror of
https://github.com/ziglang/zig.git
synced 2025-12-27 16:43:07 +00:00
macho: exclude tentative def before checking for collision
when resolving global symbols.
This commit is contained in:
parent
35403d41ce
commit
f01366e8b3
@ -2167,19 +2167,16 @@ fn resolveSymbolsInObject(
|
||||
.global => {
|
||||
const global = &self.globals.items[resolv.where_index];
|
||||
|
||||
if (!(symbolIsWeakDef(sym) or symbolIsPext(sym)) and
|
||||
if (symbolIsTentative(global.*)) {
|
||||
_ = tentatives.fetchSwapRemove(resolv.where_index);
|
||||
} else if (!(symbolIsWeakDef(sym) or symbolIsPext(sym)) and
|
||||
!(symbolIsWeakDef(global.*) or symbolIsPext(global.*)))
|
||||
{
|
||||
log.err("symbol '{s}' defined multiple times", .{sym_name});
|
||||
log.err(" first definition in '{s}'", .{self.objects.items[resolv.file].name});
|
||||
log.err(" next definition in '{s}'", .{object.name});
|
||||
return error.MultipleSymbolDefinitions;
|
||||
}
|
||||
if (symbolIsWeakDef(sym) or symbolIsPext(sym)) continue; // Current symbol is weak, so skip it.
|
||||
|
||||
if (symbolIsTentative(global.*)) {
|
||||
_ = tentatives.fetchSwapRemove(resolv.where_index);
|
||||
}
|
||||
} else if (symbolIsWeakDef(sym) or symbolIsPext(sym)) continue; // Current symbol is weak, so skip it.
|
||||
|
||||
// Otherwise, update the resolver and the global symbol.
|
||||
global.n_type = sym.n_type;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user