[llvm] [llvm-objcopy] Add --gap-fill and --pad-to options (PR #65815)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 4 08:57:20 PDT 2023
================
@@ -1,39 +1,32 @@
-# RUN: yaml2obj %s > %t
+# RUN: yaml2obj %s -o %t
-## Verify section headers before we perform several testings.
-# RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=ORG-SHDR
-# ORG-SHDR: Section Headers:
-# ORG-SHDR: [Nr] Name Type Address Off Size ES Flg Lk Inf Al
-# ORG-SHDR: [ 0] NULL 0000000000000000 000000 000000 00 0 0 0
-# ORG-SHDR: [ 1] .nogap PROGBITS 0000000000000102 000042 000006 00 A 0 0 1
-# ORG-SHDR: [ 2] .gap1 PROGBITS 0000000000000108 000048 000007 00 AX 0 0 1
-# ORG-SHDR: [ 3] .gap2 PROGBITS 0000000000000110 000050 000004 00 A 0 0 1
-# ORG-SHDR: [ 4] .nobit_tbss NOBITS 0000000000000180 000058 000018 00 WAT 0 0 8
-# ORG-SHDR: [ 5] .foo PROGBITS 0000000000000184 00005c 000004 00 WA 0 0 1
-# ORG-SHDR: [ 6] .nobit_bss NOBITS 000000000000018a 000060 000008 00 WA 0 0 1
+## This test is partially based on one from D67689.
# RUN: not llvm-objcopy --gap-fill 1 %t 2>&1 | FileCheck %s --check-prefix=NOT-BINARY
# NOT-BINARY: error: '--gap-fill' is only supported for binary output
# RUN: not llvm-objcopy -O binary --gap-fill %t 2>&1 | FileCheck %s --check-prefix=EMPTY
-# EMPTY: no input file specified
+# EMPTY: error: no input file specified
# RUN: not llvm-objcopy -O binary --gap-fill= %t 2>&1 | FileCheck %s --check-prefix=BAD-FORMAT
-# BAD-FORMAT: bad number for --gap-fill:
+# BAD-FORMAT: error: --gap-fill: bad number:
# RUN: not llvm-objcopy -O binary --gap-fill=x %t 2>&1 | FileCheck %s --check-prefix=BAD-INPUT
-# BAD-INPUT: bad number for --gap-fill: x
+# BAD-INPUT: error: --gap-fill: bad number: x
# RUN: not llvm-objcopy -O binary --gap-fill=0x1G %t 2>&1 | FileCheck %s --check-prefix=BAD-INPUT2
-# BAD-INPUT2: bad number for --gap-fill: 0x1G
+# BAD-INPUT2: error: --gap-fill: bad number: 0x1G
-# RUN: not llvm-objcopy -O binary --gap-fill=0x1122 %t %t-val16 2>&1 | FileCheck %s --check-prefix=BAD-INPUT3
-# BAD-INPUT3: bad number for --gap-fill: 0x1122
+# RUN: not llvm-objcopy -O binary --gap-fill=ff %t 2>&1 | FileCheck %s --check-prefix=BAD-INPUT3
+# BAD-INPUT3: error: --gap-fill: bad number: ff
-# Test no gap fill gap fill with all allocatable output sections
+# RUN: llvm-objcopy -O binary --gap-fill=0x1122 %t %t-val16 2>&1 | FileCheck %s --check-prefix=TRUNCATED
----------------
quic-akaryaki wrote:
Done.
https://github.com/llvm/llvm-project/pull/65815
More information about the llvm-commits
mailing list