[PATCH] D26508: [ELF] - Better diagnostic for relative relocation to an absolute value error.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 10 08:40:07 PST 2016


grimar created this revision.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar, evgeny777, davide.
Herald added a subscriber: emaste.

Patch adds a filename to that error message.

I am facing this now when debugging one of FreeBSD port:
error: relocation R_X86_64_PLT32 cannot refer to absolute symbol __tls_get_addr

Body->File field is empty for next place:

  if (AbsVal && RelE) {
    if (Body.isUndefined() && !Body.isLocal() && Body.symbol()->isWeak())
      return true;
    error("relocation " + getRelName(Type) +
          " cannot refer to absolute symbol " + Body.getName());
    return true;
  }

It took some time to find the file and since global direction is to make linker more user friendly,
I suggest to add filename for that message.


https://reviews.llvm.org/D26508

Files:
  ELF/InputFiles.cpp
  ELF/LinkerScript.cpp
  ELF/Relocations.cpp
  ELF/SymbolTable.cpp
  ELF/SymbolTable.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26508.77495.patch
Type: text/x-patch
Size: 5208 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161110/07d95d37/attachment.bin>


More information about the llvm-commits mailing list