Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: lib/Target/MBlaze/MBlazeELFWriterInfo.cpp

Issue 4294001: arm-mc-elf-s07 (Closed)
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/Target/MBlaze/MBlazeELFWriterInfo.h ('k') | lib/Target/X86/X86ELFWriterInfo.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « lib/Target/MBlaze/MBlazeELFWriterInfo.h ('k') | lib/Target/X86/X86ELFWriterInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698