[lld] [LLD][COFF] Align import directory chunk. (PR #80014)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 30 06:54:05 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lld-coff
Author: Jacek Caban (cjacek)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/80014.diff
2 Files Affected:
- (modified) lld/COFF/DLL.cpp (+1-1)
- (modified) lld/test/COFF/pdb-publics-import.test (+3-3)
``````````diff
diff --git a/lld/COFF/DLL.cpp b/lld/COFF/DLL.cpp
index 6b516d8c6d5ef..d0b74ac445499 100644
--- a/lld/COFF/DLL.cpp
+++ b/lld/COFF/DLL.cpp
@@ -110,7 +110,7 @@ class OrdinalOnlyChunk : public NonSectionChunk {
// A chunk for the import descriptor table.
class ImportDirectoryChunk : public NonSectionChunk {
public:
- explicit ImportDirectoryChunk(Chunk *n) : dllName(n) {}
+ explicit ImportDirectoryChunk(Chunk *n) : dllName(n) { setAlignment(4); }
size_t getSize() const override { return sizeof(ImportDirectoryTableEntry); }
void writeTo(uint8_t *buf) const override {
diff --git a/lld/test/COFF/pdb-publics-import.test b/lld/test/COFF/pdb-publics-import.test
index 83f087b662186..3f3ab3662f8f1 100644
--- a/lld/test/COFF/pdb-publics-import.test
+++ b/lld/test/COFF/pdb-publics-import.test
@@ -115,7 +115,7 @@ CHECK-NEXT: characteristics =
CHECK-NEXT: initialized data
CHECK-NEXT: read permissions
CHECK-NEXT: {{[0-9]+}} | S_COFFGROUP [size = 28] `.idata$2`
-CHECK-NEXT: length = 40, addr = 0002:0061
+CHECK-NEXT: length = 40, addr = 0002:0064
CHECK-NEXT: characteristics =
CHECK-NEXT: initialized data
CHECK-NEXT: read permissions
@@ -162,9 +162,9 @@ CHECK-NEXT: SC[.rdata] | mod = 3, 0002:0000, size = 28, data crc = 0, reloc c
CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ
CHECK-NEXT: SC[.rdata] | mod = 3, 0002:0028, size = 33, data crc = 0, reloc crc = 0
CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ
-CHECK-NEXT: SC[.rdata] | mod = 3, 0002:0061, size = 20, data crc = 0, reloc crc = 0
+CHECK-NEXT: SC[.rdata] | mod = 3, 0002:0064, size = 20, data crc = 0, reloc crc = 0
CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ
-CHECK-NEXT: SC[.rdata] | mod = 3, 0002:0081, size = 20, data crc = 0, reloc crc = 0
+CHECK-NEXT: SC[.rdata] | mod = 3, 0002:0084, size = 20, data crc = 0, reloc crc = 0
CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ
CHECK-NEXT: SC[.rdata] | mod = 3, 0002:0104, size = 8, data crc = 0, reloc crc = 0
CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ
``````````
</details>
https://github.com/llvm/llvm-project/pull/80014
More information about the llvm-commits
mailing list