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

Side by Side Diff: lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp

Issue 183273009: Prep for merging 3.4: Undo changes from 3.3 branch (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Retry Created 6 years, 9 months 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/NVPTX/NVVMReflect.cpp ('k') | lib/Target/PowerPC/PPCBranchSelector.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===-- PPCELFObjectWriter.cpp - PPC ELF Writer ---------------------------===// 1 //===-- PPCELFObjectWriter.cpp - PPC ELF Writer ---------------------------===//
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 #include "MCTargetDesc/PPCMCTargetDesc.h" 10 #include "MCTargetDesc/PPCMCTargetDesc.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 break; 100 break;
101 case PPC::fixup_ppc_ha16: 101 case PPC::fixup_ppc_ha16:
102 switch (Modifier) { 102 switch (Modifier) {
103 default: llvm_unreachable("Unsupported Modifier"); 103 default: llvm_unreachable("Unsupported Modifier");
104 case MCSymbolRefExpr::VK_PPC_TPREL16_HA: 104 case MCSymbolRefExpr::VK_PPC_TPREL16_HA:
105 Type = ELF::R_PPC_TPREL16_HA; 105 Type = ELF::R_PPC_TPREL16_HA;
106 break; 106 break;
107 case MCSymbolRefExpr::VK_PPC_DTPREL16_HA: 107 case MCSymbolRefExpr::VK_PPC_DTPREL16_HA:
108 Type = ELF::R_PPC64_DTPREL16_HA; 108 Type = ELF::R_PPC64_DTPREL16_HA;
109 break; 109 break;
110 case MCSymbolRefExpr::VK_PPC_GAS_HA16: 110 case MCSymbolRefExpr::VK_None:
111 case MCSymbolRefExpr::VK_PPC_DARWIN_HA16:
112 Type = ELF::R_PPC_ADDR16_HA; 111 Type = ELF::R_PPC_ADDR16_HA;
113 break; 112 break;
114 case MCSymbolRefExpr::VK_PPC_TOC16_HA: 113 case MCSymbolRefExpr::VK_PPC_TOC16_HA:
115 Type = ELF::R_PPC64_TOC16_HA; 114 Type = ELF::R_PPC64_TOC16_HA;
116 break; 115 break;
117 case MCSymbolRefExpr::VK_PPC_GOT_TPREL16_HA: 116 case MCSymbolRefExpr::VK_PPC_GOT_TPREL16_HA:
118 Type = ELF::R_PPC64_GOT_TPREL16_HA; 117 Type = ELF::R_PPC64_GOT_TPREL16_HA;
119 break; 118 break;
120 case MCSymbolRefExpr::VK_PPC_GOT_TLSGD16_HA: 119 case MCSymbolRefExpr::VK_PPC_GOT_TLSGD16_HA:
121 Type = ELF::R_PPC64_GOT_TLSGD16_HA; 120 Type = ELF::R_PPC64_GOT_TLSGD16_HA;
122 break; 121 break;
123 case MCSymbolRefExpr::VK_PPC_GOT_TLSLD16_HA: 122 case MCSymbolRefExpr::VK_PPC_GOT_TLSLD16_HA:
124 Type = ELF::R_PPC64_GOT_TLSLD16_HA; 123 Type = ELF::R_PPC64_GOT_TLSLD16_HA;
125 break; 124 break;
126 } 125 }
127 break; 126 break;
128 case PPC::fixup_ppc_lo16: 127 case PPC::fixup_ppc_lo16:
129 switch (Modifier) { 128 switch (Modifier) {
130 default: llvm_unreachable("Unsupported Modifier"); 129 default: llvm_unreachable("Unsupported Modifier");
131 case MCSymbolRefExpr::VK_PPC_TPREL16_LO: 130 case MCSymbolRefExpr::VK_PPC_TPREL16_LO:
132 Type = ELF::R_PPC_TPREL16_LO; 131 Type = ELF::R_PPC_TPREL16_LO;
133 break; 132 break;
134 case MCSymbolRefExpr::VK_PPC_DTPREL16_LO: 133 case MCSymbolRefExpr::VK_PPC_DTPREL16_LO:
135 Type = ELF::R_PPC64_DTPREL16_LO; 134 Type = ELF::R_PPC64_DTPREL16_LO;
136 break; 135 break;
137 case MCSymbolRefExpr::VK_None: 136 case MCSymbolRefExpr::VK_None:
138 Type = ELF::R_PPC_ADDR16;
139 break;
140 case MCSymbolRefExpr::VK_PPC_GAS_LO16:
141 case MCSymbolRefExpr::VK_PPC_DARWIN_LO16:
142 Type = ELF::R_PPC_ADDR16_LO; 137 Type = ELF::R_PPC_ADDR16_LO;
143 break; 138 break;
144 case MCSymbolRefExpr::VK_PPC_TOC_ENTRY: 139 case MCSymbolRefExpr::VK_PPC_TOC_ENTRY:
145 Type = ELF::R_PPC64_TOC16; 140 Type = ELF::R_PPC64_TOC16;
146 break; 141 break;
147 case MCSymbolRefExpr::VK_PPC_TOC16_LO: 142 case MCSymbolRefExpr::VK_PPC_TOC16_LO:
148 Type = ELF::R_PPC64_TOC16_LO; 143 Type = ELF::R_PPC64_TOC16_LO;
149 break; 144 break;
150 case MCSymbolRefExpr::VK_PPC_GOT_TLSGD16_LO: 145 case MCSymbolRefExpr::VK_PPC_GOT_TLSGD16_LO:
151 Type = ELF::R_PPC64_GOT_TLSGD16_LO; 146 Type = ELF::R_PPC64_GOT_TLSGD16_LO;
152 break; 147 break;
153 case MCSymbolRefExpr::VK_PPC_GOT_TLSLD16_LO: 148 case MCSymbolRefExpr::VK_PPC_GOT_TLSLD16_LO:
154 Type = ELF::R_PPC64_GOT_TLSLD16_LO; 149 Type = ELF::R_PPC64_GOT_TLSLD16_LO;
155 break; 150 break;
156 } 151 }
157 break; 152 break;
158 case PPC::fixup_ppc_lo16_ds: 153 case PPC::fixup_ppc_lo16_ds:
159 switch (Modifier) { 154 switch (Modifier) {
160 default: llvm_unreachable("Unsupported Modifier"); 155 default: llvm_unreachable("Unsupported Modifier");
161 case MCSymbolRefExpr::VK_None: 156 case MCSymbolRefExpr::VK_None:
162 Type = ELF::R_PPC64_ADDR16_DS; 157 Type = ELF::R_PPC64_ADDR16_DS;
163 break; 158 break;
164 case MCSymbolRefExpr::VK_PPC_GAS_LO16:
165 case MCSymbolRefExpr::VK_PPC_DARWIN_LO16:
166 Type = ELF::R_PPC64_ADDR16_LO_DS;
167 break;
168 case MCSymbolRefExpr::VK_PPC_TOC_ENTRY: 159 case MCSymbolRefExpr::VK_PPC_TOC_ENTRY:
169 Type = ELF::R_PPC64_TOC16_DS; 160 Type = ELF::R_PPC64_TOC16_DS;
170 break; 161 break;
171 case MCSymbolRefExpr::VK_PPC_TOC16_LO: 162 case MCSymbolRefExpr::VK_PPC_TOC16_LO:
172 Type = ELF::R_PPC64_TOC16_LO_DS; 163 Type = ELF::R_PPC64_TOC16_LO_DS;
173 break; 164 break;
174 case MCSymbolRefExpr::VK_PPC_GOT_TPREL16_LO: 165 case MCSymbolRefExpr::VK_PPC_GOT_TPREL16_LO:
175 Type = ELF::R_PPC64_GOT_TPREL16_LO_DS; 166 Type = ELF::R_PPC64_GOT_TPREL16_LO_DS;
176 break; 167 break;
177 } 168 }
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 } 271 }
281 } 272 }
282 273
283 274
284 MCObjectWriter *llvm::createPPCELFObjectWriter(raw_ostream &OS, 275 MCObjectWriter *llvm::createPPCELFObjectWriter(raw_ostream &OS,
285 bool Is64Bit, 276 bool Is64Bit,
286 uint8_t OSABI) { 277 uint8_t OSABI) {
287 MCELFObjectTargetWriter *MOTW = new PPCELFObjectWriter(Is64Bit, OSABI); 278 MCELFObjectTargetWriter *MOTW = new PPCELFObjectWriter(Is64Bit, OSABI);
288 return createELFObjectWriter(MOTW, OS, /*IsLittleEndian=*/false); 279 return createELFObjectWriter(MOTW, OS, /*IsLittleEndian=*/false);
289 } 280 }
OLDNEW
« no previous file with comments | « lib/Target/NVPTX/NVVMReflect.cpp ('k') | lib/Target/PowerPC/PPCBranchSelector.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698