1 ## Test --add-section. This test dumps and removes the section first and checks
2 ## that adding it back doesn't change the result.
3 # RUN: yaml2obj %s -o %t
4 # RUN: llvm-objcopy --dump-section=producers=%t.sec --remove-section=producers %t %t2
5 # RUN: llvm-objcopy --add-section=producers=%t.sec %t2 %t3
6 # RUN: obj2yaml %t3 | FileCheck %s
8 ## Check that the producers section has been added back unchanged.
9 # CHECK: Name: producers
11 # CHECK-NEXT: - Name: clang
12 # CHECK-NEXT: Version: 9.0.0
14 # Check that the section is replaced with new content in one invocation.
15 # RUN: echo "123" > %t4
16 # RUN: llvm-objcopy --remove-section=foo --add-section=foo=%t4 %t %t5
17 # RUN: obj2yaml %t5 | FileCheck %s --check-prefix=REPLACE
19 # REPLACE: - Type: CUSTOM
21 # REPLACE: Payload: 3132330A
45 - Type: R_WASM_TABLE_INDEX_SLEB
48 - Type: R_WASM_FUNCTION_INDEX_LEB