This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Folded symbols should have size zero in linker map
ClosedPublic

Authored by int3 on Oct 14 2022, 5:06 PM.

Details

Summary

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.

Diff Detail

Event Timeline

int3 created this revision.Oct 14 2022, 5:06 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 14 2022, 5:06 PM
int3 requested review of this revision.Oct 14 2022, 5:06 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 14 2022, 5:06 PM
int3 added inline comments.Oct 14 2022, 5:18 PM
lld/test/MachO/map-file.s
70–71

ICF won't fold sections that are not marked pure_instructions

Roger added a subscriber: Roger.Oct 16 2022, 2:48 PM
Roger added inline comments.
lld/test/MachO/map-file.s
70–71

ICF won't fold sections that are not marked pure_instructions

Could you comment this in the code itself?

int3 added inline comments.Oct 17 2022, 2:41 PM
lld/test/MachO/map-file.s
70–71

you mean in the test? sure

int3 updated this revision to Diff 468336.Oct 17 2022, 2:42 PM
int3 marked an inline comment as done.

comment

thakis accepted this revision.Oct 18 2022, 12:18 PM
thakis added a subscriber: thakis.

lg

This revision is now accepted and ready to land.Oct 18 2022, 12:18 PM
This revision was landed with ongoing or failed builds.Oct 18 2022, 2:22 PM
This revision was automatically updated to reflect the committed changes.