aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/X86
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2013-05-10 16:00:11 -0700
committerDerek Schuff <dschuff@chromium.org>2013-05-10 16:00:11 -0700
commit52daf9d821c963f84dd312ff90921bfe1b1cc0a1 (patch)
tree8f94ccf4841f2a0bbfdb19bf3b230f7ad220e8ff /lib/Target/X86
parent42ac59f56fb0d473f84b6be738a64e80b09557d1 (diff)
LLVM: Add ELF Note section to NaCl object files identifying them as such to gold
This is needed to switch the native linker to one based on upstream binutils 2.23 R=mseaborn@chromium.org BUG= https://code.google.com/p/nativeclient/issues/detail?id=2971 also related to bug https://code.google.com/p/nativeclient/issues/detail?id=3424 Review URL: https://codereview.chromium.org/15067009
Diffstat (limited to 'lib/Target/X86')
-rw-r--r--lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp9
-rw-r--r--lib/Target/X86/X86AsmPrinter.cpp6
2 files changed, 7 insertions, 8 deletions
diff --git a/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp b/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
index c67bb944b6..5e84530cd7 100644
--- a/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
+++ b/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
@@ -366,14 +366,7 @@ static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
if (TheTriple.isOSWindows() && TheTriple.getEnvironment() != Triple::ELF)
return createWinCOFFStreamer(Ctx, MAB, *_Emitter, _OS, RelaxAll);
- // @LOCALMOD-BEGIN
- MCStreamer *Streamer = createELFStreamer(Ctx, MAB, _OS, _Emitter,
- RelaxAll, NoExecStack);
- if (TheTriple.isOSNaCl())
- Streamer->EmitBundleAlignMode(5);
-
- return Streamer;
- // @LOCALMOD-END
+ return createELFStreamer(Ctx, MAB, _OS, _Emitter, RelaxAll, NoExecStack);
}
static MCInstPrinter *createX86MCInstPrinter(const Target &T,
diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp
index 2eb75b558b..032d83aac0 100644
--- a/lib/Target/X86/X86AsmPrinter.cpp
+++ b/lib/Target/X86/X86AsmPrinter.cpp
@@ -31,6 +31,7 @@
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
+#include "llvm/MC/MCNaCl.h"
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
@@ -547,6 +548,11 @@ bool X86AsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
void X86AsmPrinter::EmitStartOfAsmFile(Module &M) {
if (Subtarget->isTargetEnvMacho())
OutStreamer.SwitchSection(getObjFileLowering().getTextSection());
+ // @LOCALMOD-BEGIN
+ if (Subtarget->isTargetNaCl())
+ initializeNaClMCStreamer(OutStreamer, OutContext,
+ Subtarget->getTargetTriple());
+ // @LOCALMOD-END
}