[LLD][ELF] - Improve diagnostic about unrecognized relocations.
authorGeorge Rimar <grimar@accesssoftek.com>
Thu, 23 May 2019 09:50:18 +0000 (09:50 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Thu, 23 May 2019 09:50:18 +0000 (09:50 +0000)
commit77b4f0abb82c419fedca2ae3a20e1201f752b894
tree090ef3949ff2163f373ed5176ef9f9e97d334cd0
parent691502f61e9e6e7de657b21f7c311d1cece3f99b
[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
lld/ELF/Arch/AArch64.cpp
lld/ELF/Arch/ARM.cpp
lld/ELF/Arch/AVR.cpp
lld/ELF/Arch/Hexagon.cpp
lld/ELF/Arch/MSP430.cpp
lld/ELF/Arch/PPC.cpp
lld/ELF/Arch/PPC64.cpp