[llvm] [llvm-objcopy] Allow -p on COFF targets (PR #171237)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 11 00:26:24 PST 2025
================
@@ -0,0 +1,48 @@
+## Note: ls -l prints the modified timestamp
+
+## Preserve dates when stripping to an output file.
+# RUN: yaml2obj %s -o %t.1.exe
+# RUN: touch -m -t 199705050555.55 %t.1.exe
+# RUN: llvm-strip -p %t.1.exe -o %t-preserved.1.exe
+# RUN: ls -l %t-preserved.1.exe | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
+# Check that the stripped output is in fact a valid object file.
+# RUN: llvm-readobj --headers %t-preserved.1.exe | FileCheck %s
+
+## Preserve dates available via objcopy interface as well.
+# RUN: yaml2obj %s -o %t.2.exe
----------------
jh7370 wrote:
Optional nit: if this were being written from scratch rather than adapting an existing test, I'd say the extra yaml2obj invocations are unnecessary and instead we should copy and reuse the input before invoking llvm-objcopy/llvm-strip on it, as that's slightly more efficient. However, I'm not that fussed, so if you prefer to leave as-is, that's fine by me too.
https://github.com/llvm/llvm-project/pull/171237
More information about the llvm-commits
mailing list