| OLD | NEW |
| 1 //===-- MBlazeELFWriterInfo.cpp - ELF Writer Info for the MBlaze backend --===// | 1 //===-- MBlazeELFWriterInfo.cpp - ELF Writer Info for the MBlaze backend --===// |
| 2 // | 2 // |
| 3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file implements ELF writer information for the MBlaze backend. | 10 // This file implements ELF writer information for the MBlaze backend. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // Implementation of the MBlazeELFWriterInfo class | 24 // Implementation of the MBlazeELFWriterInfo class |
| 25 //===----------------------------------------------------------------------===// | 25 //===----------------------------------------------------------------------===// |
| 26 | 26 |
| 27 MBlazeELFWriterInfo::MBlazeELFWriterInfo(TargetMachine &TM) | 27 MBlazeELFWriterInfo::MBlazeELFWriterInfo(TargetMachine &TM) |
| 28 : TargetELFWriterInfo(TM.getTargetData()->getPointerSizeInBits() == 64, | 28 : TargetELFWriterInfo(TM.getTargetData()->getPointerSizeInBits() == 64, |
| 29 TM.getTargetData()->isLittleEndian()) { | 29 TM.getTargetData()->isLittleEndian()) { |
| 30 } | 30 } |
| 31 | 31 |
| 32 MBlazeELFWriterInfo::~MBlazeELFWriterInfo() {} | 32 MBlazeELFWriterInfo::~MBlazeELFWriterInfo() {} |
| 33 | 33 |
| 34 unsigned MBlazeELFWriterInfo::getRelocationType(unsigned MachineRelTy) const { | 34 unsigned MBlazeELFWriterInfo::getRelocationType(const BinaryObject &, |
| 35 const MachineRelocation & |
| 36 MR) const { |
| 37 unsigned MachineRelTy = MR.getRelocationType(); |
| 35 switch(MachineRelTy) { | 38 switch(MachineRelTy) { |
| 36 case MBlaze::reloc_pcrel_word: | 39 case MBlaze::reloc_pcrel_word: |
| 37 return R_MICROBLAZE_64_PCREL; | 40 return R_MICROBLAZE_64_PCREL; |
| 38 case MBlaze::reloc_absolute_word: | 41 case MBlaze::reloc_absolute_word: |
| 39 return R_MICROBLAZE_NONE; | 42 return R_MICROBLAZE_NONE; |
| 40 default: | 43 default: |
| 41 llvm_unreachable("unknown mblaze machine relocation type"); | 44 llvm_unreachable("unknown mblaze machine relocation type"); |
| 42 } | 45 } |
| 43 return 0; | 46 return 0; |
| 44 } | 47 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 long int MBlazeELFWriterInfo::computeRelocation(unsigned SymOffset, | 104 long int MBlazeELFWriterInfo::computeRelocation(unsigned SymOffset, |
| 102 unsigned RelOffset, | 105 unsigned RelOffset, |
| 103 unsigned RelTy) const { | 106 unsigned RelTy) const { |
| 104 if (RelTy == R_MICROBLAZE_32_PCREL || R_MICROBLAZE_64_PCREL) | 107 if (RelTy == R_MICROBLAZE_32_PCREL || R_MICROBLAZE_64_PCREL) |
| 105 return SymOffset - (RelOffset + 4); | 108 return SymOffset - (RelOffset + 4); |
| 106 else | 109 else |
| 107 assert("computeRelocation unknown for this relocation type"); | 110 assert("computeRelocation unknown for this relocation type"); |
| 108 | 111 |
| 109 return 0; | 112 return 0; |
| 110 } | 113 } |
| OLD | NEW |