Improve error message for unknown relocations.

Previously, we showed the following message for an unknown relocation:

  foo.o: unrecognized reloc 256

This patch improves it so that the error message includes a symbol name:

  foo.o: unknown relocation (256) against symbol bar

llvm-svn: 354040
This commit is contained in:
Rui Ueyama
2019-02-14 18:02:20 +00:00
parent aa0b77d339
commit b8b81e9b43
9 changed files with 23 additions and 16 deletions

View File

@@ -600,8 +600,6 @@ static int64_t getTlsTpOffset() {
static uint64_t getRelocTargetVA(const InputFile *File, RelType Type, int64_t A,
uint64_t P, const Symbol &Sym, RelExpr Expr) {
switch (Expr) {
case R_INVALID:
return 0;
case R_ABS:
case R_RELAX_TLS_LD_TO_LE_ABS:
case R_RELAX_GOT_PC_NOPIC: