This is a ld64 option equivalent to -sectcreate seg sect /dev/null
that's useful for creating sections like the RESTRICT section.
Details
Details
- Reviewers
int3 - Group Reviewers
Restricted Project - Commits
- rGa6298fb16063: [lld-macho] Add support for -add_empty_section
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
From the ld64 manpage:
-add_empty_section segname sectname An empty section named sectname in the segment segname. If any of the inputs contains a section (segname,sectname), that section will be included in the output, and this option will be ignored.
Can we add a test for the case where the inputs also contain a section of the same name?
lld/test/MachO/sectcreate.s | ||
---|---|---|
25 | nit: I believe the double-underscore prefix is intended to be reserved for "special" section names, and user-created sections should just have regular un-prefixed names |
Comment Actions
Ah nice call, I added another case where it overlaps with sectcreate, and added one where it overlaps with DATA,data
nit: I believe the double-underscore prefix is intended to be reserved for "special" section names, and user-created sections should just have regular un-prefixed names