|
1 | | -## Check incompatible options |
| 1 | +## Check incompatible options. |
2 | 2 | # RUN: not llvm-objcopy --remove-note=1 --remove-section=.test - 2>&1 | FileCheck %s --check-prefix=ERR-REMSEC |
3 | 3 | # RUN: not llvm-objcopy --remove-note=1 --add-section=.test=%s - 2>&1 | FileCheck %s --check-prefix=ERR-ADDSEC |
4 | 4 | # RUN: not llvm-objcopy --remove-note=1 --update-section=.test=%s - 2>&1 | FileCheck %s --check-prefix=ERR-UPDSEC |
|
7 | 7 | # ERR-ADDSEC: error: cannot specify both --remove-note and --add-section |
8 | 8 | # ERR-UPDSEC: error: cannot specify both --remove-note and --update-section |
9 | 9 |
|
10 | | -## Check invalid argument formats |
| 10 | +## Check invalid argument formats. |
11 | 11 | # RUN: not llvm-objcopy --remove-note= - 2>&1 | FileCheck %s --check-prefix=ERR-NOTYPEID |
12 | 12 | # RUN: not llvm-objcopy --remove-note=CORE/ - 2>&1 | FileCheck %s --check-prefix=ERR-NOTYPEID |
13 | 13 | # RUN: not llvm-objcopy --remove-note=/1 - 2>&1 | FileCheck %s --check-prefix=ERR-EMPTYNAME |
|
20 | 20 | # ERR-INVNUM1: error: bad note type_id for --remove-note: '1/2' |
21 | 21 | # ERR-INVNUM2: error: bad note type_id for --remove-note: 'Notanumber' |
22 | 22 |
|
| 23 | +## Check deleting notes: |
| 24 | +## * --remove-note=1 will remove note "CORE/1" and "LINUX/1", |
| 25 | +## * --remove-note=DUMMY/2 will not remove any notes because there are no notes with this owner, |
| 26 | +## * --remove-note=CORE/3 will remove "CORE/3" but preserve "LINUX/3". |
23 | 27 | # RUN: yaml2obj -D ALIGN=8 -D ELFCLASS=64 -D ENDIANNESS=LSB %s -o %t8.64.lsb |
24 | 28 | # RUN: llvm-objcopy --remove-note=0x01 --remove-note=DUMMY/2 --remove-note=CORE/0x03 %t8.64.lsb %t8.64.lsb.o |
25 | 29 | # RUN: llvm-readobj --segments --sections --notes %t8.64.lsb.o | \ |
26 | | -# RUN: FileCheck %s -D#SIZE0=32 -D#SIZE1=32 |
| 30 | +# RUN: FileCheck %s -D#SIZE0=32 -D#SIZE1=64 |
27 | 31 |
|
28 | 32 | # RUN: yaml2obj -D ALIGN=4 -D ELFCLASS=64 -D ENDIANNESS=MSB %s -o %t4.64.msb |
29 | 33 | # RUN: llvm-objcopy --remove-note=0x01 --remove-note=DUMMY/0x02 --remove-note=CORE/3 %t4.64.msb %t4.64.msb.o |
30 | 34 | # RUN: llvm-readobj --segments --sections --notes %t4.64.msb.o | \ |
31 | | -# RUN: FileCheck %s -D#SIZE0=24 -D#SIZE1=24 |
| 35 | +# RUN: FileCheck %s -D#SIZE0=24 -D#SIZE1=48 |
32 | 36 |
|
33 | 37 | # RUN: yaml2obj -D ALIGN=4 -D ELFCLASS=32 -D ENDIANNESS=LSB %s -o %t4.32.lsb |
34 | 38 | # RUN: llvm-objcopy --remove-note=1 --remove-note=DUMMY/0x02 --remove-note=CORE/3 %t4.32.lsb %t4.32.lsb.o |
35 | 39 | # RUN: llvm-readobj --segments --sections --notes %t4.32.lsb.o | \ |
36 | | -# RUN: FileCheck %s -D#SIZE0=24 -D#SIZE1=24 |
| 40 | +# RUN: FileCheck %s -D#SIZE0=24 -D#SIZE1=48 |
37 | 41 |
|
38 | 42 | # CHECK: Sections [ |
39 | 43 | # CHECK: Section { |
|
70 | 74 | # CHECK-NEXT: Data size: 0x2 |
71 | 75 | # CHECK-NEXT: Type: NT_ARCH |
72 | 76 | # CHECK-NEXT: Description data ( |
73 | | -# CHECK-NEXT: 0000: 0202 |
| 77 | +# CHECK-NEXT: 0000: 0201 |
74 | 78 | # CHECK-NEXT: ) |
75 | 79 | # CHECK-NEXT: } |
76 | 80 | # CHECK-NEXT: ] |
|
81 | 85 | # CHECK-NEXT: Size: 0x[[#%X,SIZE1]] |
82 | 86 | # CHECK-NEXT: Notes [ |
83 | 87 | # CHECK-NEXT: { |
| 88 | +# CHECK-NEXT: Owner: LINUX |
| 89 | +# CHECK-NEXT: Data size: 0x2 |
| 90 | +# CHECK-NEXT: Type: Unknown (0x00000003) |
| 91 | +# CHECK-NEXT: Description data ( |
| 92 | +# CHECK-NEXT: 0000: 0301 |
| 93 | +# CHECK-NEXT: ) |
| 94 | +# CHECK-NEXT: } |
| 95 | +# CHECK-NEXT: { |
84 | 96 | # CHECK-NEXT: Owner: CORE |
85 | 97 | # CHECK-NEXT: Data size: 0x2 |
86 | 98 | # CHECK-NEXT: Type: Unknown (0x00000004) |
87 | 99 | # CHECK-NEXT: Description data ( |
88 | | -# CHECK-NEXT: 0000: 0404 |
| 100 | +# CHECK-NEXT: 0000: 0401 |
89 | 101 | # CHECK-NEXT: ) |
90 | 102 | # CHECK-NEXT: } |
91 | 103 | # CHECK-NEXT: ] |
@@ -114,22 +126,25 @@ Sections: |
114 | 126 | Desc: 0101 |
115 | 127 | - Name: CORE |
116 | 128 | Type: 0x02 |
117 | | - Desc: 0202 |
| 129 | + Desc: 0201 |
118 | 130 | - Name: .note1 |
119 | 131 | Type: SHT_NOTE |
120 | 132 | AddressAlign: [[ALIGN]] |
121 | 133 | Notes: |
| 134 | + - Name: LINUX |
| 135 | + Type: 0x03 |
| 136 | + Desc: 0301 |
122 | 137 | - Name: CORE |
123 | 138 | Type: 0x03 |
124 | | - Desc: 0303 |
| 139 | + Desc: 0302 |
125 | 140 | - Name: CORE |
126 | 141 | Type: 0x04 |
127 | | - Desc: 0404 |
| 142 | + Desc: 0401 |
128 | 143 | - Name: .note2 |
129 | 144 | Type: SHT_NOTE |
130 | 145 | AddressAlign: [[ALIGN]] |
131 | 146 | Notes: |
132 | 147 | - Name: LINUX |
133 | 148 | Type: 0x01 |
134 | | - Desc: 0505 |
| 149 | + Desc: 0102 |
135 | 150 | ... |
0 commit comments