[AArch64] Enable return address signing for static ctors
authorOliver Stannard <oliver.stannard@arm.com>
Thu, 13 Sep 2018 10:25:36 +0000 (10:25 +0000)
committerOliver Stannard <oliver.stannard@arm.com>
Thu, 13 Sep 2018 10:25:36 +0000 (10:25 +0000)
commit95ac65bc32180744cbc67d4e82a0f6417fb92aa9
tree4dffe209d85ee0036788065a695142bc0a013c7c
parent4588fc80bf0a20b0d7d3d75cb4f18871529d3ba5
[AArch64] Enable return address signing for static ctors

Functions generated by clang and included in the .init_array section (such as
static constructors) do not follow the usual code path for adding
target-specific function attributes, so we have to add the return address
signing attribute here too, as is currently done for the sanitisers.

Differential revision: https://reviews.llvm.org/D51418

llvm-svn: 342126
clang/lib/CodeGen/CGDeclCXX.cpp
clang/test/CodeGenCXX/aarch64-sign-return-address-static-ctor.cpp [new file with mode: 0644]