diff options
| author | George Rimar <grimar@accesssoftek.com> | 2019-05-23 09:50:18 +0000 |
|---|---|---|
| committer | George Rimar <grimar@accesssoftek.com> | 2019-05-23 09:50:18 +0000 |
| commit | 77b4f0abb82c419fedca2ae3a20e1201f752b894 (patch) | |
| tree | 090ef3949ff2163f373ed5176ef9f9e97d334cd0 | |
| parent | 691502f61e9e6e7de657b21f7c311d1cece3f99b (diff) | |
| download | bcm5719-llvm-77b4f0abb82c419fedca2ae3a20e1201f752b894.tar.gz bcm5719-llvm-77b4f0abb82c419fedca2ae3a20e1201f752b894.zip | |
[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
| -rw-r--r-- | lld/ELF/Arch/AArch64.cpp | 2 | ||||
| -rw-r--r-- | lld/ELF/Arch/ARM.cpp | 2 | ||||
| -rw-r--r-- | lld/ELF/Arch/AVR.cpp | 2 | ||||
| -rw-r--r-- | lld/ELF/Arch/Hexagon.cpp | 2 | ||||
| -rw-r--r-- | lld/ELF/Arch/MSP430.cpp | 2 | ||||
| -rw-r--r-- | lld/ELF/Arch/PPC.cpp | 2 | ||||
| -rw-r--r-- | lld/ELF/Arch/PPC64.cpp | 2 |
7 files changed, 7 insertions, 7 deletions
diff --git a/lld/ELF/Arch/AArch64.cpp b/lld/ELF/Arch/AArch64.cpp index 694da898aaf..02630c337d9 100644 --- a/lld/ELF/Arch/AArch64.cpp +++ b/lld/ELF/Arch/AArch64.cpp @@ -350,7 +350,7 @@ void AArch64::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const { or32AArch64Imm(Loc, Val); break; default: - error(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type)); + error(getErrorLocation(Loc) + "unrecognized relocation " + toString(Type)); } } diff --git a/lld/ELF/Arch/ARM.cpp b/lld/ELF/Arch/ARM.cpp index 321b327e530..fe3dc8002bc 100644 --- a/lld/ELF/Arch/ARM.cpp +++ b/lld/ELF/Arch/ARM.cpp @@ -518,7 +518,7 @@ void ARM::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const { (Val & 0x00ff)); // imm8 break; default: - error(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type)); + error(getErrorLocation(Loc) + "unrecognized relocation " + toString(Type)); } } diff --git a/lld/ELF/Arch/AVR.cpp b/lld/ELF/Arch/AVR.cpp index 9ccbd64d34b..5a573238d6d 100644 --- a/lld/ELF/Arch/AVR.cpp +++ b/lld/ELF/Arch/AVR.cpp @@ -66,7 +66,7 @@ void AVR::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const { break; } default: - error(getErrorLocation(Loc) + "unrecognized reloc " + toString(Type)); + error(getErrorLocation(Loc) + "unrecognized relocation " + toString(Type)); } } diff --git a/lld/ELF/Arch/Hexagon.cpp b/lld/ELF/Arch/Hexagon.cpp index 580600ade00..0ac48c8e01c 100644 --- a/lld/ELF/Arch/Hexagon.cpp +++ b/lld/ELF/Arch/Hexagon.cpp @@ -246,7 +246,7 @@ void Hexagon::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const { or32le(Loc, applyMask(0x00c03fff, Val)); break; default: - error(getErrorLocation(Loc) + "unrecognized reloc " + toString(Type)); + error(getErrorLocation(Loc) + "unrecognized relocation " + toString(Type)); break; } } diff --git a/lld/ELF/Arch/MSP430.cpp b/lld/ELF/Arch/MSP430.cpp index e104c8c7f2a..0f0b5662ec8 100644 --- a/lld/ELF/Arch/MSP430.cpp +++ b/lld/ELF/Arch/MSP430.cpp @@ -83,7 +83,7 @@ void MSP430::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const { break; } default: - error(getErrorLocation(Loc) + "unrecognized reloc " + toString(Type)); + error(getErrorLocation(Loc) + "unrecognized relocation " + toString(Type)); } } diff --git a/lld/ELF/Arch/PPC.cpp b/lld/ELF/Arch/PPC.cpp index 67bc264b832..02797df314b 100644 --- a/lld/ELF/Arch/PPC.cpp +++ b/lld/ELF/Arch/PPC.cpp @@ -69,7 +69,7 @@ void PPC::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const { write32be(Loc, read32be(Loc) | (Val & 0x3FFFFFC)); break; default: - error(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type)); + error(getErrorLocation(Loc) + "unrecognized relocation " + toString(Type)); } } diff --git a/lld/ELF/Arch/PPC64.cpp b/lld/ELF/Arch/PPC64.cpp index bc199fff45a..8a1b4f887b8 100644 --- a/lld/ELF/Arch/PPC64.cpp +++ b/lld/ELF/Arch/PPC64.cpp @@ -860,7 +860,7 @@ void PPC64::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const { write64(Loc, Val - DynamicThreadPointerOffset); break; default: - error(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type)); + error(getErrorLocation(Loc) + "unrecognized relocation " + toString(Type)); } } |

