[lld] [LLD][COFF] Align EC code ranges to page boundaries (PR #168222)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 15 10:21:19 PST 2025


================
@@ -946,7 +946,7 @@ void ECCodeMapChunk::writeTo(uint8_t *buf) const {
   auto table = reinterpret_cast<chpe_range_entry *>(buf);
   for (uint32_t i = 0; i < map.size(); i++) {
     const ECCodeMapEntry &entry = map[i];
-    uint32_t start = entry.first->getRVA();
+    uint32_t start = entry.first->getRVA() & ~0xfff;
----------------
mstorsjo wrote:

This looks reasonable, but do we use explicit `0xfff` for page alignment here/elsewhere so far, or do we have some constant for that?

https://github.com/llvm/llvm-project/pull/168222


More information about the llvm-commits mailing list