aarch64: Add assembly support for -fsanitize=hwaddress tagged globals.master
commite5afa1b556542fd7a52a0a9b409c80f2e6e1e9bb
authorPeter Collingbourne <pcc@google.com>
Wed, 21 Aug 2019 18:55:25 +0000 (21 11:55 -0700)
committerMartin Storsjö <martin@martin.st>
Wed, 21 Aug 2019 19:31:27 +0000 (21 22:31 +0300)
tree5f94dec0646e4461fc88a648aa44030cef8c0404
parentc4642788e83b0858bca449f9b6e71ddb015dfa5d
aarch64: Add assembly support for -fsanitize=hwaddress tagged globals.

As of LLVM r368102, Clang will set a pointer tag in bits 56-63 of the
address of a global when compiling with -fsanitize=hwaddress. This requires
an adjustment to assembly code that takes the address of such globals: the
code cannot use the regular R_AARCH64_ADR_PREL_PG_HI21 relocation to refer
to the global, since the tag would take the address out of range. Instead,
the code must use the non-checking (_NC) variant of the relocation (the
link-time check is substituted by a runtime check).

This change makes the necessary adjustment in the movrel macro, where it is
needed when compiling with -fsanitize=hwaddress.

Signed-off-by: Peter Collingbourne <pcc@google.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
libavutil/aarch64/asm.S