summaryrefslogtreecommitdiff
path: root/lib/Target/X86
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/X86')
-rw-r--r--lib/Target/X86/X86.h4
-rw-r--r--lib/Target/X86/X86ELFDynamic.cpp3
-rw-r--r--lib/Target/X86/X86ELFDynamic.h4
-rw-r--r--lib/Target/X86/X86ELFMCLinker.h4
-rw-r--r--lib/Target/X86/X86GNUInfo.h4
-rw-r--r--lib/Target/X86/X86GOT.h4
-rw-r--r--lib/Target/X86/X86GOTPLT.h4
-rw-r--r--lib/Target/X86/X86LDBackend.cpp34
-rw-r--r--lib/Target/X86/X86LDBackend.h17
-rw-r--r--lib/Target/X86/X86PLT.cpp42
-rw-r--r--lib/Target/X86/X86PLT.h14
-rw-r--r--lib/Target/X86/X86Relocator.cpp236
-rw-r--r--lib/Target/X86/X86Relocator.h4
-rw-r--r--lib/Target/X86/X86TargetMachine.h4
14 files changed, 187 insertions, 191 deletions
diff --git a/lib/Target/X86/X86.h b/lib/Target/X86/X86.h
index 5927f44..5090a67 100644
--- a/lib/Target/X86/X86.h
+++ b/lib/Target/X86/X86.h
@@ -6,8 +6,8 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#ifndef MCLD_TARGET_X86_H
-#define MCLD_TARGET_X86_H
+#ifndef TARGET_X86_X86_H
+#define TARGET_X86_X86_H
#include <string>
namespace llvm {
diff --git a/lib/Target/X86/X86ELFDynamic.cpp b/lib/Target/X86/X86ELFDynamic.cpp
index c74cc13..74611c5 100644
--- a/lib/Target/X86/X86ELFDynamic.cpp
+++ b/lib/Target/X86/X86ELFDynamic.cpp
@@ -33,6 +33,5 @@ void X86ELFDynamic::applyTargetEntries(const ELFFileFormat& pFormat)
{
// applyPLTGOT
if (pFormat.hasGOTPLT())
- applyOne(llvm::ELF::DT_PLTGOT, pFormat.getGOTPLT().addr());
+ applyOne(llvm::ELF::DT_PLTGOT, pFormat.getGOTPLT().addr());
}
-
diff --git a/lib/Target/X86/X86ELFDynamic.h b/lib/Target/X86/X86ELFDynamic.h
index e3d5338..aac3482 100644
--- a/lib/Target/X86/X86ELFDynamic.h
+++ b/lib/Target/X86/X86ELFDynamic.h
@@ -6,8 +6,8 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#ifndef MCLD_X86_ELFDYNAMIC_SECTION_H
-#define MCLD_X86_ELFDYNAMIC_SECTION_H
+#ifndef TARGET_X86_X86ELFDYNAMIC_H
+#define TARGET_X86_X86ELFDYNAMIC_H
#ifdef ENABLE_UNITTEST
#include <gtest.h>
#endif
diff --git a/lib/Target/X86/X86ELFMCLinker.h b/lib/Target/X86/X86ELFMCLinker.h
index 4b64d28..9dfe0e7 100644
--- a/lib/Target/X86/X86ELFMCLinker.h
+++ b/lib/Target/X86/X86ELFMCLinker.h
@@ -6,8 +6,8 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#ifndef X86_ELFSECTLINKER_H
-#define X86_ELFSECTLINKER_H
+#ifndef TARGET_X86_X86ELFMCLINKER_H
+#define TARGET_X86_X86ELFMCLINKER_H
#ifdef ENABLE_UNITTEST
#include <gtest.h>
#endif
diff --git a/lib/Target/X86/X86GNUInfo.h b/lib/Target/X86/X86GNUInfo.h
index 65b0451..da4cb24 100644
--- a/lib/Target/X86/X86GNUInfo.h
+++ b/lib/Target/X86/X86GNUInfo.h
@@ -6,8 +6,8 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#ifndef MCLD_TARGET_X86_GNU_INFO_H
-#define MCLD_TARGET_X86_GNU_INFO_H
+#ifndef TARGET_X86_X86GNUINFO_H
+#define TARGET_X86_X86GNUINFO_H
#include <mcld/Target/GNUInfo.h>
#include <llvm/Support/ELF.h>
diff --git a/lib/Target/X86/X86GOT.h b/lib/Target/X86/X86GOT.h
index 67c3163..91647b9 100644
--- a/lib/Target/X86/X86GOT.h
+++ b/lib/Target/X86/X86GOT.h
@@ -6,8 +6,8 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#ifndef MCLD_TARGET_X86_GOT_H
-#define MCLD_TARGET_X86_GOT_H
+#ifndef TARGET_X86_X86GOT_H
+#define TARGET_X86_X86GOT_H
#ifdef ENABLE_UNITTEST
#include <gtest.h>
#endif
diff --git a/lib/Target/X86/X86GOTPLT.h b/lib/Target/X86/X86GOTPLT.h
index 8e13fac..0c12388 100644
--- a/lib/Target/X86/X86GOTPLT.h
+++ b/lib/Target/X86/X86GOTPLT.h
@@ -6,8 +6,8 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#ifndef MCLD_X86_GOTPLT_H
-#define MCLD_X86_GOTPLT_H
+#ifndef TARGET_X86_X86GOTPLT_H
+#define TARGET_X86_X86GOTPLT_H
#ifdef ENABLE_UNITTEST
#include <gtest.h>
#endif
diff --git a/lib/Target/X86/X86LDBackend.cpp b/lib/Target/X86/X86LDBackend.cpp
index 04e858c..f105dd3 100644
--- a/lib/Target/X86/X86LDBackend.cpp
+++ b/lib/Target/X86/X86LDBackend.cpp
@@ -34,8 +34,8 @@ using namespace mcld;
// X86GNULDBackend
//===----------------------------------------------------------------------===//
X86GNULDBackend::X86GNULDBackend(const LinkerConfig& pConfig,
- GNUInfo* pInfo,
- Relocation::Type pCopyRel)
+ GNUInfo* pInfo,
+ Relocation::Type pCopyRel)
: GNULDBackend(pConfig, pInfo),
m_pRelocator(NULL),
m_pPLT(NULL),
@@ -132,8 +132,7 @@ const X86ELFDynamic& X86GNULDBackend::dynamic() const
return *m_pDynamic;
}
-void X86GNULDBackend::defineGOTSymbol(IRBuilder& pBuilder,
- Fragment& pFrag)
+void X86GNULDBackend::defineGOTSymbol(IRBuilder& pBuilder, Fragment& pFrag)
{
// define symbol _GLOBAL_OFFSET_TABLE_
if (m_pGOTSymbol != NULL) {
@@ -345,7 +344,7 @@ void X86GNULDBackend::doCreateProgramHdrs(Module& pModule)
}
X86_32GNULDBackend::X86_32GNULDBackend(const LinkerConfig& pConfig,
- GNUInfo* pInfo)
+ GNUInfo* pInfo)
: X86GNULDBackend(pConfig, pInfo, llvm::ELF::R_386_COPY),
m_pGOT (NULL),
m_pGOTPLT (NULL) {
@@ -366,7 +365,7 @@ bool X86_32GNULDBackend::initRelocator()
}
void X86_32GNULDBackend::initTargetSections(Module& pModule,
- ObjectBuilder& pBuilder)
+ ObjectBuilder& pBuilder)
{
if (LinkerConfig::Object != config().codeGenType()) {
ELFFileFormat* file_format = getOutputFormat();
@@ -381,9 +380,7 @@ void X86_32GNULDBackend::initTargetSections(Module& pModule,
// initialize .plt
LDSection& plt = file_format->getPLT();
plt.setAlign(16u);
- m_pPLT = new X86_32PLT(plt,
- *m_pGOTPLT,
- config());
+ m_pPLT = new X86_32PLT(plt, *m_pGOTPLT, config());
// initialize .rel.plt
LDSection& relplt = file_format->getRelPlt();
@@ -524,7 +521,7 @@ uint64_t X86_32GNULDBackend::emitGOTSectionData(MemoryRegion& pRegion) const
}
uint64_t X86_32GNULDBackend::emitGOTPLTSectionData(MemoryRegion& pRegion,
- const ELFFileFormat* FileFormat) const
+ const ELFFileFormat* FileFormat) const
{
assert(m_pGOTPLT && "emitGOTPLTSectionData failed, m_pGOTPLT is NULL!");
m_pGOTPLT->applyGOT0(FileFormat->getDynamic().addr());
@@ -547,7 +544,7 @@ uint64_t X86_32GNULDBackend::emitGOTPLTSectionData(MemoryRegion& pRegion,
}
X86_64GNULDBackend::X86_64GNULDBackend(const LinkerConfig& pConfig,
- GNUInfo* pInfo)
+ GNUInfo* pInfo)
: X86GNULDBackend(pConfig, pInfo, llvm::ELF::R_X86_64_COPY),
m_pGOT (NULL),
m_pGOTPLT (NULL) {
@@ -659,7 +656,7 @@ void X86_64GNULDBackend::setRelPLTSize()
}
void X86_64GNULDBackend::initTargetSections(Module& pModule,
- ObjectBuilder& pBuilder)
+ ObjectBuilder& pBuilder)
{
if (LinkerConfig::Object != config().codeGenType()) {
ELFFileFormat* file_format = getOutputFormat();
@@ -674,9 +671,7 @@ void X86_64GNULDBackend::initTargetSections(Module& pModule,
// initialize .plt
LDSection& plt = file_format->getPLT();
plt.setAlign(16u);
- m_pPLT = new X86_64PLT(plt,
- *m_pGOTPLT,
- config());
+ m_pPLT = new X86_64PLT(plt, *m_pGOTPLT, config());
// initialize .rela.plt
LDSection& relplt = file_format->getRelaPlt();
@@ -725,8 +720,9 @@ uint64_t X86_64GNULDBackend::emitGOTSectionData(MemoryRegion& pRegion) const
return RegionSize;
}
-uint64_t X86_64GNULDBackend::emitGOTPLTSectionData(MemoryRegion& pRegion,
- const ELFFileFormat* FileFormat) const
+uint64_t
+X86_64GNULDBackend::emitGOTPLTSectionData(MemoryRegion& pRegion,
+ const ELFFileFormat* FileFormat) const
{
assert(m_pGOTPLT && "emitGOTPLTSectionData failed, m_pGOTPLT is NULL!");
m_pGOTPLT->applyGOT0(FileFormat->getDynamic().addr());
@@ -774,10 +770,10 @@ TargetLDBackend* createX86LDBackend(const LinkerConfig& pConfig)
llvm::Triple::ArchType arch = pConfig.targets().triple().getArch();
if (arch == llvm::Triple::x86)
return new X86_32GNULDBackend(pConfig,
- new X86_32GNUInfo(pConfig.targets().triple()));
+ new X86_32GNUInfo(pConfig.targets().triple()));
assert (arch == llvm::Triple::x86_64);
return new X86_64GNULDBackend(pConfig,
- new X86_64GNUInfo(pConfig.targets().triple()));
+ new X86_64GNUInfo(pConfig.targets().triple()));
}
} // namespace of mcld
diff --git a/lib/Target/X86/X86LDBackend.h b/lib/Target/X86/X86LDBackend.h
index 4ef5311..779c2d1 100644
--- a/lib/Target/X86/X86LDBackend.h
+++ b/lib/Target/X86/X86LDBackend.h
@@ -6,8 +6,8 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#ifndef X86_LDBACKEND_H
-#define X86_LDBACKEND_H
+#ifndef TARGET_X86_X86LDBACKEND_H
+#define TARGET_X86_X86LDBACKEND_H
#include "X86ELFDynamic.h"
#include "X86GOT.h"
@@ -29,8 +29,8 @@ class X86GNULDBackend : public GNULDBackend
{
public:
X86GNULDBackend(const LinkerConfig& pConfig,
- GNUInfo* pInfo,
- Relocation::Type pCopyRel);
+ GNUInfo* pInfo,
+ Relocation::Type pCopyRel);
~X86GNULDBackend();
@@ -124,8 +124,9 @@ private:
virtual uint64_t emitGOTSectionData(MemoryRegion& pRegion) const = 0;
- virtual uint64_t emitGOTPLTSectionData(MemoryRegion& pRegion,
- const ELFFileFormat* FileFormat) const = 0;
+ virtual uint64_t
+ emitGOTPLTSectionData(MemoryRegion& pRegion,
+ const ELFFileFormat* FileFormat) const = 0;
virtual void setRelDynSize() = 0;
virtual void setRelPLTSize() = 0;
@@ -182,7 +183,7 @@ private:
uint64_t emitGOTSectionData(MemoryRegion& pRegion) const;
uint64_t emitGOTPLTSectionData(MemoryRegion& pRegion,
- const ELFFileFormat* FileFormat) const;
+ const ELFFileFormat* FileFormat) const;
void setRelDynSize();
void setRelPLTSize();
@@ -225,7 +226,7 @@ private:
uint64_t emitGOTSectionData(MemoryRegion& pRegion) const;
uint64_t emitGOTPLTSectionData(MemoryRegion& pRegion,
- const ELFFileFormat* FileFormat) const;
+ const ELFFileFormat* FileFormat) const;
void setRelDynSize();
void setRelPLTSize();
diff --git a/lib/Target/X86/X86PLT.cpp b/lib/Target/X86/X86PLT.cpp
index d73693b..09b25c4 100644
--- a/lib/Target/X86/X86PLT.cpp
+++ b/lib/Target/X86/X86PLT.cpp
@@ -54,9 +54,7 @@ X86_64PLT1::X86_64PLT1(SectionData& pParent)
//===----------------------------------------------------------------------===//
// X86PLT
//===----------------------------------------------------------------------===//
-X86PLT::X86PLT(LDSection& pSection,
- const LinkerConfig& pConfig,
- int got_size)
+X86PLT::X86PLT(LDSection& pSection, const LinkerConfig& pConfig, int got_size)
: PLT(pSection),
m_Config(pConfig)
{
@@ -71,7 +69,7 @@ X86PLT::X86PLT(LDSection& pSection,
m_PLT0Size = sizeof (x86_32_dyn_plt0);
m_PLT1Size = sizeof (x86_32_dyn_plt1);
// create PLT0
- new X86_32DynPLT0(*m_SectionData);
+ new X86_32DynPLT0(*m_pSectionData);
}
else {
m_PLT0 = x86_32_exec_plt0;
@@ -79,7 +77,7 @@ X86PLT::X86PLT(LDSection& pSection,
m_PLT0Size = sizeof (x86_32_exec_plt0);
m_PLT1Size = sizeof (x86_32_exec_plt1);
// create PLT0
- new X86_32ExecPLT0(*m_SectionData);
+ new X86_32ExecPLT0(*m_pSectionData);
}
}
else {
@@ -89,7 +87,7 @@ X86PLT::X86PLT(LDSection& pSection,
m_PLT0Size = sizeof (x86_64_plt0);
m_PLT1Size = sizeof (x86_64_plt1);
// create PLT0
- new X86_64PLT0(*m_SectionData);
+ new X86_64PLT0(*m_pSectionData);
}
}
@@ -109,13 +107,13 @@ void X86PLT::finalizeSectionSize()
if (end() != it) {
// plt1 size
PLTEntryBase* plt1 = &(llvm::cast<PLTEntryBase>(*it));
- size += (m_SectionData->size() - 1) * plt1->size();
+ size += (m_pSectionData->size() - 1) * plt1->size();
}
m_Section.setSize(size);
uint32_t offset = 0;
- SectionData::iterator frag, fragEnd = m_SectionData->end();
- for (frag = m_SectionData->begin(); frag != fragEnd; ++frag) {
+ SectionData::iterator frag, fragEnd = m_pSectionData->end();
+ for (frag = m_pSectionData->begin(); frag != fragEnd; ++frag) {
frag->setOffset(offset);
offset += frag->size();
}
@@ -123,22 +121,22 @@ void X86PLT::finalizeSectionSize()
bool X86PLT::hasPLT1() const
{
- return (m_SectionData->size() > 1);
+ return (m_pSectionData->size() > 1);
}
PLTEntryBase* X86PLT::create()
{
if (LinkerConfig::DynObj == m_Config.codeGenType())
- return new X86_32DynPLT1(*m_SectionData);
+ return new X86_32DynPLT1(*m_pSectionData);
else
- return new X86_32ExecPLT1(*m_SectionData);
+ return new X86_32ExecPLT1(*m_pSectionData);
}
PLTEntryBase* X86PLT::getPLT0() const
{
- iterator first = m_SectionData->getFragmentList().begin();
+ iterator first = m_pSectionData->getFragmentList().begin();
- assert(first != m_SectionData->getFragmentList().end() &&
+ assert(first != m_pSectionData->getFragmentList().end() &&
"FragmentList is empty, getPLT0 failed!");
PLTEntryBase* plt0 = &(llvm::cast<PLTEntryBase>(*first));
@@ -150,8 +148,8 @@ PLTEntryBase* X86PLT::getPLT0() const
// X86_32PLT
//===----------------------------------------------------------------------===//
X86_32PLT::X86_32PLT(LDSection& pSection,
- X86_32GOTPLT& pGOTPLT,
- const LinkerConfig& pConfig)
+ X86_32GOTPLT& pGOTPLT,
+ const LinkerConfig& pConfig)
: X86PLT(pSection, pConfig, 32),
m_GOTPLT(pGOTPLT) {
}
@@ -184,8 +182,8 @@ void X86_32PLT::applyPLT1()
{
assert(m_Section.addr() && ".plt base address is NULL!");
- X86PLT::iterator it = m_SectionData->begin();
- X86PLT::iterator ie = m_SectionData->end();
+ X86PLT::iterator it = m_pSectionData->begin();
+ X86PLT::iterator ie = m_pSectionData->end();
assert(it != ie && "FragmentList is empty, applyPLT1 failed!");
uint64_t GOTEntrySize = X86_32GOTEntry::EntrySize;
@@ -236,8 +234,8 @@ void X86_32PLT::applyPLT1()
// X86_64PLT
//===----------------------------------------------------------------------===//
X86_64PLT::X86_64PLT(LDSection& pSection,
- X86_64GOTPLT& pGOTPLT,
- const LinkerConfig& pConfig)
+ X86_64GOTPLT& pGOTPLT,
+ const LinkerConfig& pConfig)
: X86PLT(pSection, pConfig, 64),
m_GOTPLT(pGOTPLT) {
}
@@ -270,8 +268,8 @@ void X86_64PLT::applyPLT1()
{
assert(m_Section.addr() && ".plt base address is NULL!");
- X86PLT::iterator it = m_SectionData->begin();
- X86PLT::iterator ie = m_SectionData->end();
+ X86PLT::iterator it = m_pSectionData->begin();
+ X86PLT::iterator ie = m_pSectionData->end();
assert(it != ie && "FragmentList is empty, applyPLT1 failed!");
uint64_t GOTEntrySize = X86_64GOTEntry::EntrySize;
diff --git a/lib/Target/X86/X86PLT.h b/lib/Target/X86/X86PLT.h
index 2578d67..a220efc 100644
--- a/lib/Target/X86/X86PLT.h
+++ b/lib/Target/X86/X86PLT.h
@@ -6,8 +6,8 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#ifndef MCLD_TARGET_X86_PLT_H
-#define MCLD_TARGET_X86_PLT_H
+#ifndef TARGET_X86_X86PLT_H
+#define TARGET_X86_X86PLT_H
#include <mcld/Target/PLT.h>
@@ -110,7 +110,7 @@ class X86PLT : public PLT
public:
X86PLT(LDSection& pSection,
const LinkerConfig& pConfig,
- int got_size);
+ int got_size);
~X86PLT();
// finalizeSectionSize - set LDSection size
@@ -150,8 +150,8 @@ class X86_32PLT : public X86PLT
{
public:
X86_32PLT(LDSection& pSection,
- X86_32GOTPLT& pGOTPLT,
- const LinkerConfig& pConfig);
+ X86_32GOTPLT& pGOTPLT,
+ const LinkerConfig& pConfig);
void applyPLT0();
@@ -171,8 +171,8 @@ class X86_64PLT : public X86PLT
{
public:
X86_64PLT(LDSection& pSection,
- X86_64GOTPLT& pGOTPLT,
- const LinkerConfig& pConfig);
+ X86_64GOTPLT& pGOTPLT,
+ const LinkerConfig& pConfig);
void applyPLT0();
diff --git a/lib/Target/X86/X86Relocator.cpp b/lib/Target/X86/X86Relocator.cpp
index 6e3234f..8cc916e 100644
--- a/lib/Target/X86/X86Relocator.cpp
+++ b/lib/Target/X86/X86Relocator.cpp
@@ -32,7 +32,7 @@ static
Relocation& helper_DynRel_init(ResolveInfo* pSym,
Fragment& pFrag,
uint64_t pOffset,
- X86Relocator::Type pType,
+ Relocator::Type pType,
X86_32Relocator& pParent)
{
X86_32GNULDBackend& ld_backend = pParent.getTarget();
@@ -65,7 +65,7 @@ helper_use_relative_reloc(const ResolveInfo& pSym,
static
X86_32GOTEntry& helper_GOT_init(Relocation& pReloc,
bool pHasRel,
- X86_32Relocator& pParent)
+ X86_32Relocator& pParent)
{
// rsym - The relocation target symbol
ResolveInfo* rsym = pReloc.symInfo();
@@ -96,13 +96,13 @@ X86_32GOTEntry& helper_GOT_init(Relocation& pReloc,
}
static
-X86Relocator::Address helper_GOT_ORG(X86_32Relocator& pParent)
+Relocator::Address helper_GOT_ORG(X86_32Relocator& pParent)
{
return pParent.getTarget().getGOTPLT().addr();
}
static
-X86Relocator::Address helper_get_GOT_address(Relocation& pReloc,
+Relocator::Address helper_get_GOT_address(Relocation& pReloc,
X86_32Relocator& pParent)
{
X86_32GOTEntry* got_entry = pParent.getSymGOTMap().lookUp(*pReloc.symInfo());
@@ -135,8 +135,8 @@ PLTEntryBase& helper_PLT_init(Relocation& pReloc, X86_32Relocator& pParent)
return *plt_entry;
}
-static
-X86Relocator::Address helper_get_PLT_address(ResolveInfo& pSym, X86_32Relocator& pParent)
+static Relocator::Address
+helper_get_PLT_address(ResolveInfo& pSym, X86_32Relocator& pParent)
{
PLTEntryBase* plt_entry = pParent.getSymPLTMap().lookUp(pSym);
assert(NULL != plt_entry);
@@ -150,7 +150,7 @@ DECL_X86_32_APPLY_RELOC_FUNCS
/// the prototype of applying function
typedef Relocator::Result (*X86_32ApplyFunctionType)(Relocation& pReloc,
- X86_32Relocator& pParent);
+ X86_32Relocator& pParent);
// the table entry of applying functions
struct X86_32ApplyFunctionTriple
@@ -802,36 +802,37 @@ void X86_32Relocator::convertTLSIEtoLE(Relocation& pReloc,
assert(pReloc.type() == llvm::ELF::R_386_TLS_IE);
assert(NULL != pReloc.targetRef().frag());
- // 1. create the fragment references and new relocs
- uint64_t off = pReloc.targetRef().offset();
- if (off >= 4)
- off -= 4;
- else
- off = 0;
-
- FragmentRef* fragref = FragmentRef::Create(*pReloc.targetRef().frag(), off);
- Relocation* reloc = Relocation::Create(X86_32Relocator::R_386_TLS_OPT,
- *fragref,
- 0x0);
+ // 1. create the new relocs
+ Relocation* reloc =
+ Relocation::Create(X86_32Relocator::R_386_TLS_OPT,
+ *FragmentRef::Create(*pReloc.targetRef().frag(),
+ pReloc.targetRef().offset() - 1),
+ 0x0);
// FIXME: should we create a special symbol for the tls opt instead?
reloc->setSymInfo(pReloc.symInfo());
// 2. modify the opcodes to the appropriate ones
uint8_t* op = (reinterpret_cast<uint8_t*>(&reloc->target()));
- off = pReloc.targetRef().offset() - reloc->targetRef().offset() - 1;
- if (op[off] == 0xa1) {
- op[off] = 0xb8;
+ if (op[0] == 0xa1) {
+ op[0] = 0xb8;
} else {
- switch (op[off - 1]) {
+ // create the new reloc (move 1 byte forward).
+ reloc = Relocation::Create(X86_32Relocator::R_386_TLS_OPT,
+ *FragmentRef::Create(*pReloc.targetRef().frag(),
+ pReloc.targetRef().offset() - 2),
+ 0x0);
+ reloc->setSymInfo(pReloc.symInfo());
+ op = (reinterpret_cast<uint8_t*>(&reloc->target()));
+ switch (op[0]) {
case 0x8b:
- assert((op[off] & 0xc7) == 0x05);
- op[off - 1] = 0xc7;
- op[off] = 0xc0 | ((op[off] >> 3) & 7);
+ assert((op[1] & 0xc7) == 0x05);
+ op[0] = 0xc7;
+ op[1] = 0xc0 | ((op[1] >> 3) & 7);
break;
case 0x03:
- assert((op[off] & 0xc7) == 0x05);
- op[off - 1] = 0x81;
- op[off] = 0xc0 | ((op[off] >> 3) & 7);
+ assert((op[1] & 0xc7) == 0x05);
+ op[0] = 0x81;
+ op[1] = 0xc0 | ((op[1] >> 3) & 7);
break;
default:
assert(0);
@@ -840,6 +841,7 @@ void X86_32Relocator::convertTLSIEtoLE(Relocation& pReloc,
}
// 3. insert the new relocs "BEFORE" the original reloc.
+ assert(reloc != NULL);
pSection.getRelocData()->getRelocationList().insert(
RelocData::iterator(pReloc), reloc);
@@ -852,15 +854,15 @@ void X86_32Relocator::convertTLSIEtoLE(Relocation& pReloc,
//================================================//
// R_386_NONE
-X86Relocator::Result none(Relocation& pReloc, X86_32Relocator& pParent)
+Relocator::Result none(Relocation& pReloc, X86_32Relocator& pParent)
{
- return X86Relocator::OK;
+ return Relocator::OK;
}
// R_386_32: S + A
// R_386_16
// R_386_8
-X86Relocator::Result abs(Relocation& pReloc, X86_32Relocator& pParent)
+Relocator::Result abs(Relocation& pReloc, X86_32Relocator& pParent)
{
ResolveInfo* rsym = pReloc.symInfo();
Relocator::DWord A = pReloc.target() + pReloc.addend();
@@ -876,7 +878,7 @@ X86Relocator::Result abs(Relocation& pReloc, X86_32Relocator& pParent)
// but perform static relocation. (e.g., applying .debug section)
if (0x0 == (llvm::ELF::SHF_ALLOC & target_sect.flag())) {
pReloc.target() = S + A;
- return X86Relocator::OK;
+ return Relocator::OK;
}
// An external symbol may need PLT and dynamic relocation
@@ -890,18 +892,18 @@ X86Relocator::Result abs(Relocation& pReloc, X86_32Relocator& pParent)
if (has_dyn_rel)
if (llvm::ELF::R_386_32 != pReloc.type() ||
(!helper_use_relative_reloc(*rsym, pParent)))
- return X86Relocator::OK;
+ return Relocator::OK;
}
// perform static relocation
pReloc.target() = S + A;
- return X86Relocator::OK;
+ return Relocator::OK;
}
// R_386_PC32: S + A - P
// R_386_PC16
// R_386_PC8
-X86Relocator::Result rel(Relocation& pReloc, X86_32Relocator& pParent)
+Relocator::Result rel(Relocation& pReloc, X86_32Relocator& pParent)
{
ResolveInfo* rsym = pReloc.symInfo();
Relocator::DWord A = pReloc.target() + pReloc.addend();
@@ -917,7 +919,7 @@ X86Relocator::Result rel(Relocation& pReloc, X86_32Relocator& pParent)
// but perform static relocation. (e.g., applying .debug section)
if (0x0 == (llvm::ELF::SHF_ALLOC & target_sect.flag())) {
pReloc.target() = S + A - P;
- return X86Relocator::OK;
+ return Relocator::OK;
}
// An external symbol may need PLT and dynamic relocation
@@ -928,41 +930,41 @@ X86Relocator::Result rel(Relocation& pReloc, X86_32Relocator& pParent)
}
if (has_dyn_rel)
if (!helper_use_relative_reloc(*rsym, pParent))
- return X86Relocator::OK;
+ return Relocator::OK;
}
// perform static relocation
pReloc.target() = S + A - P;
- return X86Relocator::OK;
+ return Relocator::OK;
}
// R_386_GOTOFF: S + A - GOT_ORG
-X86Relocator::Result gotoff32(Relocation& pReloc, X86_32Relocator& pParent)
+Relocator::Result gotoff32(Relocation& pReloc, X86_32Relocator& pParent)
{
Relocator::DWord A = pReloc.target() + pReloc.addend();
- X86Relocator::Address GOT_ORG = helper_GOT_ORG(pParent);
- X86Relocator::Address S = pReloc.symValue();
+ Relocator::Address GOT_ORG = helper_GOT_ORG(pParent);
+ Relocator::Address S = pReloc.symValue();
pReloc.target() = S + A - GOT_ORG;
- return X86Relocator::OK;
+ return Relocator::OK;
}
// R_386_GOTPC: GOT_ORG + A - P
-X86Relocator::Result gotpc32(Relocation& pReloc, X86_32Relocator& pParent)
+Relocator::Result gotpc32(Relocation& pReloc, X86_32Relocator& pParent)
{
Relocator::DWord A = pReloc.target() + pReloc.addend();
- X86Relocator::Address GOT_ORG = helper_GOT_ORG(pParent);
+ Relocator::Address GOT_ORG = helper_GOT_ORG(pParent);
// Apply relocation.
pReloc.target() = GOT_ORG + A - pReloc.place();
- return X86Relocator::OK;
+ return Relocator::OK;
}
// R_386_GOT32: GOT(S) + A - GOT_ORG
-X86Relocator::Result got32(Relocation& pReloc, X86_32Relocator& pParent)
+Relocator::Result got32(Relocation& pReloc, X86_32Relocator& pParent)
{
ResolveInfo* rsym = pReloc.symInfo();
if (!(rsym->reserved() & (X86Relocator::ReserveGOT)))
- return X86Relocator::BadReloc;
+ return Relocator::BadReloc;
// set up got entry value if the got has no dyn rel or
// the dyn rel is RELATIVE
@@ -971,37 +973,37 @@ X86Relocator::Result got32(Relocation& pReloc, X86_32Relocator& pParent)
if (got_entry->getValue() == X86Relocator::SymVal)
got_entry->setValue(pReloc.symValue());
- X86Relocator::Address GOT_S = helper_get_GOT_address(pReloc, pParent);
+ Relocator::Address GOT_S = helper_get_GOT_address(pReloc, pParent);
Relocator::DWord A = pReloc.target() + pReloc.addend();
- X86Relocator::Address GOT_ORG = helper_GOT_ORG(pParent);
+ Relocator::Address GOT_ORG = helper_GOT_ORG(pParent);
// Apply relocation.
pReloc.target() = GOT_S + A - GOT_ORG;
- return X86Relocator::OK;
+ return Relocator::OK;
}
// R_386_PLT32: PLT(S) + A - P
-X86Relocator::Result plt32(Relocation& pReloc, X86_32Relocator& pParent)
+Relocator::Result plt32(Relocation& pReloc, X86_32Relocator& pParent)
{
// PLT_S depends on if there is a PLT entry.
- X86Relocator::Address PLT_S;
+ Relocator::Address PLT_S;
if ((pReloc.symInfo()->reserved() & X86Relocator::ReservePLT))
PLT_S = helper_get_PLT_address(*pReloc.symInfo(), pParent);
else
PLT_S = pReloc.symValue();
Relocator::DWord A = pReloc.target() + pReloc.addend();
- X86Relocator::Address P = pReloc.place();
+ Relocator::Address P = pReloc.place();
pReloc.target() = PLT_S + A - P;
- return X86Relocator::OK;
+ return Relocator::OK;
}
// R_386_TLS_GD:
-X86Relocator::Result tls_gd(Relocation& pReloc, X86_32Relocator& pParent)
+Relocator::Result tls_gd(Relocation& pReloc, X86_32Relocator& pParent)
{
// global-dynamic
ResolveInfo* rsym = pReloc.symInfo();
// must reserve two pairs of got and dynamic relocation
if (!(rsym->reserved() & X86Relocator::ReserveGOT))
- return X86Relocator::BadReloc;
+ return Relocator::BadReloc;
ELFFileFormat* file_format = pParent.getTarget().getOutputFormat();
// setup corresponding got and dynamic relocatio entries:
@@ -1018,16 +1020,16 @@ X86Relocator::Result tls_gd(Relocation& pReloc, X86_32Relocator& pParent)
Relocator::DWord A = pReloc.target() + pReloc.addend();
// GOT_OFF - the offset between the got_entry1 and _GLOBAL_OFFSET_TABLE (the
// .got.plt section)
- X86Relocator::Address GOT_OFF =
+ Relocator::Address GOT_OFF =
file_format->getGOT().addr() +
got_entry1->getOffset() -
file_format->getGOTPLT().addr();
pReloc.target() = GOT_OFF + A;
- return X86Relocator::OK;
+ return Relocator::OK;
}
// R_386_TLS_LDM
-X86Relocator::Result tls_ldm(Relocation& pReloc, X86_32Relocator& pParent)
+Relocator::Result tls_ldm(Relocation& pReloc, X86_32Relocator& pParent)
{
// FIXME: no linker optimization for TLS relocation
const X86_32GOTEntry& got_entry = pParent.getTLSModuleID();
@@ -1039,46 +1041,46 @@ X86Relocator::Result tls_ldm(Relocation& pReloc, X86_32Relocator& pParent)
Relocator::DWord A = pReloc.target() + pReloc.addend();
pReloc.target() = GOT_S + A;
- return X86Relocator::OK;
+ return Relocator::OK;
}
// R_386_TLS_LDO_32
-X86Relocator::Result tls_ldo_32(Relocation& pReloc, X86_32Relocator& pParent)
+Relocator::Result tls_ldo_32(Relocation& pReloc, X86_32Relocator& pParent)
{
// FIXME: no linker optimization for TLS relocation
Relocator::DWord A = pReloc.target() + pReloc.addend();
- X86Relocator::Address S = pReloc.symValue();
+ Relocator::Address S = pReloc.symValue();
pReloc.target() = S + A;
- return X86Relocator::OK;
+ return Relocator::OK;
}
// R_X86_TLS_IE
-X86Relocator::Result tls_ie(Relocation& pReloc, X86_32Relocator& pParent)
+Relocator::Result tls_ie(Relocation& pReloc, X86_32Relocator& pParent)
{
ResolveInfo* rsym = pReloc.symInfo();
if (!(rsym->reserved() & X86Relocator::ReserveGOT)) {
- return X86Relocator::BadReloc;
+ return Relocator::BadReloc;
}
// set up the got and dynamic relocation entries if not exist
X86_32GOTEntry* got_entry = pParent.getSymGOTMap().lookUp(*rsym);
assert(NULL != got_entry);
// perform relocation to the absolute address of got_entry
- X86Relocator::Address GOT_S =
- pParent.getTarget().getGOT().addr() + got_entry->getOffset();
+ Relocator::Address GOT_S =
+ pParent.getTarget().getGOT().addr() + got_entry->getOffset();
Relocator::DWord A = pReloc.target() + pReloc.addend();
pReloc.target() = GOT_S + A;
- return X86Relocator::OK;
+ return Relocator::OK;
}
// R_386_TLS_GOTIE
-X86Relocator::Result tls_gotie(Relocation& pReloc, X86_32Relocator& pParent)
+Relocator::Result tls_gotie(Relocation& pReloc, X86_32Relocator& pParent)
{
ResolveInfo* rsym = pReloc.symInfo();
if (!(rsym->reserved() & X86Relocator::ReserveGOT)) {
- return X86Relocator::BadReloc;
+ return Relocator::BadReloc;
}
// set up the got and dynamic relocation entries if not exist
@@ -1091,14 +1093,14 @@ X86Relocator::Result tls_gotie(Relocation& pReloc, X86_32Relocator& pParent)
Relocator::DWord A = pReloc.target() + pReloc.addend();
pReloc.target() = GOT_S + A;
- return X86Relocator::OK;
+ return Relocator::OK;
}
// R_X86_TLS_LE
-X86Relocator::Result tls_le(Relocation& pReloc, X86_32Relocator& pParent)
+Relocator::Result tls_le(Relocation& pReloc, X86_32Relocator& pParent)
{
if (pReloc.symInfo()->reserved() & X86Relocator::ReserveRel)
- return X86Relocator::OK;
+ return Relocator::OK;
// perform static relocation
// get TLS segment
@@ -1108,14 +1110,14 @@ X86Relocator::Result tls_le(Relocation& pReloc, X86_32Relocator& pParent)
0x0);
assert(tls_seg != pParent.getTarget().elfSegmentTable().end());
Relocator::DWord A = pReloc.target() + pReloc.addend();
- X86Relocator::Address S = pReloc.symValue();
+ Relocator::Address S = pReloc.symValue();
pReloc.target() = S + A - (*tls_seg)->memsz();
- return X86Relocator::OK;
+ return Relocator::OK;
}
-X86Relocator::Result unsupport(Relocation& pReloc, X86_32Relocator& pParent)
+Relocator::Result unsupport(Relocation& pReloc, X86_32Relocator& pParent)
{
- return X86Relocator::Unsupport;
+ return Relocator::Unsupport;
}
//===--------------------------------------------------------------------===//
@@ -1126,7 +1128,7 @@ static
Relocation& helper_DynRel_init(ResolveInfo* pSym,
Fragment& pFrag,
uint64_t pOffset,
- X86Relocator::Type pType,
+ Relocator::Type pType,
X86_64Relocator& pParent)
{
X86_64GNULDBackend& ld_backend = pParent.getTarget();
@@ -1193,14 +1195,14 @@ X86_64GOTEntry& helper_GOT_init(Relocation& pReloc,
}
static
-X86Relocator::Address helper_GOT_ORG(X86_64Relocator& pParent)
+Relocator::Address helper_GOT_ORG(X86_64Relocator& pParent)
{
return pParent.getTarget().getGOT().addr();
}
static
-X86Relocator::Address helper_get_GOT_address(Relocation& pReloc,
- X86_64Relocator& pParent)
+Relocator::Address helper_get_GOT_address(Relocation& pReloc,
+ X86_64Relocator& pParent)
{
X86_64GOTEntry* got_entry = pParent.getSymGOTMap().lookUp(*pReloc.symInfo());
assert(NULL != got_entry);
@@ -1208,8 +1210,8 @@ X86Relocator::Address helper_get_GOT_address(Relocation& pReloc,
}
static
-X86Relocator::Address helper_get_PLT_address(ResolveInfo& pSym,
- X86_64Relocator& pParent)
+Relocator::Address helper_get_PLT_address(ResolveInfo& pSym,
+ X86_64Relocator& pParent)
{
PLTEntryBase* plt_entry = pParent.getSymPLTMap().lookUp(pSym);
assert(NULL != plt_entry);
@@ -1248,7 +1250,7 @@ DECL_X86_64_APPLY_RELOC_FUNCS
/// the prototype of applying function
typedef Relocator::Result (*X86_64ApplyFunctionType)(Relocation& pReloc,
- X86_64Relocator& pParent);
+ X86_64Relocator& pParent);
// the table entry of applying functions
struct X86_64ApplyFunctionTriple
@@ -1426,7 +1428,7 @@ void X86_64Relocator::scanGlobalReloc(Relocation& pReloc,
*this);
getRelRelMap().record(pReloc, reloc);
}
- getTarget().checkAndSetHasTextRel(*pSection.getLink());
+ getTarget().checkAndSetHasTextRel(*pSection.getLink());
}
}
return;
@@ -1497,12 +1499,12 @@ void X86_64Relocator::scanGlobalReloc(Relocation& pReloc,
// All other dynamic relocations may lead to run-time relocation
// overflow.
if (getTarget().isDynamicSymbol(*rsym) &&
- getTarget().symbolNeedsDynRel(*rsym,
+ getTarget().symbolNeedsDynRel(*rsym,
(rsym->reserved() & ReservePLT),
false) &&
- getTarget().symbolNeedsCopyReloc(pReloc, *rsym)) {
- LDSymbol& cpy_sym = defineSymbolforCopyReloc(pBuilder, *rsym, getTarget());
- addCopyReloc(*cpy_sym.resolveInfo(), getTarget());
+ getTarget().symbolNeedsCopyReloc(pReloc, *rsym)) {
+ LDSymbol& cpy_sym = defineSymbolforCopyReloc(pBuilder, *rsym, getTarget());
+ addCopyReloc(*cpy_sym.resolveInfo(), getTarget());
}
return;
@@ -1517,16 +1519,16 @@ void X86_64Relocator::scanGlobalReloc(Relocation& pReloc,
//
// ===
// R_X86_64_NONE
-X86Relocator::Result none(Relocation& pReloc, X86_64Relocator& pParent)
+Relocator::Result none(Relocation& pReloc, X86_64Relocator& pParent)
{
- return X86Relocator::OK;
+ return Relocator::OK;
}
// R_X86_64_64: S + A
// R_X86_64_32:
// R_X86_64_16:
// R_X86_64_8
-X86Relocator::Result abs(Relocation& pReloc, X86_64Relocator& pParent)
+Relocator::Result abs(Relocation& pReloc, X86_64Relocator& pParent)
{
ResolveInfo* rsym = pReloc.symInfo();
Relocator::DWord A = pReloc.target() + pReloc.addend();
@@ -1539,13 +1541,13 @@ X86Relocator::Result abs(Relocation& pReloc, X86_64Relocator& pParent)
// but perform static relocation. (e.g., applying .debug section)
if (0x0 == (llvm::ELF::SHF_ALLOC & target_sect.flag())) {
pReloc.target() = S + A;
- return X86Relocator::OK;
+ return Relocator::OK;
}
// A local symbol may need RELA Type dynamic relocation
if (rsym->isLocal() && has_dyn_rel) {
dyn_rel->setAddend(S + A);
- return X86Relocator::OK;
+ return Relocator::OK;
}
// An external symbol may need PLT and dynamic relocation
@@ -1563,18 +1565,18 @@ X86Relocator::Result abs(Relocation& pReloc, X86_64Relocator& pParent)
}
else {
dyn_rel->setAddend(A);
- return X86Relocator::OK;
+ return Relocator::OK;
}
}
}
// perform static relocation
pReloc.target() = S + A;
- return X86Relocator::OK;
+ return Relocator::OK;
}
// R_X86_64_32S: S + A
-X86Relocator::Result signed32(Relocation& pReloc, X86_64Relocator& pParent)
+Relocator::Result signed32(Relocation& pReloc, X86_64Relocator& pParent)
{
ResolveInfo* rsym = pReloc.symInfo();
Relocator::DWord A = pReloc.target() + pReloc.addend();
@@ -1582,7 +1584,7 @@ X86Relocator::Result signed32(Relocation& pReloc, X86_64Relocator& pParent)
// There should be no dynamic relocations for R_X86_64_32S.
if (NULL != pParent.getRelRelMap().lookUp(pReloc))
- return X86Relocator::BadReloc;
+ return Relocator::BadReloc;
LDSection& target_sect = pReloc.targetRef().frag()->getParent()->getSection();
// If the flag of target section is not ALLOC, we will not scan this relocation
@@ -1596,19 +1598,19 @@ X86Relocator::Result signed32(Relocation& pReloc, X86_64Relocator& pParent)
// Check 32-bit signed overflow.
Relocator::SWord V = S + A;
if (V > INT64_C(0x7fffffff) || V < INT64_C(-0x80000000))
- return X86Relocator::Overflow;
+ return Relocator::Overflow;
#endif
// perform static relocation
pReloc.target() = S + A;
- return X86Relocator::OK;
+ return Relocator::OK;
}
// R_X86_64_GOTPCREL: GOT(S) + GOT_ORG + A - P
-X86Relocator::Result gotpcrel(Relocation& pReloc, X86_64Relocator& pParent)
+Relocator::Result gotpcrel(Relocation& pReloc, X86_64Relocator& pParent)
{
if (!(pReloc.symInfo()->reserved() & X86Relocator::ReserveGOT)) {
- return X86Relocator::BadReloc;
+ return Relocator::BadReloc;
}
// set symbol value of the got entry if needed
@@ -1622,33 +1624,33 @@ X86Relocator::Result gotpcrel(Relocation& pReloc, X86_64Relocator& pParent)
dyn_rel->setAddend(pReloc.symValue());
}
- X86Relocator::Address GOT_S = helper_get_GOT_address(pReloc, pParent);
- Relocator::DWord A = pReloc.target() + pReloc.addend();
- X86Relocator::Address GOT_ORG = helper_GOT_ORG(pParent);
+ Relocator::Address GOT_S = helper_get_GOT_address(pReloc, pParent);
+ Relocator::DWord A = pReloc.target() + pReloc.addend();
+ Relocator::Address GOT_ORG = helper_GOT_ORG(pParent);
// Apply relocation.
pReloc.target() = GOT_S + GOT_ORG + A - pReloc.place();
- return X86Relocator::OK;
+ return Relocator::OK;
}
// R_X86_64_PLT32: PLT(S) + A - P
-X86Relocator::Result plt32(Relocation& pReloc, X86_64Relocator& pParent)
+Relocator::Result plt32(Relocation& pReloc, X86_64Relocator& pParent)
{
// PLT_S depends on if there is a PLT entry.
- X86Relocator::Address PLT_S;
+ Relocator::Address PLT_S;
if ((pReloc.symInfo()->reserved() & X86Relocator::ReservePLT))
PLT_S = helper_get_PLT_address(*pReloc.symInfo(), pParent);
else
PLT_S = pReloc.symValue();
- Relocator::DWord A = pReloc.target() + pReloc.addend();
- X86Relocator::Address P = pReloc.place();
+ Relocator::DWord A = pReloc.target() + pReloc.addend();
+ Relocator::Address P = pReloc.place();
pReloc.target() = PLT_S + A - P;
- return X86Relocator::OK;
+ return Relocator::OK;
}
// R_X86_64_PC32: S + A - P
// R_X86_64_PC16
// R_X86_64_PC8
-X86Relocator::Result rel(Relocation& pReloc, X86_64Relocator& pParent)
+Relocator::Result rel(Relocation& pReloc, X86_64Relocator& pParent)
{
ResolveInfo* rsym = pReloc.symInfo();
Relocator::DWord A = pReloc.target() + pReloc.addend();
@@ -1660,7 +1662,7 @@ X86Relocator::Result rel(Relocation& pReloc, X86_64Relocator& pParent)
// but perform static relocation. (e.g., applying .debug section)
if (0x0 == (llvm::ELF::SHF_ALLOC & target_sect.flag())) {
pReloc.target() = S + A - P;
- return X86Relocator::OK;
+ return Relocator::OK;
}
// setup relocation addend if needed
@@ -1678,16 +1680,16 @@ X86Relocator::Result rel(Relocation& pReloc, X86_64Relocator& pParent)
*rsym,
(rsym->reserved() & X86Relocator::ReservePLT),
false)) {
- return X86Relocator::Overflow;
+ return Relocator::Overflow;
}
}
// perform static relocation
pReloc.target() = S + A - P;
- return X86Relocator::OK;
+ return Relocator::OK;
}
-X86Relocator::Result unsupport(Relocation& pReloc, X86_64Relocator& pParent)
+Relocator::Result unsupport(Relocation& pReloc, X86_64Relocator& pParent)
{
- return X86Relocator::Unsupport;
+ return Relocator::Unsupport;
}
diff --git a/lib/Target/X86/X86Relocator.h b/lib/Target/X86/X86Relocator.h
index da67464..596c15b 100644
--- a/lib/Target/X86/X86Relocator.h
+++ b/lib/Target/X86/X86Relocator.h
@@ -6,8 +6,8 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#ifndef X86_RELOCATION_FACTORY_H
-#define X86_RELOCATION_FACTORY_H
+#ifndef TARGET_X86_X86RELOCATOR_H
+#define TARGET_X86_X86RELOCATOR_H
#ifdef ENABLE_UNITTEST
#include <gtest.h>
#endif
diff --git a/lib/Target/X86/X86TargetMachine.h b/lib/Target/X86/X86TargetMachine.h
index b9d78e1..c3893da 100644
--- a/lib/Target/X86/X86TargetMachine.h
+++ b/lib/Target/X86/X86TargetMachine.h
@@ -6,8 +6,8 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#ifndef MCLD_X86_TARGET_MACHINE_H
-#define MCLD_X86_TARGET_MACHINE_H
+#ifndef TARGET_X86_X86TARGETMACHINE_H
+#define TARGET_X86_X86TARGETMACHINE_H
#include "X86.h"
#include <mcld/CodeGen/TargetMachine.h>