[all-commits] [llvm/llvm-project] dec078: [LLD][COFF] Always locate the IAT at the beginning...

Jacek Caban via All-commits all-commits at lists.llvm.org
Sun Sep 8 06:36:45 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dec0781c8b06b1a5b8ad8646d299f643745a36d0
      https://github.com/llvm/llvm-project/commit/dec0781c8b06b1a5b8ad8646d299f643745a36d0
  Author: Jacek Caban <jacek at codeweavers.com>
  Date:   2024-09-08 (Sun, 08 Sep 2024)

  Changed paths:
    M lld/COFF/Writer.cpp
    M lld/test/COFF/arm64ec-import.test

  Log Message:
  -----------
  [LLD][COFF] Always locate the IAT at the beginning of the .rdata section and align its size to 4KB on ARM64EC. (#107588)

This mimics the behavior of MSVC's link.exe. My guess is that the reason
for this approach is to facilitate tracking runtime IAT modifications.
An auxiliary IAT allows bypassing the call checker for imported function
calls. It's the OS's responsibility to ensure that, if runtime patching
occurs, the auxiliary IAT is reverted to enable call checking. Modifying
the IAT is a form of runtime patching, and ensuring that it doesn’t
share pages with other data likely helps with tracking accuracy.

Although alignment alone should ensure that the IAT occupies its own
pages, placing it at the beginning of the .rdata section might be an
optimization. This way, padding is only needed after the IAT, not
before. The auxiliary IAT seems to follow a similar idea but is
positioned at the end of the .rdata section.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list