| OLD | NEW |
| 1 //===-- MBlazeELFWriterInfo.h - ELF Writer Info for MBlaze ------*- C++ -*-===// | 1 //===-- MBlazeELFWriterInfo.h - ELF Writer Info for MBlaze ------*- C++ -*-===// |
| 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. |
| 11 // | 11 // |
| 12 //===----------------------------------------------------------------------===// | 12 //===----------------------------------------------------------------------===// |
| 13 | 13 |
| 14 #ifndef MBLAZE_ELF_WRITER_INFO_H | 14 #ifndef MBLAZE_ELF_WRITER_INFO_H |
| 15 #define MBLAZE_ELF_WRITER_INFO_H | 15 #define MBLAZE_ELF_WRITER_INFO_H |
| 16 | 16 |
| 17 #include "llvm/Target/TargetELFWriterInfo.h" | 17 #include "llvm/Target/TargetELFWriterInfo.h" |
| 18 | 18 |
| 19 namespace llvm { | 19 namespace llvm { |
| 20 class MachineRelocation; |
| 20 | 21 |
| 21 class MBlazeELFWriterInfo : public TargetELFWriterInfo { | 22 class MBlazeELFWriterInfo : public TargetELFWriterInfo { |
| 22 | 23 |
| 23 // ELF Relocation types for MBlaze | 24 // ELF Relocation types for MBlaze |
| 24 enum MBlazeRelocationType { | 25 enum MBlazeRelocationType { |
| 25 R_MICROBLAZE_NONE = 0, | 26 R_MICROBLAZE_NONE = 0, |
| 26 R_MICROBLAZE_32 = 1, | 27 R_MICROBLAZE_32 = 1, |
| 27 R_MICROBLAZE_32_PCREL = 2, | 28 R_MICROBLAZE_32_PCREL = 2, |
| 28 R_MICROBLAZE_64_PCREL = 3, | 29 R_MICROBLAZE_64_PCREL = 3, |
| 29 R_MICROBLAZE_32_PCREL_LO = 4, | 30 R_MICROBLAZE_32_PCREL_LO = 4, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 44 R_MICROBLAZE_GOTOFF_64 = 19, | 45 R_MICROBLAZE_GOTOFF_64 = 19, |
| 45 R_MICROBLAZE_GOTOFF_32 = 20, | 46 R_MICROBLAZE_GOTOFF_32 = 20, |
| 46 R_MICROBLAZE_COPY = 21 | 47 R_MICROBLAZE_COPY = 21 |
| 47 }; | 48 }; |
| 48 | 49 |
| 49 public: | 50 public: |
| 50 MBlazeELFWriterInfo(TargetMachine &TM); | 51 MBlazeELFWriterInfo(TargetMachine &TM); |
| 51 virtual ~MBlazeELFWriterInfo(); | 52 virtual ~MBlazeELFWriterInfo(); |
| 52 | 53 |
| 53 /// getRelocationType - Returns the target specific ELF Relocation type. | 54 /// getRelocationType - Returns the target specific ELF Relocation type. |
| 54 /// 'MachineRelTy' contains the object code independent relocation type | 55 /// S is the ELF section blob that contains the relocation |
| 55 virtual unsigned getRelocationType(unsigned MachineRelTy) const; | 56 /// MR contains the object code independent relocation type |
| 57 virtual unsigned getRelocationType(const BinaryObject &S, |
| 58 const MachineRelocation &MR) const; |
| 56 | 59 |
| 57 /// hasRelocationAddend - True if the target uses an addend in the | 60 /// hasRelocationAddend - True if the target uses an addend in the |
| 58 /// ELF relocation entry. | 61 /// ELF relocation entry. |
| 59 virtual bool hasRelocationAddend() const { return false; } | 62 virtual bool hasRelocationAddend() const { return false; } |
| 60 | 63 |
| 61 /// getDefaultAddendForRelTy - Gets the default addend value for a | 64 /// getDefaultAddendForRelTy - Gets the default addend value for a |
| 62 /// relocation entry based on the target ELF relocation type. | 65 /// relocation entry based on the target ELF relocation type. |
| 63 virtual long int getDefaultAddendForRelTy(unsigned RelTy, | 66 virtual long int getDefaultAddendForRelTy(unsigned RelTy, |
| 64 long int Modifier = 0) const; | 67 long int Modifier = 0) const; |
| 65 | 68 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 76 /// computeRelocation - Some relocatable fields could be relocated | 79 /// computeRelocation - Some relocatable fields could be relocated |
| 77 /// directly, avoiding the relocation symbol emission, compute the | 80 /// directly, avoiding the relocation symbol emission, compute the |
| 78 /// final relocation value for this symbol. | 81 /// final relocation value for this symbol. |
| 79 virtual long int computeRelocation(unsigned SymOffset, unsigned RelOffset, | 82 virtual long int computeRelocation(unsigned SymOffset, unsigned RelOffset, |
| 80 unsigned RelTy) const; | 83 unsigned RelTy) const; |
| 81 }; | 84 }; |
| 82 | 85 |
| 83 } // end llvm namespace | 86 } // end llvm namespace |
| 84 | 87 |
| 85 #endif // MBLAZE_ELF_WRITER_INFO_H | 88 #endif // MBLAZE_ELF_WRITER_INFO_H |
| OLD | NEW |