Page MenuHomePhabricator

Link static PIE programs against rcrt0.o on OpenBSD
ClosedPublic

Authored by sisnkemp on Jul 8 2016, 5:37 AM.

Details

Summary

When building a static PIE binary, linking against /usr/lib/crt0.o results in segfaults when trying to run the binary.
Static PIE programs must link against /usr/lib/rcrt0.o instead to run correctly. Bitrig has this patch in their local clang tree also.

Diff Detail

Repository
rL LLVM

Event Timeline

sisnkemp updated this revision to Diff 63205.Jul 8 2016, 5:37 AM
sisnkemp retitled this revision from to Link static PIE programs against rcrt0.o on OpenBSD.
sisnkemp updated this object.
sisnkemp added a reviewer: rafael.
sisnkemp added a subscriber: cfe-commits.
rafael edited reviewers, added: emaste; removed: rafael.Jul 8 2016, 5:41 AM
joerg edited edge metadata.Aug 13 2016, 11:49 AM

This is missing a test case.

sisnkemp updated this revision to Diff 68046.Aug 15 2016, 9:33 AM
sisnkemp edited edge metadata.

Now with test case.

vsk resigned from this revision.Sep 6 2016, 6:48 AM
vsk removed a reviewer: vsk.

I don't see any issues with this patch, but also don't know enough about the openbsd toolchain to lgtm it.

emaste edited edge metadata.Sep 8 2016, 7:26 AM

Seems fine to me, but I'm not particularly knowledgeable about OpenBSD's toolchain.

joerg accepted this revision.Oct 13 2016, 4:44 PM
joerg edited edge metadata.
This revision is now accepted and ready to land.Oct 13 2016, 4:44 PM
This revision was automatically updated to reflect the committed changes.