mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-30 05:36:44 +00:00
Add EM_IAMCU support.
This patch adds "-m elf_iamcu" to ldd for IAMCU psABI: https://github.com/hjl-tools/x86-psABI/wiki/X86-psABI Patch by H.J Lu. llvm-svn: 277643
This commit is contained in:
parent
a6be60871f
commit
6c50990df6
@ -70,6 +70,7 @@ static std::pair<ELFKind, uint16_t> parseEmulation(StringRef S) {
|
||||
.Case("elf64ltsmip", {ELF64LEKind, EM_MIPS})
|
||||
.Case("elf64ppc", {ELF64BEKind, EM_PPC64})
|
||||
.Case("elf_i386", {ELF32LEKind, EM_386})
|
||||
.Case("elf_iamcu", {ELF32LEKind, EM_IAMCU})
|
||||
.Case("elf_x86_64", {ELF64LEKind, EM_X86_64})
|
||||
.Default({ELFNoneKind, EM_NONE});
|
||||
|
||||
|
@ -579,7 +579,7 @@ static uint8_t getMachineKind(MemoryBufferRef MB) {
|
||||
case Triple::ppc64:
|
||||
return EM_PPC64;
|
||||
case Triple::x86:
|
||||
return EM_386;
|
||||
return Triple(TripleStr).isOSIAMCU() ? EM_IAMCU : EM_386;
|
||||
case Triple::x86_64:
|
||||
return EM_X86_64;
|
||||
default:
|
||||
|
@ -214,6 +214,7 @@ public:
|
||||
TargetInfo *createTarget() {
|
||||
switch (Config->EMachine) {
|
||||
case EM_386:
|
||||
case EM_IAMCU:
|
||||
return new X86TargetInfo();
|
||||
case EM_AARCH64:
|
||||
return new AArch64TargetInfo();
|
||||
|
@ -122,6 +122,37 @@
|
||||
# X86FBSD-NEXT: StringTableSectionIndex:
|
||||
# X86FBSD-NEXT: }
|
||||
|
||||
# RUN: llvm-mc -filetype=obj -triple=i586-intel-elfiamcu %s -o %tiamcu
|
||||
# RUN: ld.lld -m elf_iamcu %tiamcu -o %t2iamcu
|
||||
# RUN: llvm-readobj -file-headers %t2iamcu | FileCheck --check-prefix=IAMCU %s
|
||||
# RUN: ld.lld %tiamcu -o %t3iamcu
|
||||
# RUN: llvm-readobj -file-headers %t3iamcu | FileCheck --check-prefix=IAMCU %s
|
||||
# IAMCU: ElfHeader {
|
||||
# IAMCU-NEXT: Ident {
|
||||
# IAMCU-NEXT: Magic: (7F 45 4C 46)
|
||||
# IAMCU-NEXT: Class: 32-bit (0x1)
|
||||
# IAMCU-NEXT: DataEncoding: LittleEndian (0x1)
|
||||
# IAMCU-NEXT: FileVersion: 1
|
||||
# IAMCU-NEXT: OS/ABI: SystemV (0x0)
|
||||
# IAMCU-NEXT: ABIVersion: 0
|
||||
# IAMCU-NEXT: Unused: (00 00 00 00 00 00 00)
|
||||
# IAMCU-NEXT: }
|
||||
# IAMCU-NEXT: Type: Executable (0x2)
|
||||
# IAMCU-NEXT: Machine: EM_IAMCU (0x6)
|
||||
# IAMCU-NEXT: Version: 1
|
||||
# IAMCU-NEXT: Entry:
|
||||
# IAMCU-NEXT: ProgramHeaderOffset: 0x34
|
||||
# IAMCU-NEXT: SectionHeaderOffset:
|
||||
# IAMCU-NEXT: Flags [ (0x0)
|
||||
# IAMCU-NEXT: ]
|
||||
# IAMCU-NEXT: HeaderSize: 52
|
||||
# IAMCU-NEXT: ProgramHeaderEntrySize: 32
|
||||
# IAMCU-NEXT: ProgramHeaderCount:
|
||||
# IAMCU-NEXT: SectionHeaderEntrySize: 40
|
||||
# IAMCU-NEXT: SectionHeaderCount:
|
||||
# IAMCU-NEXT: StringTableSectionIndex:
|
||||
# IAMCU-NEXT: }
|
||||
|
||||
# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %tppc64
|
||||
# RUN: ld.lld -m elf64ppc %tppc64 -o %t2ppc64
|
||||
# RUN: llvm-readobj -file-headers %t2ppc64 | FileCheck --check-prefix=PPC64 %s
|
||||
|
Loading…
x
Reference in New Issue
Block a user