aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2013-05-15 15:07:06 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2013-05-15 15:07:06 +0000
commit2fb140ef31d26d3a4afa47626234e290d72b4ef0 (patch)
tree3744df2098eddf397331c0e8250c30978978a792 /llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp
parentffd144174dcd4a825172e75682abfee9d8e0e9bb (diff)
downloadllvm-2fb140ef31d26d3a4afa47626234e290d72b4ef0.zip
llvm-2fb140ef31d26d3a4afa47626234e290d72b4ef0.tar.gz
llvm-2fb140ef31d26d3a4afa47626234e290d72b4ef0.tar.bz2
[PowerPC] Remove need for adjustFixupOffst hack
Now that applyFixup understands differently-sized fixups, we can define fixup_ppc_lo16/fixup_ppc_lo16_ds/fixup_ppc_ha16 to properly be 2-byte fixups, applied at an offset of 2 relative to the start of the instruction text. This has the benefit that if we actually need to generate a real relocation record, its address will come out correctly automatically, without having to fiddle with the offset in adjustFixupOffset. Tested on both 64-bit and 32-bit PowerPC, using external and integrated assembler. llvm-svn: 181894
Diffstat (limited to 'llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp14
1 files changed, 0 insertions, 14 deletions
diff --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp
index 7a84723..c09ae0e 100644
--- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp
+++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp
@@ -33,7 +33,6 @@ namespace {
virtual const MCSymbol *undefinedExplicitRelSym(const MCValue &Target,
const MCFixup &Fixup,
bool IsPCRel) const;
- virtual void adjustFixupOffset(const MCFixup &Fixup, uint64_t &RelocOffset);
virtual void sortRelocs(const MCAssembler &Asm,
std::vector<ELFRelocationEntry> &Relocs);
@@ -240,19 +239,6 @@ const MCSymbol *PPCELFObjectWriter::undefinedExplicitRelSym(const MCValue &Targe
return NULL;
}
-void PPCELFObjectWriter::
-adjustFixupOffset(const MCFixup &Fixup, uint64_t &RelocOffset) {
- switch ((unsigned)Fixup.getKind()) {
- case PPC::fixup_ppc_ha16:
- case PPC::fixup_ppc_lo16:
- case PPC::fixup_ppc_lo16_ds:
- RelocOffset += 2;
- break;
- default:
- break;
- }
-}
-
// The standard sorter only sorts on the r_offset field, but PowerPC can
// have multiple relocations at the same offset. Sort secondarily on the
// relocation type to avoid nondeterminism.