[PATCH] D123160: [AArch64] Limit folded address offsets to 2^20 for COFF

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 6 04:19:23 PDT 2022


mstorsjo added a comment.

In D123160#3430996 <https://reviews.llvm.org/D123160#3430996>, @efriedma wrote:

> I'm not actually sure where "1 << 21" comes from, though; I think ELF is unlimited, and MachO is limited to "1 << 23".



In D123160#3431163 <https://reviews.llvm.org/D123160#3431163>, @pcc wrote:

> IIRC 1 << 21 was from COFF (missed that the addend was signed), so it wouldn't make sense to have this be 1 << 21 on other object formats if the actual limit is higher.
>
> I think it's unlikely that people will be hitting this limit in practice, so I'd probably just change this to 20 and document that it comes from COFF. I don't think this needs to be conditional but if it were it should be based on the object format and not the operating system because there may be non-Windows COFF users (UEFI comes to mind).

Awesome, thanks - that clarifies the existing intent and makes it clearer what kind of test to add for this (just adjusting the existing one).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123160



More information about the llvm-commits mailing list