[llvm-commits] [lld] r169715 - /lld/trunk/lib/Driver/Targets.cpp
Michael J. Spencer
bigcheesegs at gmail.com
Sun Dec 9 15:55:52 PST 2012
Author: mspencer
Date: Sun Dec 9 17:55:52 2012
New Revision: 169715
URL: http://llvm.org/viewvc/llvm-project?rev=169715&view=rev
Log:
[Driver] Make the X86Linux target use X86 (not x64) and properly initalize WriterOptions.
Modified:
lld/trunk/lib/Driver/Targets.cpp
Modified: lld/trunk/lib/Driver/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/Targets.cpp?rev=169715&r1=169714&r2=169715&view=diff
==============================================================================
--- lld/trunk/lib/Driver/Targets.cpp (original)
+++ lld/trunk/lib/Driver/Targets.cpp Sun Dec 9 17:55:52 2012
@@ -26,7 +26,7 @@
class X86LinuxTarget final : public Target {
public:
- X86LinuxTarget(const LinkerOptions &lo) : Target(lo) {
+ X86LinuxTarget(const LinkerOptions &lo) : Target(lo), _woe() {
_readerELF.reset(createReaderELF(_roe, _roa));
_readerYAML.reset(createReaderYAML(_roy));
_writer.reset(createWriterELF(_woe));
@@ -61,7 +61,16 @@
return k;
}
} _roy;
- lld::WriterOptionsELF _woe;
+
+ struct WOpts : lld::WriterOptionsELF {
+ WOpts() {
+ _endianness = llvm::support::little;
+ _is64Bit = false;
+ _type = llvm::ELF::ET_EXEC;
+ _machine = llvm::ELF::EM_386;
+ _entryPoint = "_start";
+ }
+ } _woe;
std::unique_ptr<lld::Reader> _readerELF, _readerYAML;
std::unique_ptr<lld::Writer> _writer;
@@ -69,7 +78,7 @@
std::unique_ptr<Target> Target::create(const LinkerOptions &lo) {
llvm::Triple t(lo._target);
- if (t.getOS() == llvm::Triple::Linux && t.getArch() == llvm::Triple::x86_64)
+ if (t.getOS() == llvm::Triple::Linux && t.getArch() == llvm::Triple::x86)
return std::unique_ptr<Target>(new X86LinuxTarget(lo));
return std::unique_ptr<Target>();
}
More information about the llvm-commits
mailing list