Skip to content

Commit 523560e

Browse files
committed
[llvm-objcopy] Add test to check that architecture specific values are not used on wrong architecture.
This change adds a test that checks the an error is produced when a hexagon specific reserved section index is used but e_machine is not EM_HEXAGON. Differential Revision: https://reviews.llvm.org/D38017 llvm-svn: 313661
1 parent affd201 commit 523560e

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# RUN: yaml2obj %s > %t
2+
# RUN: not llvm-objcopy %t %t2 2>&1 >/dev/null | FileCheck %s
3+
4+
!ELF
5+
FileHeader:
6+
Class: ELFCLASS64
7+
Data: ELFDATA2LSB
8+
Type: ET_EXEC
9+
Machine: EM_X86_64
10+
Symbols:
11+
Global:
12+
- Name: test
13+
Index: SHN_HEXAGON_SCOMMON
14+
15+
# CHECK: Symbol 'test' has unsupported value greater than or equal to SHN_LORESERVE: 65280

llvm/test/tools/llvm-objcopy/section-index-unsupported.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ Symbols:
1212
- Name: test
1313
Index: 0xff05
1414

15-
# CHECK: [[_:.*]] Symbol 'test' has unsupported value greater than or equal to SHN_LORESERVE: 65285
15+
# CHECK: Symbol 'test' has unsupported value greater than or equal to SHN_LORESERVE: 65285

0 commit comments

Comments
 (0)