[ELF][Hexagon] Improve error message for unknown relocations
authorFangrui Song <maskray@google.com>
Mon, 19 Aug 2019 14:07:14 +0000 (14:07 +0000)
committerFangrui Song <maskray@google.com>
Mon, 19 Aug 2019 14:07:14 +0000 (14:07 +0000)
commitc8a1dfc484c94238c01567247c0cf83584f8719c
treec4b1893b3d0afb548b7b30f2a8b187dc99b832ee
parentb6ab533b93420e828ea6f555bc7d34d91cb07a34
[ELF][Hexagon] Improve error message for unknown relocations

Like rLLD354040

Previously, for unknown 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 Hexagon::getRelExpr and add the error there. We will get consistent error message like `error: unknown relocation (1024) against symbol foo`

Reviewed By: sidneym

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

llvm-svn: 369260
lld/ELF/Arch/Hexagon.cpp