]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: emit .variant_pcs for aarch64_vector_pcs symbol references
authornsz <nsz@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 Jun 2019 13:50:53 +0000 (13:50 +0000)
committernsz <nsz@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 Jun 2019 13:50:53 +0000 (13:50 +0000)
commit779640c76d37b32f4d8a7b97637ed9e345d750b4
treed2e8c1b20e35eb49d15f47cbea6df83c80483f66
parent2b018df4206e84be022d157444d63be4daf26f76
aarch64: emit .variant_pcs for aarch64_vector_pcs symbol references

A dynamic linker with lazy binding support may need to handle vector PCS
function symbols specially, so an ELF symbol table marking was
introduced for such symbols.

Function symbol references and definitions that follow the vector PCS
are marked in the generated assembly with .variant_pcs and then the
STO_AARCH64_VARIANT_PCS st_other flag is set on the symbol in the object
file.  The marking is propagated to the dynamic symbol table by the
static linker so a dynamic linker can handle such symbols specially.

For this to work, the assembler, the static linker and the dynamic
linker has to be updated on a system.  Old assembler does not support
the new .variant_pcs directive, so a toolchain with old binutils won't
be able to compile code that references vector PCS symbols.

gcc/ChangeLog:

* config/aarch64/aarch64-protos.h (aarch64_asm_output_alias): Declare.
(aarch64_asm_output_external): Declare.
* config/aarch64/aarch64.c (aarch64_asm_output_variant_pcs): New.
(aarch64_declare_function_name): Call aarch64_asm_output_variant_pcs.
(aarch64_asm_output_alias): New.
(aarch64_asm_output_external): New.
* config/aarch64/aarch64.h (ASM_OUTPUT_DEF_FROM_DECLS): Define.
(ASM_OUTPUT_EXTERNAL): Define.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/pcs_attribute-2.c: New test.
* gcc.target/aarch64/torture/simd-abi-4.c: Check .variant_pcs support.
* lib/target-supports.exp (check_effective_target_aarch64_variant_pcs):
New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271869 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/aarch64/aarch64-protos.h
gcc/config/aarch64/aarch64.c
gcc/config/aarch64/aarch64.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/pcs_attribute-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/torture/simd-abi-4.c
gcc/testsuite/lib/target-supports.exp