Skip to content

Commit 77b4f0a

Browse files
author
George Rimar
committed
[LLD][ELF] - Improve diagnostic about unrecognized relocations.
This is a minor improvement inspired by https://bugs.llvm.org/show_bug.cgi?id=38303. A person reported that he observed message complaining about unsupported R_ARM_V4BX: error: can't create dynamic relocation R_ARM_V4BX against local symbol in readonly segment; recompile object files with -fPIC But with -z notext he only saw a relocation number, what is not convenient: error: ../../gfx/cairo/libpixman/src/pixman-arm-neon-asm-bilinear.o:(.text+0x4F0): unrecognized reloc 40 Also, in the error messages we use relocation but not reloc. With this patch we start to print one of the following messages: error: file.o: unrecognized relocation Unknown(999) error: file.o: unrecognized relocation R_X_KNOWN_BY_LLVM_BUT_UNSUPPORTED_BY_LLD_NAME There is no way to write a test for that I believe. Differential revision: https://reviews.llvm.org/D62237 llvm-svn: 361472
1 parent 691502f commit 77b4f0a

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

lld/ELF/Arch/AArch64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ void AArch64::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const {
350350
or32AArch64Imm(Loc, Val);
351351
break;
352352
default:
353-
error(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type));
353+
error(getErrorLocation(Loc) + "unrecognized relocation " + toString(Type));
354354
}
355355
}
356356

lld/ELF/Arch/ARM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ void ARM::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const {
518518
(Val & 0x00ff)); // imm8
519519
break;
520520
default:
521-
error(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type));
521+
error(getErrorLocation(Loc) + "unrecognized relocation " + toString(Type));
522522
}
523523
}
524524

lld/ELF/Arch/AVR.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void AVR::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const {
6666
break;
6767
}
6868
default:
69-
error(getErrorLocation(Loc) + "unrecognized reloc " + toString(Type));
69+
error(getErrorLocation(Loc) + "unrecognized relocation " + toString(Type));
7070
}
7171
}
7272

lld/ELF/Arch/Hexagon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ void Hexagon::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const {
246246
or32le(Loc, applyMask(0x00c03fff, Val));
247247
break;
248248
default:
249-
error(getErrorLocation(Loc) + "unrecognized reloc " + toString(Type));
249+
error(getErrorLocation(Loc) + "unrecognized relocation " + toString(Type));
250250
break;
251251
}
252252
}

lld/ELF/Arch/MSP430.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void MSP430::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const {
8383
break;
8484
}
8585
default:
86-
error(getErrorLocation(Loc) + "unrecognized reloc " + toString(Type));
86+
error(getErrorLocation(Loc) + "unrecognized relocation " + toString(Type));
8787
}
8888
}
8989

lld/ELF/Arch/PPC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void PPC::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const {
6969
write32be(Loc, read32be(Loc) | (Val & 0x3FFFFFC));
7070
break;
7171
default:
72-
error(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type));
72+
error(getErrorLocation(Loc) + "unrecognized relocation " + toString(Type));
7373
}
7474
}
7575

lld/ELF/Arch/PPC64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ void PPC64::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const {
860860
write64(Loc, Val - DynamicThreadPointerOffset);
861861
break;
862862
default:
863-
error(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type));
863+
error(getErrorLocation(Loc) + "unrecognized relocation " + toString(Type));
864864
}
865865
}
866866

0 commit comments

Comments
 (0)