[PATCH] D152841: Prevent out of range fixup encoding on AArch64

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 15 02:32:41 PDT 2023


efriedma added a comment.

In D152841#4423102 <https://reviews.llvm.org/D152841#4423102>, @dhoekwater wrote:

> In D152841#4419129 <https://reviews.llvm.org/D152841#4419129>, @efriedma wrote:
>
>> Funny side-note, while experimenting, I found that we don't emit an error if the distance is greater than 4GB.  Probably accidentally truncating an offset somewhere.
>
> I actually did consider adding a check to ADRP to ensure the distance isn't greater than 4GB (because it only has 21 offset bits to encode the page), but I couldn't quite figure out how to expose that behavior here. Should I add the check? If so, what triple do I have to use to get this function to be called for ADRP fixups?

I saw the 4GB issue with other relocations.  Actually, I didn't even try adrp.  I don't think we ever use this codepath for adrp.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152841/new/

https://reviews.llvm.org/D152841



More information about the llvm-commits mailing list