1 # RUN: yaml2obj %s -o %t
4 # RUN: llvm-objcopy --set-start 0x1000 %t %t2
5 # RUN: llvm-readobj --file-headers %t2 | FileCheck %s --check-prefix=SET
6 # RUN: llvm-objcopy --set-start 4096 %t %t3
8 # RUN: llvm-objcopy --set-start 0x100000000 %t %t4
9 # RUN: llvm-readobj --file-headers %t4 | FileCheck %s --check-prefix=SET-LARGE
10 # RUN: not llvm-objcopy --set-start -123 %t %t5 2>&1 | FileCheck %s --check-prefix=SET-ERR
12 # Test --change-start.
13 # RUN: llvm-objcopy --change-start 0x50 %t %t6
14 # RUN: llvm-readobj --file-headers %t6 | FileCheck %s --check-prefix=ADD
15 # RUN: llvm-objcopy --change-start 0x100000000 %t %t7
16 # RUN: llvm-readobj --file-headers %t7 | FileCheck %s --check-prefix=ADD-LARGE
17 # RUN: llvm-objcopy --change-start -128 %t %t8
18 # RUN: llvm-readobj --file-headers %t8 | FileCheck %s --check-prefix=SUB
19 # RUN: llvm-objcopy --change-start -4353 %t %t9
20 # RUN: llvm-readobj --file-headers %t9 | FileCheck %s --check-prefix=ADD-UNDERFLOW
21 # RUN: llvm-objcopy --change-start -0x1101 %t %t10
23 # RUN: not llvm-objcopy --change-start -xyz %t %t11 2>&1 | FileCheck %s --check-prefix=ADD-ERR
25 # Test --change-start after --set-start. Result should be 0x1150.
26 # RUN: llvm-objcopy --set-start 0x1000 --change-start 0x100 --change-start 0x50 %t %t12
29 # If --set-start is after --change-start then --change-start has no effect.
30 # RUN: llvm-objcopy --change-start 0x150 --set-start 0x1000 %t %t13
33 # --adjust-start is an alias for --change-start.
34 # RUN: llvm-objcopy --adjust-start -0x1101 %t %t14
47 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
49 AddressAlign: 0x0000000000001000
55 # SET-ERR: error: bad entry point address: '-123'
56 # SET-LARGE: Entry: 0x100000000
57 # ADD-LARGE: Entry: 0x100001100
58 # ADD-ERR: error: bad entry point increment: '-xyz'
59 # ADD-UNDERFLOW: Entry: 0xFFFFFFFFFFFFFFFF