The __llvm_addrsig section is a section that the linker needs for safe icf.
This was not yet implemented for MachO - this is the implementation.
It has been tested with a safe deduplication implementation inside lld.
Details
Diff Detail
Event Timeline
Adding some more MC reviewers.
You're missing a test case. You should also upload the patch with context (arc does this for you automatically, otherwise use git diff -U99999 if uploading a patch manually).
llvm/include/llvm/BinaryFormat/MachO.h | ||
---|---|---|
178 ↗ | (On Diff #422707) | The values may be defined by Apple. We cannot randomly grab a value. |
llvm/include/llvm/BinaryFormat/MachO.h | ||
---|---|---|
176 ↗ | (On Diff #422707) | This one is in my local loader.h. S_ADDRSIG is not there. |
D112160 is a similar recent example of adding a custom Mach-O section, and it might be a good reference for adding a test and assigning a section identifier.
Placing code gen test/MC
llvm/include/llvm/MC/MCObjectWriter.h | ||
---|---|---|
37 | Moving the small boolean variable after the vector. If someone adds more smaller variables to the class in the future, it will make the class size smaller. | |
llvm/lib/MC/MachObjectWriter.cpp | ||
767 | *fragmentList.begin() the dereference has implied that it can't be nullptr, so assert can be removed. | |
773 | drop brace | |
llvm/test/MC/MachO/addrsig-macho.ll | ||
55 | CodeGen/X86/addrsig.ll has some interesting IR objects which may be worth adding here. It seems to me that CodeGen may be a better directory. |
Moving the small boolean variable after the vector. If someone adds more smaller variables to the class in the future, it will make the class size smaller.