This is an archive of the discontinued LLVM Phabricator instance.

ELF: Omit PT_GNU_STACK segment if -z execstack is provided.
ClosedPublic

Authored by ruiu on Nov 24 2015, 3:10 PM.

Details

Reviewers
joerg
Summary

In the previous patch (r254003), I made the linker emit PT_GNU_STACK
unconditionally. But sometimes you want to have a control over the
presence of the segment. With this patch, you can omit the segment
by passing -z execstack option.

Diff Detail

Event Timeline

ruiu updated this revision to Diff 41089.Nov 24 2015, 3:10 PM
ruiu retitled this revision from to ELF: Omit PT_GNU_STACK segment if -z execstack is provided..
ruiu updated this object.
ruiu added a reviewer: joerg.
ruiu added a subscriber: llvm-commits.
joerg accepted this revision.Nov 24 2015, 3:39 PM
joerg edited edge metadata.

Thanks, this works for the cases I care about. The refinement of the test case is minor, just trying to make sure both cases are handled consistently.

test/ELF/gnustack.s
9

The intention here is that the notes are dropped, so shouldn't that be checked for the RWX case as well?

This revision is now accepted and ready to land.Nov 24 2015, 3:39 PM
ruiu added inline comments.Nov 24 2015, 3:44 PM
test/ELF/gnustack.s
9

Good point. Done.

ruiu closed this revision.Nov 24 2015, 3:45 PM