IR: Teach Constant::needsRelocation() that relative pointers don't need to be relocated.
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 18 Jul 2019 20:56:21 +0000 (20:56 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 18 Jul 2019 20:56:21 +0000 (20:56 +0000)
commitd1ec8eb84f7f576d00358fcbbeacd457a4b73c43
tree5ca3a2c63eafbf8ba30588fe66d46e788142a968
parent956761adb0ffdf6be50018aea1fb804ecb2da9f2
IR: Teach Constant::needsRelocation() that relative pointers don't need to be relocated.

This causes sections with relative pointers to be marked as read only,
which means that they won't end up sharing pages with writable data.

Differential Revision: https://reviews.llvm.org/D64948

llvm-svn: 366494
llvm/lib/IR/Constants.cpp
llvm/test/CodeGen/X86/relptr-rodata.ll [new file with mode: 0644]