[llvm] [Archive][COFF] Split hybrid COFF files when adding them to an archive (PR #205160)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 27 15:16:45 PDT 2026


================
@@ -0,0 +1,114 @@
+# RUN: yaml2obj %s -o %t.o
+# RUN: rm -f %t.lib
+# RUN: llvm-ar cr %t.lib %t.o
+# RUN: llvm-readobj --sections --hex-dump=.data %t.lib | FileCheck --check-prefix=SEC %s
+
+# SEC:      File: {{.*}}(arm64x-split.yaml.tmp.o)
+# SEC-NEXT: Format: COFF-ARM64
+# SEC-NEXT: Arch: aarch64
+# SEC-NEXT: AddressSize: 64bit
+# SEC-NEXT: Sections [
+# SEC-NEXT:   Section {
+# SEC-NEXT:     Number: 1
+# SEC-NEXT:     Name: .llvm.arm64x (2F 34 00 00 00 00 00 00)
+# SEC-NEXT:     VirtualSize: 0x7A
+# SEC-NEXT:     VirtualAddress: 0x0
+# SEC-NEXT:     RawDataSize: 0
+# SEC-NEXT:     PointerToRawData: 0x0
+# SEC-NEXT:     PointerToRelocations: 0x0
+# SEC-NEXT:     PointerToLineNumbers: 0x0
+# SEC-NEXT:     RelocationCount: 0
+# SEC-NEXT:     LineNumberCount: 0
+# SEC-NEXT:     Characteristics [ (0xC2000040)
+# SEC-NEXT:       IMAGE_SCN_CNT_INITIALIZED_DATA (0x40)
+# SEC-NEXT:       IMAGE_SCN_MEM_DISCARDABLE (0x2000000)
+# SEC-NEXT:       IMAGE_SCN_MEM_READ (0x40000000)
+# SEC-NEXT:       IMAGE_SCN_MEM_WRITE (0x80000000)
+# SEC-NEXT:     ]
+# SEC-NEXT:   }
+# SEC-NEXT:   Section {
+# SEC-NEXT:     Number: 2
+# SEC-NEXT:     Name: .data (2E 64 61 74 61 00 00 00)
+# SEC-NEXT:     VirtualSize: 0x0
+# SEC-NEXT:     VirtualAddress: 0x0
+# SEC-NEXT:     RawDataSize: 4
+# SEC-NEXT:     PointerToRawData: 0x66
+# SEC-NEXT:     PointerToRelocations: 0x0
+# SEC-NEXT:     PointerToLineNumbers: 0x0
+# SEC-NEXT:     RelocationCount: 0
----------------
mstorsjo wrote:

Can we have a section with some relocations too, to make sure that updating those offsets work out correctly too?

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


More information about the llvm-commits mailing list