@@ -99,8 +99,7 @@ bool AArch64MachObjectWriter::getAArch64FixupKindMachOInfo(
99
99
// This encompasses the relocation for the whole 21-bit value.
100
100
switch (Spec) {
101
101
default :
102
- Asm.getContext ().reportError (Fixup.getLoc (),
103
- " ADR/ADRP relocations must be GOT relative" );
102
+ reportError (Fixup.getLoc (), " ADR/ADRP relocations must be GOT relative" );
104
103
return false ;
105
104
case AArch64MCExpr::M_PAGE:
106
105
RelocType = unsigned (MachO::ARM64_RELOC_PAGE21);
@@ -176,25 +175,24 @@ void AArch64MachObjectWriter::recordRelocation(
176
175
// assembler local symbols. If we got here, that's not what we have,
177
176
// so complain loudly.
178
177
if (Kind == AArch64::fixup_aarch64_pcrel_branch19) {
179
- Asm. getContext (). reportError (
180
- Fixup. getLoc (), " conditional branch requires assembler-local "
181
- " label. ' " +
182
- Target. getAddSym ()-> getName () + " ' is external." );
178
+ reportError (Fixup. getLoc (), " conditional branch requires assembler-local "
179
+ " label. ' " +
180
+ Target. getAddSym ()-> getName () +
181
+ " ' is external." );
183
182
return ;
184
183
}
185
184
186
185
// 14-bit branch relocations should only target internal labels, and so
187
186
// should never get here.
188
187
if (Kind == AArch64::fixup_aarch64_pcrel_branch14) {
189
- Asm.getContext ().reportError (Fixup.getLoc (),
190
- " Invalid relocation on conditional branch!" );
188
+ reportError (Fixup.getLoc (), " Invalid relocation on conditional branch!" );
191
189
return ;
192
190
}
193
191
194
192
if (!getAArch64FixupKindMachOInfo (
195
193
Fixup, Type, AArch64MCExpr::Specifier (Target.getSpecifier ()),
196
194
Log2Size, Asm)) {
197
- Asm. getContext (). reportError (Fixup.getLoc (), " unknown AArch64 fixup kind!" );
195
+ reportError (Fixup.getLoc (), " unknown AArch64 fixup kind!" );
198
196
return ;
199
197
}
200
198
@@ -206,8 +204,7 @@ void AArch64MachObjectWriter::recordRelocation(
206
204
Type = MachO::ARM64_RELOC_UNSIGNED;
207
205
208
206
if (IsPCRel) {
209
- Asm.getContext ().reportError (Fixup.getLoc (),
210
- " PC relative absolute relocation!" );
207
+ reportError (Fixup.getLoc (), " PC relative absolute relocation!" );
211
208
return ;
212
209
213
210
// FIXME: x86_64 sets the type to a branch reloc here. Should we do
@@ -234,16 +231,14 @@ void AArch64MachObjectWriter::recordRelocation(
234
231
return ;
235
232
} else if (Target.getSpecifier () != AArch64MCExpr::None) {
236
233
// Otherwise, neither symbol can be modified.
237
- Asm.getContext ().reportError (Fixup.getLoc (),
238
- " unsupported relocation of modified symbol" );
234
+ reportError (Fixup.getLoc (), " unsupported relocation of modified symbol" );
239
235
return ;
240
236
}
241
237
242
238
// We don't support PCrel relocations of differences.
243
239
if (IsPCRel) {
244
- Asm.getContext ().reportError (Fixup.getLoc (),
245
- " unsupported pc-relative relocation of "
246
- " difference" );
240
+ reportError (Fixup.getLoc (), " unsupported pc-relative relocation of "
241
+ " difference" );
247
242
return ;
248
243
}
249
244
@@ -254,23 +249,20 @@ void AArch64MachObjectWriter::recordRelocation(
254
249
// FIXME: We should probably just synthesize an external symbol and use
255
250
// that.
256
251
if (!A_Base) {
257
- Asm.getContext ().reportError (
258
- Fixup.getLoc (),
259
- " unsupported relocation of local symbol '" + A->getName () +
260
- " '. Must have non-local symbol earlier in section." );
252
+ reportError (Fixup.getLoc (),
253
+ " unsupported relocation of local symbol '" + A->getName () +
254
+ " '. Must have non-local symbol earlier in section." );
261
255
return ;
262
256
}
263
257
if (!B_Base) {
264
- Asm.getContext ().reportError (
265
- Fixup.getLoc (),
266
- " unsupported relocation of local symbol '" + B->getName () +
267
- " '. Must have non-local symbol earlier in section." );
258
+ reportError (Fixup.getLoc (),
259
+ " unsupported relocation of local symbol '" + B->getName () +
260
+ " '. Must have non-local symbol earlier in section." );
268
261
return ;
269
262
}
270
263
271
264
if (A_Base == B_Base && A_Base) {
272
- Asm.getContext ().reportError (
273
- Fixup.getLoc (), " unsupported relocation with identical base" );
265
+ reportError (Fixup.getLoc (), " unsupported relocation with identical base" );
274
266
return ;
275
267
}
276
268
@@ -303,10 +295,10 @@ void AArch64MachObjectWriter::recordRelocation(
303
295
// Make sure that the symbol is actually in a section here. If it isn't,
304
296
// emit an error and exit.
305
297
if (!Symbol->isInSection ()) {
306
- Asm. getContext (). reportError (
307
- Fixup. getLoc (),
308
- " unsupported relocation of local symbol ' " + Symbol->getName () +
309
- " '. Must have non-local symbol earlier in section." );
298
+ reportError (Fixup. getLoc (),
299
+ " unsupported relocation of local symbol ' " +
300
+ Symbol->getName () +
301
+ " '. Must have non-local symbol earlier in section." );
310
302
return ;
311
303
}
312
304
const MCSection &Sec = Symbol->getSection ();
@@ -340,10 +332,10 @@ void AArch64MachObjectWriter::recordRelocation(
340
332
Value += Asm.getSymbolOffset (*Symbol) - Asm.getSymbolOffset (*Base);
341
333
} else if (Symbol->isInSection ()) {
342
334
if (!CanUseLocalRelocation) {
343
- Asm. getContext (). reportError (
344
- Fixup. getLoc (),
345
- " unsupported relocation of local symbol ' " + Symbol->getName () +
346
- " '. Must have non-local symbol earlier in section." );
335
+ reportError (Fixup. getLoc (),
336
+ " unsupported relocation of local symbol ' " +
337
+ Symbol->getName () +
338
+ " '. Must have non-local symbol earlier in section." );
347
339
return ;
348
340
}
349
341
// Adjust the relocation to be section-relative.
@@ -369,8 +361,7 @@ void AArch64MachObjectWriter::recordRelocation(
369
361
Type == MachO::ARM64_RELOC_PAGEOFF12) &&
370
362
Value) {
371
363
if (!isInt<24 >(Value)) {
372
- Asm.getContext ().reportError (Fixup.getLoc (),
373
- " addend too big for relocation" );
364
+ reportError (Fixup.getLoc (), " addend too big for relocation" );
374
365
return ;
375
366
}
376
367
@@ -398,30 +389,27 @@ void AArch64MachObjectWriter::recordRelocation(
398
389
assert (Type == MachO::ARM64_RELOC_UNSIGNED);
399
390
400
391
if (IsPCRel) {
401
- Asm.getContext ().reportError (Fixup.getLoc (),
402
- " invalid PC relative auth relocation" );
392
+ reportError (Fixup.getLoc (), " invalid PC relative auth relocation" );
403
393
return ;
404
394
}
405
395
406
396
if (Log2Size != 3 ) {
407
- Asm. getContext (). reportError (
408
- Fixup. getLoc (), " invalid auth relocation size, must be 8 bytes" );
397
+ reportError (Fixup. getLoc (),
398
+ " invalid auth relocation size, must be 8 bytes" );
409
399
return ;
410
400
}
411
401
412
402
if (Target.getSubSym ()) {
413
- Asm.getContext ().reportError (
414
- Fixup.getLoc (),
415
- " invalid auth relocation, can't reference two symbols" );
403
+ reportError (Fixup.getLoc (),
404
+ " invalid auth relocation, can't reference two symbols" );
416
405
return ;
417
406
}
418
407
419
408
uint16_t Discriminator = Expr->getDiscriminator ();
420
409
AArch64PACKey::ID Key = Expr->getKey ();
421
410
422
411
if (!isInt<32 >(Value)) {
423
- Asm.getContext ().reportError (Fixup.getLoc (),
424
- " addend too big for relocation" );
412
+ reportError (Fixup.getLoc (), " addend too big for relocation" );
425
413
return ;
426
414
}
427
415
0 commit comments