Skip to content

Commit 9110b2c

Browse files
committed
Move tests from 'remove-note-unsupported.test' to 'remove-note.test'
1 parent b1957e7 commit 9110b2c

File tree

2 files changed

+52
-51
lines changed

2 files changed

+52
-51
lines changed

llvm/test/tools/llvm-objcopy/ELF/remove-note-unsupported.test

Lines changed: 0 additions & 47 deletions
This file was deleted.

llvm/test/tools/llvm-objcopy/ELF/remove-note.test

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@
2424
## * --remove-note=1 will remove note "CORE/1" and "LINUX/1",
2525
## * --remove-note=DUMMY/2 will not remove any notes because there are no notes with this owner,
2626
## * --remove-note=CORE/3 will remove "CORE/3" but preserve "LINUX/3".
27-
# RUN: yaml2obj -D ALIGN=8 -D ELFCLASS=64 -D ENDIANNESS=LSB %s -o %t8.64.lsb
27+
# RUN: yaml2obj --docnum=1 -D ALIGN=8 -D ELFCLASS=64 -D ENDIANNESS=LSB %s -o %t8.64.lsb
2828
# RUN: llvm-objcopy --remove-note=0x01 --remove-note=DUMMY/2 --remove-note=CORE/0x03 %t8.64.lsb %t8.64.lsb.o
2929
# RUN: llvm-readobj --segments --sections --notes %t8.64.lsb.o | \
3030
# RUN: FileCheck %s -D#SIZE0=32 -D#SIZE1=64
3131

32-
# RUN: yaml2obj -D ALIGN=4 -D ELFCLASS=64 -D ENDIANNESS=MSB %s -o %t4.64.msb
32+
# RUN: yaml2obj --docnum=1 -D ALIGN=4 -D ELFCLASS=64 -D ENDIANNESS=MSB %s -o %t4.64.msb
3333
# RUN: llvm-objcopy --remove-note=0x01 --remove-note=DUMMY/0x02 --remove-note=CORE/3 %t4.64.msb %t4.64.msb.o
3434
# RUN: llvm-readobj --segments --sections --notes %t4.64.msb.o | \
3535
# RUN: FileCheck %s -D#SIZE0=24 -D#SIZE1=48
3636

37-
# RUN: yaml2obj -D ALIGN=4 -D ELFCLASS=32 -D ENDIANNESS=LSB %s -o %t4.32.lsb
37+
# RUN: yaml2obj --docnum=1 -D ALIGN=4 -D ELFCLASS=32 -D ENDIANNESS=LSB %s -o %t4.32.lsb
3838
# RUN: llvm-objcopy --remove-note=1 --remove-note=DUMMY/0x02 --remove-note=CORE/3 %t4.32.lsb %t4.32.lsb.o
3939
# RUN: llvm-readobj --segments --sections --notes %t4.32.lsb.o | \
4040
# RUN: FileCheck %s -D#SIZE0=24 -D#SIZE1=48
@@ -147,4 +147,52 @@ Sections:
147147
- Name: LINUX
148148
Type: 0x01
149149
Desc: 0102
150-
...
150+
151+
# RUN: yaml2obj --docnum=2 %s -o %t2
152+
# RUN: llvm-objcopy --remove-note=1 %t2 %t2o 2>&1 | FileCheck %s --check-prefix=TEST2
153+
# TEST2: warning: note segments are not supported
154+
# TEST2-NOT: note segments are not supported
155+
156+
--- !ELF
157+
FileHeader:
158+
Class: ELFCLASS64
159+
Data: ELFDATA2LSB
160+
Type: ET_CORE
161+
Machine: EM_X86_64
162+
ProgramHeaders:
163+
- Type: PT_NOTE
164+
FirstSec: .data0
165+
LastSec: .data0
166+
- Type: PT_NOTE
167+
FirstSec: .data1
168+
LastSec: .data1
169+
Sections:
170+
- Name: .data0
171+
Type: Fill
172+
Size: 8
173+
- Name: .data1
174+
Type: Fill
175+
Size: 8
176+
177+
# RUN: yaml2obj --docnum=3 %s -o %t3
178+
# RUN: llvm-objcopy --remove-note=1 %t3 %t3o 2>&1 | FileCheck %s --check-prefix=TEST3
179+
# TEST3: warning: cannot remove note(s) from .note: sections in segments are not supported
180+
181+
--- !ELF
182+
FileHeader:
183+
Class: ELFCLASS64
184+
Data: ELFDATA2LSB
185+
Type: ET_EXEC
186+
Machine: EM_X86_64
187+
ProgramHeaders:
188+
- Type: PT_LOAD
189+
FirstSec: .note
190+
LastSec: .note
191+
Sections:
192+
- Name: .note
193+
Type: SHT_NOTE
194+
AddressAlign: 4
195+
Notes:
196+
- Name: ABC
197+
Type: 1
198+
Desc: 0102

0 commit comments

Comments
 (0)