Add in the first iteration of support for llvm/clang/lldb to allow variable per addre...
[oota-llvm.git] / lib / Target / ARM / ARMELFWriterInfo.cpp
1 //===-- ARMELFWriterInfo.cpp - ELF Writer Info for the ARM backend --------===//
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 ARM backend.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "ARMELFWriterInfo.h"
15 #include "ARMRelocations.h"
16 #include "llvm/Function.h"
17 #include "llvm/Support/ErrorHandling.h"
18 #include "llvm/DataLayout.h"
19 #include "llvm/Target/TargetMachine.h"
20 #include "llvm/Support/ELF.h"
21
22 using namespace llvm;
23
24 //===----------------------------------------------------------------------===//
25 //  Implementation of the ARMELFWriterInfo class
26 //===----------------------------------------------------------------------===//
27
28 ARMELFWriterInfo::ARMELFWriterInfo(TargetMachine &TM)
29   : TargetELFWriterInfo(TM.getDataLayout()->getPointerSizeInBits(0) == 64,
30                         TM.getDataLayout()->isLittleEndian()) {
31 }
32
33 ARMELFWriterInfo::~ARMELFWriterInfo() {}
34
35 unsigned ARMELFWriterInfo::getRelocationType(unsigned MachineRelTy) const {
36   switch (MachineRelTy) {
37   case ARM::reloc_arm_absolute:
38   case ARM::reloc_arm_relative:
39   case ARM::reloc_arm_cp_entry:
40   case ARM::reloc_arm_vfp_cp_entry:
41   case ARM::reloc_arm_machine_cp_entry:
42   case ARM::reloc_arm_jt_base:
43   case ARM::reloc_arm_pic_jt:
44     llvm_unreachable("unsupported ARM relocation type");
45
46   case ARM::reloc_arm_branch: return ELF::R_ARM_CALL;
47   case ARM::reloc_arm_movt:   return ELF::R_ARM_MOVT_ABS;
48   case ARM::reloc_arm_movw:   return ELF::R_ARM_MOVW_ABS_NC;
49   default:
50     llvm_unreachable("unknown ARM relocation type");
51   }
52 }
53
54 long int ARMELFWriterInfo::getDefaultAddendForRelTy(unsigned RelTy,
55                                                     long int Modifier) const {
56   llvm_unreachable("ARMELFWriterInfo::getDefaultAddendForRelTy() not "
57                    "implemented");
58 }
59
60 unsigned ARMELFWriterInfo::getRelocationTySize(unsigned RelTy) const {
61   llvm_unreachable("ARMELFWriterInfo::getRelocationTySize() not implemented");
62 }
63
64 bool ARMELFWriterInfo::isPCRelativeRel(unsigned RelTy) const {
65   llvm_unreachable("ARMELFWriterInfo::isPCRelativeRel() not implemented");
66 }
67
68 unsigned ARMELFWriterInfo::getAbsoluteLabelMachineRelTy() const {
69   llvm_unreachable("ARMELFWriterInfo::getAbsoluteLabelMachineRelTy() not "
70                    "implemented");
71 }
72
73 long int ARMELFWriterInfo::computeRelocation(unsigned SymOffset,
74                                              unsigned RelOffset,
75                                              unsigned RelTy) const {
76   llvm_unreachable("ARMELFWriterInfo::getAbsoluteLabelMachineRelTy() not "
77                    "implemented");
78 }