mirror of
https://github.com/intel/llvm.git
synced 2026-01-20 10:58:11 +08:00
[lld-macho] Folded symbols should have size zero in linker map
This matches ld64's behavior. I also extended the icf-stabs.s test to demonstrate that even though folded symbols have size zero, we cannot use the size-zero property in lieu of `wasIdenticalCodeFolded`, because size zero symbols should still get STABS entries. Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D136001
This commit is contained in:
@@ -138,8 +138,10 @@ void ConcatInputSection::foldIdentical(ConcatInputSection *copy) {
|
||||
copy->live = false;
|
||||
copy->wasCoalesced = true;
|
||||
copy->replacement = this;
|
||||
for (auto ©Sym : copy->symbols)
|
||||
for (auto ©Sym : copy->symbols) {
|
||||
copySym->wasIdenticalCodeFolded = true;
|
||||
copySym->size = 0;
|
||||
}
|
||||
|
||||
symbols.insert(symbols.end(), copy->symbols.begin(), copy->symbols.end());
|
||||
copy->symbols.clear();
|
||||
|
||||
Reference in New Issue
Block a user