26 enum { DefaultEABIVersion = 0x05000000U };
33 ARMELFObjectWriter(uint8_t OSABI);
35 virtual ~ARMELFObjectWriter();
38 bool IsPCRel,
bool IsRelocWithSymbol,
39 int64_t Addend)
const;
48 ARMELFObjectWriter::ARMELFObjectWriter(uint8_t OSABI)
53 ARMELFObjectWriter::~ARMELFObjectWriter() {}
59 STATISTIC(PCRelCount,
"Total number of PIC Relocations");
60 STATISTIC(NonPCRelCount,
"Total number of non-PIC relocations");
68 bool EmitThisSym =
false;
72 bool InNormalSection =
true;
73 unsigned RelocType = 0;
74 RelocType = GetRelocTypeInner(Target, Fixup, IsPCRel);
80 MCSymbolRefExpr::VK_None;
81 dbgs() <<
"considering symbol "
85 <<
" Kind: " << (
int)
Kind <<
"/" << (int)Kind2
89 <<
" Counts:" << PCRelCount <<
"/" << NonPCRelCount <<
"\n");
91 if (IsPCRel) { ++PCRelCount;
97 .Case(
".data.rel.ro.local",
false)
98 .
Case(
".data.rel",
false)
109 .Case(
".data.rel.ro.local",
false)
110 .
Case(
".data.rel",
false)
111 .
Case(
".rodata",
false)
121 .Case(
".data.rel.ro.local",
false)
122 .
Case(
".rodata",
false)
123 .
Case(
".data.rel",
false)
128 default: EmitThisSym =
true;
break;
145 unsigned ARMELFObjectWriter::GetRelocType(
const MCValue &Target,
148 bool IsRelocWithSymbol,
149 int64_t Addend)
const {
150 return GetRelocTypeInner(Target, Fixup, IsPCRel);
153 unsigned ARMELFObjectWriter::GetRelocTypeInner(
const MCValue &Target,
155 bool IsPCRel)
const {
161 switch ((
unsigned)Fixup.
getKind()) {
166 case MCSymbolRefExpr::VK_None:
169 case MCSymbolRefExpr::VK_ARM_TLSGD:
171 case MCSymbolRefExpr::VK_ARM_GOTTPOFF:
179 case MCSymbolRefExpr::VK_ARM_PLT:
218 switch ((
unsigned)Fixup.
getKind()) {
223 case MCSymbolRefExpr::VK_ARM_NONE:
226 case MCSymbolRefExpr::VK_ARM_GOT:
229 case MCSymbolRefExpr::VK_ARM_TLSGD:
232 case MCSymbolRefExpr::VK_ARM_TPOFF:
235 case MCSymbolRefExpr::VK_ARM_GOTTPOFF:
238 case MCSymbolRefExpr::VK_None:
241 case MCSymbolRefExpr::VK_ARM_GOTOFF:
244 case MCSymbolRefExpr::VK_ARM_TARGET1:
247 case MCSymbolRefExpr::VK_ARM_TARGET2:
250 case MCSymbolRefExpr::VK_ARM_PREL31:
COFF::RelocationTypeX86 Type
StringRef getSectionName() const
const MCSymbol & getSymbol() const
StringSwitch & Case(const char(&S)[N], const T &Value)
const MCSection & getSection() const
#define llvm_unreachable(msg)
bool isAbsolute() const
isAbsolute - Is this an absolute (as opposed to relocatable) value.
A switch()-like statement whose cases are string literals.
STATISTIC(PCRelCount,"Total number of PIC Relocations")
MCFixupKind getKind() const
const MCSymbolRefExpr * getSymB() const
MCObjectWriter * createELFObjectWriter(MCELFObjectTargetWriter *MOTW, raw_ostream &OS, bool IsLittleEndian)
Construct a new ELF writer instance.
bool isAbsolute() const
isAbsolute - Check if this is an absolute symbol.
const MCSymbolRefExpr * getSymA() const
R Default(const T &Value) const
raw_ostream & dbgs()
dbgs - Return a circular-buffered debug stream.
bool isTemporary() const
isTemporary - Check if this is an assembler temporary symbol.
MCObjectWriter * createARMELFObjectWriter(raw_ostream &OS, uint8_t OSABI)
createARMELFObjectWriter - Construct an ELF Mach-O object writer.
StringRef getName() const
getName - Get the symbol name.
const MCSymbol & AliasedSymbol() const
bool isVariable() const
isVariable - Check if this is a variable symbol.
VariantKind getKind() const