[llvm] [llvm-dlltool] Handle MIPS architecture (PR #114621)
Hervé Poussineau via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 2 02:29:33 PDT 2024
https://github.com/hpoussin updated https://github.com/llvm/llvm-project/pull/114621
>From d2aed8fdc79f750b842d595a7f1173b7a490fb24 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= <hpoussin at reactos.org>
Date: Sun, 22 Oct 2023 17:10:19 +0200
Subject: [PATCH] [llvm-dlltool] Handle MIPS architecture
---
llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp | 1 +
llvm/test/tools/llvm-dlltool/machine-opt.def | 3 +++
2 files changed, 4 insertions(+)
diff --git a/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp b/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
index 15e4cac08cd4ed..7d1f74c9d4dd6c 100644
--- a/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
+++ b/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
@@ -76,6 +76,7 @@ MachineTypes getEmulation(StringRef S) {
.Case("arm", IMAGE_FILE_MACHINE_ARMNT)
.Case("arm64", IMAGE_FILE_MACHINE_ARM64)
.Case("arm64ec", IMAGE_FILE_MACHINE_ARM64EC)
+ .Case("mips", IMAGE_FILE_MACHINE_R4000)
.Default(IMAGE_FILE_MACHINE_UNKNOWN);
}
diff --git a/llvm/test/tools/llvm-dlltool/machine-opt.def b/llvm/test/tools/llvm-dlltool/machine-opt.def
index 6dce8255a43db3..37eccec8831fc6 100644
--- a/llvm/test/tools/llvm-dlltool/machine-opt.def
+++ b/llvm/test/tools/llvm-dlltool/machine-opt.def
@@ -6,6 +6,8 @@
; RUN: llvm-readobj %t.a | FileCheck --check-prefix=ARM %s
; RUN: llvm-dlltool -m arm64 -d %s -l %t.a
; RUN: llvm-readobj %t.a | FileCheck --check-prefix=ARM64 %s
+; RUN: llvm-dlltool -m mips -d %s -l %t.a
+; RUN: llvm-readobj %t.a | FileCheck --check-prefix=MIPS %s
LIBRARY test.dll
EXPORTS
@@ -15,3 +17,4 @@ TestFunction
; X86_64: Format: COFF-x86-64
; ARM: Format: COFF-ARM{{$}}
; ARM64: Format: COFF-ARM64
+; MIPS: Format: COFF-MIPS
More information about the llvm-commits
mailing list