[ELF][AArch64] Improve error message for unknown relocations
authorFangrui Song <maskray@google.com>
Thu, 15 Aug 2019 10:02:54 +0000 (10:02 +0000)
committerFangrui Song <maskray@google.com>
Thu, 15 Aug 2019 10:02:54 +0000 (10:02 +0000)
commite54ed4789f3514fc6b457ebcf9207dbcff767d20
tree542408a4dc50dd1cc631ac079ad91d322f2197c4
parente5cdfbc65cac49fedba6cb3def55d62d851796ab
[ELF][AArch64] Improve error message for unknown relocations

Like rLLD354040.

Previously, for unrecognized relocation types, in -no-pie/-pie mode, we got something like:

  foo.o: unrecognized relocation ...

In -shared mode:

  error: can't create dynamic relocation ... against symbol: yyy in readonly segment

Delete the default case from AArch64::getRelExpr and add the error there.

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D66277

llvm-svn: 368983
lld/ELF/Arch/AArch64.cpp
lld/test/ELF/invalid/invalid-relocation-aarch64.test [new file with mode: 0644]