summaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/X86ELFWriterInfo.h
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2009-07-20 08:52:02 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2009-07-20 08:52:02 +0000
commit0a38dc5fda9a22aceecccbad2f024b118ce1d5d8 (patch)
treeaeacae71db2e46b27baffc7bd6a94477d1df2200 /lib/Target/X86/X86ELFWriterInfo.h
parent1488670076908261af145778c23cb9aca30904e5 (diff)
downloadexternal_llvm-0a38dc5fda9a22aceecccbad2f024b118ce1d5d8.zip
external_llvm-0a38dc5fda9a22aceecccbad2f024b118ce1d5d8.tar.gz
external_llvm-0a38dc5fda9a22aceecccbad2f024b118ce1d5d8.tar.bz2
For PC relative relocations where symbols are defined in the same section they
are referenced, ignore the relocation entry and patch the relocatable field with the computed symbol offset directly git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76414 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86ELFWriterInfo.h')
-rw-r--r--lib/Target/X86/X86ELFWriterInfo.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Target/X86/X86ELFWriterInfo.h b/lib/Target/X86/X86ELFWriterInfo.h
index e534e17..e882a0c 100644
--- a/lib/Target/X86/X86ELFWriterInfo.h
+++ b/lib/Target/X86/X86ELFWriterInfo.h
@@ -59,16 +59,25 @@ namespace llvm {
/// for a jump table index.
virtual unsigned getJumpTableIndexRelTy() const { return R_X86_64_32S; }
- /// getAddendForRelTy - Gets the addend value for an ELF relocation entry
- /// based on the target relocation type
+ /// getDefaultAddendForRelTy - Gets the default addend value for a
+ /// relocation entry based on the target ELF relocation type.
virtual long int getDefaultAddendForRelTy(unsigned RelTy) const;
/// getRelTySize - Returns the size of relocatable field in bits
virtual unsigned getRelocationTySize(unsigned RelTy) const;
+ /// isPCRelativeRel - True if the relocation type is pc relative
+ virtual bool isPCRelativeRel(unsigned RelTy) const;
+
/// getJumpTableRelocationTy - Returns the machine relocation type used
/// to reference a jumptable.
virtual unsigned getAbsoluteLabelMachineRelTy() const;
+
+ /// computeRelocation - Some relocatable fields could be relocated
+ /// directly, avoiding the relocation symbol emission, compute the
+ /// final relocation value for this symbol.
+ virtual long int computeRelocation(unsigned SymOffset, unsigned RelOffset,
+ unsigned RelTy) const;
};
} // end llvm namespace