@@ -146,8 +146,8 @@ unsigned AArch64ELFObjectWriter::getRelocType(MCContext &Ctx,
146
146
" ILP32 8 byte PC relative data "
147
147
" relocation not supported (LP64 eqv: PREL64)" );
148
148
return ELF::R_AARCH64_NONE;
149
- } else
150
- return ELF::R_AARCH64_PREL64;
149
+ }
150
+ return ELF::R_AARCH64_PREL64;
151
151
case AArch64::fixup_aarch64_pcrel_adr_imm21:
152
152
if (SymLoc != AArch64MCExpr::VK_ABS)
153
153
Ctx.reportError (Fixup.getLoc (),
@@ -162,9 +162,8 @@ unsigned AArch64ELFObjectWriter::getRelocType(MCContext &Ctx,
162
162
" invalid fixup for 32-bit pcrel ADRP instruction "
163
163
" VK_ABS VK_NC" );
164
164
return ELF::R_AARCH64_NONE;
165
- } else {
166
- return ELF::R_AARCH64_ADR_PREL_PG_HI21_NC;
167
165
}
166
+ return ELF::R_AARCH64_ADR_PREL_PG_HI21_NC;
168
167
}
169
168
if (SymLoc == AArch64MCExpr::VK_GOT && !IsNC)
170
169
return R_CLS (ADR_GOT_PAGE);
@@ -286,14 +285,12 @@ unsigned AArch64ELFObjectWriter::getRelocType(MCContext &Ctx,
286
285
if (SymLoc == AArch64MCExpr::VK_TPREL && IsNC)
287
286
return R_CLS (TLSLE_LDST32_TPREL_LO12_NC);
288
287
if (SymLoc == AArch64MCExpr::VK_GOT && IsNC) {
289
- if (IsILP32) {
288
+ if (IsILP32)
290
289
return ELF::R_AARCH64_P32_LD32_GOT_LO12_NC;
291
- } else {
292
- Ctx.reportError (Fixup.getLoc (),
293
- " LP64 4 byte unchecked GOT load/store relocation "
294
- " not supported (ILP32 eqv: LD32_GOT_LO12_NC" );
295
- return ELF::R_AARCH64_NONE;
296
- }
290
+ Ctx.reportError (Fixup.getLoc (),
291
+ " LP64 4 byte unchecked GOT load/store relocation "
292
+ " not supported (ILP32 eqv: LD32_GOT_LO12_NC" );
293
+ return ELF::R_AARCH64_NONE;
297
294
}
298
295
if (SymLoc == AArch64MCExpr::VK_GOT && !IsNC) {
299
296
if (IsILP32) {
@@ -309,25 +306,20 @@ unsigned AArch64ELFObjectWriter::getRelocType(MCContext &Ctx,
309
306
return ELF::R_AARCH64_NONE;
310
307
}
311
308
if (SymLoc == AArch64MCExpr::VK_GOTTPREL && IsNC) {
312
- if (IsILP32) {
309
+ if (IsILP32)
313
310
return ELF::R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC;
314
- } else {
315
- Ctx.reportError (Fixup.getLoc (),
316
- " LP64 32-bit load/store "
317
- " relocation not supported (ILP32 eqv: "
318
- " TLSIE_LD32_GOTTPREL_LO12_NC)" );
319
- return ELF::R_AARCH64_NONE;
320
- }
311
+ Ctx.reportError (Fixup.getLoc (), " LP64 32-bit load/store "
312
+ " relocation not supported (ILP32 eqv: "
313
+ " TLSIE_LD32_GOTTPREL_LO12_NC)" );
314
+ return ELF::R_AARCH64_NONE;
321
315
}
322
316
if (SymLoc == AArch64MCExpr::VK_TLSDESC && !IsNC) {
323
- if (IsILP32) {
317
+ if (IsILP32)
324
318
return ELF::R_AARCH64_P32_TLSDESC_LD32_LO12;
325
- } else {
326
- Ctx.reportError (Fixup.getLoc (),
327
- " LP64 4 byte TLSDESC load/store relocation "
328
- " not supported (ILP32 eqv: TLSDESC_LD64_LO12)" );
329
- return ELF::R_AARCH64_NONE;
330
- }
319
+ Ctx.reportError (Fixup.getLoc (),
320
+ " LP64 4 byte TLSDESC load/store relocation "
321
+ " not supported (ILP32 eqv: TLSDESC_LD64_LO12)" );
322
+ return ELF::R_AARCH64_NONE;
331
323
}
332
324
333
325
Ctx.reportError (Fixup.getLoc (),
@@ -344,12 +336,11 @@ unsigned AArch64ELFObjectWriter::getRelocType(MCContext &Ctx,
344
336
if (AddressLoc == AArch64MCExpr::VK_LO15)
345
337
return ELF::R_AARCH64_LD64_GOTPAGE_LO15;
346
338
return ELF::R_AARCH64_LD64_GOT_LO12_NC;
347
- } else {
348
- Ctx.reportError (Fixup.getLoc (), " ILP32 64-bit load/store "
349
- " relocation not supported (LP64 eqv: "
350
- " LD64_GOT_LO12_NC)" );
351
- return ELF::R_AARCH64_NONE;
352
339
}
340
+ Ctx.reportError (Fixup.getLoc (), " ILP32 64-bit load/store "
341
+ " relocation not supported (LP64 eqv: "
342
+ " LD64_GOT_LO12_NC)" );
343
+ return ELF::R_AARCH64_NONE;
353
344
}
354
345
if (SymLoc == AArch64MCExpr::VK_DTPREL && !IsNC)
355
346
return R_CLS (TLSLD_LDST64_DTPREL_LO12);
@@ -360,24 +351,20 @@ unsigned AArch64ELFObjectWriter::getRelocType(MCContext &Ctx,
360
351
if (SymLoc == AArch64MCExpr::VK_TPREL && IsNC)
361
352
return R_CLS (TLSLE_LDST64_TPREL_LO12_NC);
362
353
if (SymLoc == AArch64MCExpr::VK_GOTTPREL && IsNC) {
363
- if (!IsILP32) {
354
+ if (!IsILP32)
364
355
return ELF::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC;
365
- } else {
366
- Ctx.reportError (Fixup.getLoc (), " ILP32 64-bit load/store "
367
- " relocation not supported (LP64 eqv: "
368
- " TLSIE_LD64_GOTTPREL_LO12_NC)" );
369
- return ELF::R_AARCH64_NONE;
370
- }
356
+ Ctx.reportError (Fixup.getLoc (), " ILP32 64-bit load/store "
357
+ " relocation not supported (LP64 eqv: "
358
+ " TLSIE_LD64_GOTTPREL_LO12_NC)" );
359
+ return ELF::R_AARCH64_NONE;
371
360
}
372
361
if (SymLoc == AArch64MCExpr::VK_TLSDESC) {
373
- if (!IsILP32) {
362
+ if (!IsILP32)
374
363
return ELF::R_AARCH64_TLSDESC_LD64_LO12;
375
- } else {
376
- Ctx.reportError (Fixup.getLoc (), " ILP32 64-bit load/store "
377
- " relocation not supported (LP64 eqv: "
378
- " TLSDESC_LD64_LO12)" );
379
- return ELF::R_AARCH64_NONE;
380
- }
364
+ Ctx.reportError (Fixup.getLoc (), " ILP32 64-bit load/store "
365
+ " relocation not supported (LP64 eqv: "
366
+ " TLSDESC_LD64_LO12)" );
367
+ return ELF::R_AARCH64_NONE;
381
368
}
382
369
Ctx.reportError (Fixup.getLoc (),
383
370
" invalid fixup for 64-bit load/store instruction" );
0 commit comments