blob: 63bfc0da745a4c61589522cb1d7caf3e13681bf9 [file] [log] [blame]
Wesley Peck4e9141f2010-10-21 03:57:26 +00001//===-- MBlazeELFWriterInfo.h - ELF Writer Info for MBlaze ------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file implements ELF writer information for the MBlaze backend.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef MBLAZE_ELF_WRITER_INFO_H
15#define MBLAZE_ELF_WRITER_INFO_H
16
17#include "llvm/Target/TargetELFWriterInfo.h"
18
19namespace llvm {
20
21 class MBlazeELFWriterInfo : public TargetELFWriterInfo {
Wesley Peck4e9141f2010-10-21 03:57:26 +000022 public:
23 MBlazeELFWriterInfo(TargetMachine &TM);
24 virtual ~MBlazeELFWriterInfo();
25
26 /// getRelocationType - Returns the target specific ELF Relocation type.
27 /// 'MachineRelTy' contains the object code independent relocation type
28 virtual unsigned getRelocationType(unsigned MachineRelTy) const;
29
30 /// hasRelocationAddend - True if the target uses an addend in the
31 /// ELF relocation entry.
32 virtual bool hasRelocationAddend() const { return false; }
33
34 /// getDefaultAddendForRelTy - Gets the default addend value for a
35 /// relocation entry based on the target ELF relocation type.
36 virtual long int getDefaultAddendForRelTy(unsigned RelTy,
37 long int Modifier = 0) const;
38
39 /// getRelTySize - Returns the size of relocatable field in bits
40 virtual unsigned getRelocationTySize(unsigned RelTy) const;
41
42 /// isPCRelativeRel - True if the relocation type is pc relative
43 virtual bool isPCRelativeRel(unsigned RelTy) const;
44
45 /// getJumpTableRelocationTy - Returns the machine relocation type used
46 /// to reference a jumptable.
47 virtual unsigned getAbsoluteLabelMachineRelTy() const;
48
49 /// computeRelocation - Some relocatable fields could be relocated
50 /// directly, avoiding the relocation symbol emission, compute the
51 /// final relocation value for this symbol.
52 virtual long int computeRelocation(unsigned SymOffset, unsigned RelOffset,
53 unsigned RelTy) const;
54 };
55
56} // end llvm namespace
57
58#endif // MBLAZE_ELF_WRITER_INFO_H