We should have maxprot == initprot for all non-i386 architectures, which
is what ld64 does.
Details
- Reviewers
compnerd - Group Reviewers
Restricted Project - Commits
- rG6cf244327b0d: [lld-macho][easy] Fix segment max protection
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lld/MachO/OutputSegment.cpp | ||
---|---|---|
36 | It seems that it would be better to replace initProt and maxProt with just prot? Or just filling in the differences that require this would be a good idea. |
lld/MachO/OutputSegment.cpp | ||
---|---|---|
36 | Does it make sense to fill in code that we're not going to be able to test? |
lld/MachO/OutputSegment.cpp | ||
---|---|---|
36 | I wrote it this way so it would be easy to "fill out" the missing bits when we support i386 |
lld/MachO/OutputSegment.cpp | ||
---|---|---|
36 | I think that it does make sense to fill it out now even if we cannot test it. Alternatively, we could defer the setup to the point where it is needed. In the current state, it is very confusing and not very valuable. |
lld/MachO/OutputSegment.cpp | ||
---|---|---|
36 | I think the assertion makes the intent clear -- they're two separate functions because on i386 their behaviors deviate. Moreover, making it an assertion ensures that when we do add support for i386, it'll be immediately obvious that a test needs to be written to cover this edge case. |
It seems that it would be better to replace initProt and maxProt with just prot? Or just filling in the differences that require this would be a good idea.