[lld] 1a2cc2b - [ELF] Exclude sizeof(InputSection) to _WIN32

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 23 21:42:27 PST 2024


Author: Fangrui Song
Date: 2024-11-23T21:42:22-08:00
New Revision: 1a2cc2bce86448dfb1c9795a907d28ca2db6aaf5

URL: https://github.com/llvm/llvm-project/commit/1a2cc2bce86448dfb1c9795a907d28ca2db6aaf5
DIFF: https://github.com/llvm/llvm-project/commit/1a2cc2bce86448dfb1c9795a907d28ca2db6aaf5.diff

LOG: [ELF] Exclude sizeof(InputSection) to _WIN32

Structs with delicate packing are often larger in MSVC than Itanium.
099a52fd2f3723db6b0550c99a1adc12d2d8d909 did not make
sizeof(InputSection) smaller for MSVC. Just exclude MSVC.

Added: 
    

Modified: 
    lld/ELF/InputSection.h

Removed: 
    


################################################################################
diff  --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h
index e3b4b387320588..268caa547ffed9 100644
--- a/lld/ELF/InputSection.h
+++ b/lld/ELF/InputSection.h
@@ -475,7 +475,9 @@ class PotentialSpillSection : public InputSection {
   }
 };
 
+#ifndef _WIN32
 static_assert(sizeof(InputSection) <= 152, "InputSection is too big");
+#endif
 
 class SyntheticSection : public InputSection {
 public:


        


More information about the llvm-commits mailing list