This is an archive of the discontinued LLVM Phabricator instance.

[SafeStack] Use proper API to get stack guard
ClosedPublic

Authored by pzheng on May 17 2021, 12:27 PM.

Details

Summary

Using the proper API automatically sets __stack_chk_guard to dso_local if
Reloc::Static. This wasn't strictly necessary until recently when dso_local was
no longer implied by TargetMachine::shouldAssumeDSOLocal for
__stack_chk_guard. By using the proper API, we can avoid generating unnecessary
GOT relocations.

Diff Detail

Event Timeline

pzheng created this revision.May 17 2021, 12:27 PM
pzheng requested review of this revision.May 17 2021, 12:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2021, 12:27 PM
pzheng added a reviewer: pcc.May 18 2021, 2:12 PM
lebedev.ri resigned from this revision.May 19 2021, 7:00 AM
lebedev.ri edited the summary of this revision. (Show Details)

This looks reasonable to me, but i'm not familiar with that pass.

Any more comments? I'll probably wait a few more days before committing the change in case anyone hasn't got a chance to review.

vitalybuka accepted this revision.May 29 2021, 8:42 PM
This revision is now accepted and ready to land.May 29 2021, 8:42 PM
This revision was automatically updated to reflect the committed changes.