This is an archive of the discontinued LLVM Phabricator instance.

Limit the maximum alignment of copyrel'ed shared symbols to 32.
ClosedPublic

Authored by ruiu on Nov 6 2017, 1:53 PM.

Details

Summary

When we create a copy relocation, we need to compute its alignment.
Since the information is lost already, we need to infer it from a
symbol address.

If a symbol seems to be aligned to a very large address, it is likely
that it doesn't really need that alignment but it happens to get that
address. So, for example, if a symbol's address is 6 GiB, it usually
doesn't mean that it must be aligned to 2 GiB.

This patch limits the maximum alignment to 32. 32 is chosen as a
"reasonable" maximum alignment.

Diff Detail

Repository
rL LLVM

Event Timeline

ruiu created this revision.Nov 6 2017, 1:53 PM
ruiu updated this revision to Diff 121782.Nov 6 2017, 2:06 PM
  • Address review comments.
ruiu updated this revision to Diff 121783.Nov 6 2017, 2:10 PM
  • Fix build error.
This revision was automatically updated to reflect the committed changes.