[lld] [LLD][COFF] Keep hasData true in NullChunk constructor (PR #124368)
Jacek Caban via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 25 05:45:56 PST 2025
cjacek wrote:
In `NullChunk::writeTo`, we do write data using `memset`. However, we don't allocate space for that data in `Writer::assignAddresses`, meaning the pointer passed later to `writeTo` is invalid, it either points to the next section or beyond the allocated buffer.
To create behavior similar to `.bss`, we'd need to remove the `memset` call, but that's not what MSVC does. In most cases, this would save only 8 bytes, which doesn't seem worth diverging from MSVC. In the specific problematic ARM64X test, the entire auxiliary IAT consists only of null chunks, and the first one has a 0x1000 alignment, which could result in larger savings. However, this is a corner case.
https://github.com/llvm/llvm-project/pull/124368
More information about the llvm-commits
mailing list