[PATCH] D38053: [AArch64] Implement R_AARCH64_ LD_PREL_LO19

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 19 14:30:42 PDT 2017


Davide Italiano via Phabricator <reviews at reviews.llvm.org> writes:

> +# RUN: llvm-mc -filetype=obj -triple=aarch64-linux-none %s -o %t.o
> +# RUN: llvm-readobj -elf-output-style=GNU %t.o -r | FileCheck %s --check-prefix=RELS

In lld we normally just assume that llvm-mc works. If there is no test
for this in llvm already we should add it there.

> Index: ELF/InputSection.cpp
> ===================================================================
> --- ELF/InputSection.cpp
> +++ ELF/InputSection.cpp
> @@ -471,6 +471,7 @@
>    case R_AARCH64_PREL32:
>    case R_AARCH64_PREL64:
>    case R_AARCH64_ADR_PREL_LO21:
> +  case R_AARCH64_LD_PREL_LO19:
>      return P + A;

We are missing a test for this, no? There is not weak undef in the test.

> +  case R_AARCH64_LD_PREL_LO19:
> +    checkInt<21>(Loc, Val, Type);
> +    or32le(Loc, (Val & 0x1FFFFC) << 3);
> +    break;


This is exactly the same as R_AARCH64_CONDBR19, no? Can you use a
fallthrough?

Cheers,
Rafael


More information about the llvm-commits mailing list