Page MenuHomePhabricator

Restore visibility attribute for OpenBSD's stack guard
Needs ReviewPublic

Authored by sisnkemp on Jan 24 2017, 8:27 AM.

Details

Reviewers
timshen
Summary

This diff is from Philip Guenther (guenther@openbsd.org)
and got committed to the OpenBSD tree, see http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/gnu/llvm/lib/CodeGen/TargetLoweringBase.cpp?rev=1.3&content-type=text/x-cvsweb-markup
and http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/gnu/llvm/lib/CodeGen/TargetLoweringBase.cpp.diff?r1=1.2&r2=1.3&f=h

This repairs my previous patch (https://reviews.llvm.org/rL279449) that
missed the fact that removing visibility diff results accesses to
the stack protector look like this:

two loads

movq __guard_local@GOTPCREL(%rip), %rbx
movq (%rbx), %rax

But better is one load only, which is what Philip's diff achieves
movq __guard_local(%rip), %rax

Diff Detail

Event Timeline

sisnkemp created this revision.Jan 24 2017, 8:27 AM
joerg added a subscriber: joerg.Jan 24 2017, 8:48 AM

Missing test case.

timshen edited edge metadata.EditedJan 25 2017, 3:51 PM

Though I don't know a way off my hand, it's indeed good to have a testcase for this.

brad added a subscriber: brad.Mar 16 2017, 6:43 PM

Any suggestions for a test case?

joerg added a comment.Sep 8 2017, 5:39 AM

Create a function that does check the guard variable and make sure that it has the correct visibility declaration and/or access.