1 //===-- ARMELFWriterInfo.h - ELF Writer Info for ARM ------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements ELF writer information for the ARM backend.
12 //===----------------------------------------------------------------------===//
14 #ifndef ARM_ELF_WRITER_INFO_H
15 #define ARM_ELF_WRITER_INFO_H
17 #include "llvm/Target/TargetELFWriterInfo.h"
21 class ARMELFWriterInfo
: public TargetELFWriterInfo
{
23 // ELF Relocation types for ARM
24 // FIXME: TODO(jasonwkim): [2010/09/17 14:52:25 PDT (Friday)]
25 // Come up with a better way to orgnize the 100+ ARM reloc types.
27 enum ARMRelocationType
{
31 ARMELFWriterInfo(TargetMachine
&TM
);
32 virtual ~ARMELFWriterInfo();
34 /// getRelocationType - Returns the target specific ELF Relocation type.
35 /// 'MachineRelTy' contains the object code independent relocation type
36 virtual unsigned getRelocationType(unsigned MachineRelTy
) const;
38 /// hasRelocationAddend - True if the target uses an addend in the
39 /// ELF relocation entry.
40 virtual bool hasRelocationAddend() const { return false; }
42 /// getDefaultAddendForRelTy - Gets the default addend value for a
43 /// relocation entry based on the target ELF relocation type.
44 virtual long int getDefaultAddendForRelTy(unsigned RelTy
,
45 long int Modifier
= 0) const;
47 /// getRelTySize - Returns the size of relocatable field in bits
48 virtual unsigned getRelocationTySize(unsigned RelTy
) const;
50 /// isPCRelativeRel - True if the relocation type is pc relative
51 virtual bool isPCRelativeRel(unsigned RelTy
) const;
53 /// getJumpTableRelocationTy - Returns the machine relocation type used
54 /// to reference a jumptable.
55 virtual unsigned getAbsoluteLabelMachineRelTy() const;
57 /// computeRelocation - Some relocatable fields could be relocated
58 /// directly, avoiding the relocation symbol emission, compute the
59 /// final relocation value for this symbol.
60 virtual long int computeRelocation(unsigned SymOffset
, unsigned RelOffset
,
61 unsigned RelTy
) const;
64 } // end llvm namespace
66 #endif // ARM_ELF_WRITER_INFO_H