I realized that ld64 merges word literals across sections, but
does not do the same for cstring literals. This diff brings us up to
parity + adds a test for the behavior around word literals as well.
Details
- Reviewers
gkm - Group Reviewers
Restricted Project
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I don't know. I'm trying to debug a "unrecognized selector" crash in one of my programs right now, and so I've been looking at discrepancies between the ObjC-related data in LLD vs ld64's outputs. I saw that the __objc_methname and other similar strings in ld64's output remained in their original sections, whereas we were merging them all into __cstring. I don't think this diff fixes the original crash, but I figured having fewer discrepancies between the two binaries would be a good thing regardless.
However, if you would prefer we not land this until there's a demonstrated need, I'm with that too.
Turns out D112500: [lld-macho] Put GOT into `__DATA` segment where appropriate fixed the "unrecognized selector" crash, so I guess I don't need this any more, at least for now