mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
[Object][ELF] Test unknown type.
llvm-svn: 226943
This commit is contained in:
parent
72bb9f2990
commit
e8e8139d22
@ -30,6 +30,7 @@ ScalarEnumerationTraits<ELFYAML::ELF_ET>::enumeration(IO &IO,
|
||||
ECase(ET_DYN)
|
||||
ECase(ET_CORE)
|
||||
#undef ECase
|
||||
IO.enumFallback<Hex16>(Value);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -960,7 +960,7 @@ file_magic identify_magic(StringRef Magic) {
|
||||
unsigned low = Data2MSB ? 17 : 16;
|
||||
if (Magic[high] == 0)
|
||||
switch (Magic[low]) {
|
||||
default: break;
|
||||
default: return file_magic::elf;
|
||||
case 1: return file_magic::elf_relocatable;
|
||||
case 2: return file_magic::elf_executable;
|
||||
case 3: return file_magic::elf_shared_object;
|
||||
|
10
test/Object/elf-unknown-type.test
Normal file
10
test/Object/elf-unknown-type.test
Normal file
@ -0,0 +1,10 @@
|
||||
# RUN: yaml2obj -format=elf %s | llvm-readobj -file-headers - | FileCheck %s
|
||||
|
||||
!ELF
|
||||
FileHeader: !FileHeader
|
||||
Class: ELFCLASS64
|
||||
Data: ELFDATA2LSB
|
||||
Type: 42
|
||||
Machine: EM_X86_64
|
||||
|
||||
# CHECK: Type: 0x2A
|
Loading…
Reference in New Issue
Block a user