[lld-macho] Folded symbols should have size zero in linker map
authorJez Ng <jezng@fb.com>
Tue, 18 Oct 2022 21:21:43 +0000 (17:21 -0400)
committerJez Ng <jezng@fb.com>
Tue, 18 Oct 2022 21:22:10 +0000 (17:22 -0400)
commit316d4f96f22afa6630ee1069e48f970362f50f0a
tree45963573e00036b64299128b5f10c86f07604956
parent16d784159f6873ff5ca860c0e490103127aa2e4e
[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
lld/MachO/InputSection.cpp
lld/test/MachO/map-file.s
lld/test/MachO/stabs-icf.s