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
This commit is contained in:
Bruno Cardoso Lopes
2009-07-20 08:52:02 +00:00
parent 1488670076
commit 0a38dc5fda
5 changed files with 114 additions and 43 deletions

View File

@@ -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