[all-commits] [llvm/llvm-project] 77c325: [LLD][COFF] Keep hasData true in NullChunk constru...

Jacek Caban via All-commits all-commits at lists.llvm.org
Sat Jan 25 13:20:55 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 77c325b646301e394bcd89c2980b4c2da8af49cd
      https://github.com/llvm/llvm-project/commit/77c325b646301e394bcd89c2980b4c2da8af49cd
  Author: Jacek Caban <jacek at codeweavers.com>
  Date:   2025-01-25 (Sat, 25 Jan 2025)

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

  Log Message:
  -----------
  [LLD][COFF] Keep hasData true in NullChunk constructor (#124368)

`NullChunk` instances do write data, even if it's always zero. Setting
`hasData` to false causes `Writer::assignAddresses` to ignore them
when calculating `rawSize`. This typically isn't an issue, as null chunks
are usually positioned within a section, and later chunks adjust the
size accordingly.

However, on ARM64EC, the auxiliary IAT is placed at the end of the
`.rdata` section and terminates with a null chunk. As a result, `rawSize`
is never updated to account for it, and space for the null chunk is not
allocated. Consequently, when `NullChunk::writeTo` is called, it receives
an invalid pointer - either pointing to the next section or beyond the
allocated buffer.



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