1//===-  X86RelocationFactory.h --------------------------------------------===//
2//
3//                     The MCLinker Project
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9#ifndef X86_RELOCATION_FACTORY_H
10#define X86_RELOCATION_FACTORY_H
11#ifdef ENABLE_UNITTEST
12#include <gtest.h>
13#endif
14
15#include <mcld/LD/RelocationFactory.h>
16#include <mcld/Target/GOT.h>
17#include "X86LDBackend.h"
18
19namespace mcld
20{
21
22/** \class X86RelocationFactory
23 *  \brief X86RelocationFactory creates and destroys the X86 relocations.
24 *
25 */
26class X86RelocationFactory : public RelocationFactory
27{
28public:
29  X86RelocationFactory(size_t pNum, X86GNULDBackend& pParent);
30  ~X86RelocationFactory();
31
32  Result applyRelocation(Relocation& pRelocation, const MCLDInfo& pLDInfo);
33
34  X86GNULDBackend& getTarget()
35  { return m_Target; }
36
37  const X86GNULDBackend& getTarget() const
38  { return m_Target; }
39
40  const char* getName(Relocation::Type pType) const;
41
42private:
43  X86GNULDBackend& m_Target;
44};
45
46} // namespace of mcld
47
48#endif
49
50