mirror of
https://github.com/intel/llvm.git
synced 2026-01-22 23:49:22 +08:00
[lld-macho] Prevent assertions for aliases to weak_def_can_be_hidden symbols
In https://reviews.llvm.org/D137982 we found that on Mach-O private aliases could trigger an assert in lld when the aliasee was a weak_def_can_be_hidden symbol. This appears to be incorrect, and should be allowed in Mach-O. Disallowing this behavior is also inconsistent with how ld64 handles a private alias to weak_def_can_be_hidden symbols. This patch removes the assert and tests that LLD handles such aliases gracefully. Reviewed By: #lld-macho, int3 Differential Revision: https://reviews.llvm.org/D141082
This commit is contained in:
@@ -698,8 +698,6 @@ static macho::Symbol *createDefined(const NList &sym, StringRef name,
|
||||
sym.n_desc & REFERENCED_DYNAMICALLY, sym.n_desc & N_NO_DEAD_STRIP,
|
||||
isWeakDefCanBeHidden);
|
||||
}
|
||||
assert(!isWeakDefCanBeHidden &&
|
||||
"weak_def_can_be_hidden on already-hidden symbol?");
|
||||
bool includeInSymtab = !isPrivateLabel(name) && !isEhFrameSection(isec);
|
||||
return make<Defined>(
|
||||
name, isec->getFile(), isec, value, size, sym.n_desc & N_WEAK_DEF,
|
||||
|
||||
Reference in New Issue
Block a user