[lld] r246336 - [Mips] Support two more MIPS linking emulation options elf32btsmipn32/elf32ltsmipn32
Simon Atanasyan via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 28 14:39:13 PDT 2015
Author: atanasyan
Date: Fri Aug 28 16:39:13 2015
New Revision: 246336
URL: http://llvm.org/viewvc/llvm-project?rev=246336&view=rev
Log:
[Mips] Support two more MIPS linking emulation options elf32btsmipn32/elf32ltsmipn32
Modified:
lld/trunk/lib/Driver/GnuLdDriver.cpp
lld/trunk/unittests/DriverTests/GnuLdDriverTest.cpp
Modified: lld/trunk/lib/Driver/GnuLdDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/GnuLdDriver.cpp?rev=246336&r1=246335&r2=246336&view=diff
==============================================================================
--- lld/trunk/lib/Driver/GnuLdDriver.cpp (original)
+++ lld/trunk/lib/Driver/GnuLdDriver.cpp Fri Aug 28 16:39:13 2015
@@ -169,8 +169,8 @@ getArchType(const llvm::Triple &triple,
case llvm::Triple::mips64:
case llvm::Triple::mips64el:
return llvm::StringSwitch<llvm::Optional<llvm::Triple::ArchType>>(value)
- .Case("elf32btsmip", llvm::Triple::mips)
- .Case("elf32ltsmip", llvm::Triple::mipsel)
+ .Cases("elf32btsmip", "elf32btsmipn32", llvm::Triple::mips)
+ .Cases("elf32ltsmip", "elf32ltsmipn32", llvm::Triple::mipsel)
.Case("elf64btsmip", llvm::Triple::mips64)
.Case("elf64ltsmip", llvm::Triple::mips64el)
.Default(llvm::None);
Modified: lld/trunk/unittests/DriverTests/GnuLdDriverTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/unittests/DriverTests/GnuLdDriverTest.cpp?rev=246336&r1=246335&r2=246336&view=diff
==============================================================================
--- lld/trunk/unittests/DriverTests/GnuLdDriverTest.cpp (original)
+++ lld/trunk/unittests/DriverTests/GnuLdDriverTest.cpp Fri Aug 28 16:39:13 2015
@@ -207,6 +207,12 @@ TEST_F(GnuLdParserTest, Emulation) {
EXPECT_TRUE(
parse("mips64el-linux-gnu-ld", "a.o", "-m", "elf32btsmip", nullptr));
EXPECT_EQ(Triple::mips, _ctx->getTriple().getArch());
+ EXPECT_TRUE(
+ parse("mipsel-linux-gnu-ld", "a.o", "-m", "elf32btsmipn32", nullptr));
+ EXPECT_EQ(Triple::mips, _ctx->getTriple().getArch());
+ EXPECT_TRUE(
+ parse("mips-linux-gnu-ld", "a.o", "-m", "elf32ltsmipn32", nullptr));
+ EXPECT_EQ(Triple::mipsel, _ctx->getTriple().getArch());
}
// Linker script
More information about the llvm-commits
mailing list