mirror of git://sourceware.org/git/glibc.git
aarch64: Fix tests not compatible with targets supporting GCS
- Add GCS marking to some of the tests when target supports GCS - Fix tst-ro-dynamic-mod.map linker script to avoid removing GNU properties - Add header with macros for GNU properties Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
This commit is contained in:
parent
a335acb8b8
commit
d3f2b71ef1
|
|
@ -0,0 +1,49 @@
|
||||||
|
/* Test header that defines macros for GNU properties that need to be
|
||||||
|
used in some test assembly files where sysdep.h cannot be included
|
||||||
|
for some reason.
|
||||||
|
Copyright (C) 2024-2025 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2.1 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
The GNU C Library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with the GNU C Library; if not, see
|
||||||
|
<https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
/* GNU_PROPERTY_AARCH64_* macros from elf.h for use in asm code. */
|
||||||
|
#define FEATURE_1_AND 0xc0000000
|
||||||
|
#define FEATURE_1_BTI 1
|
||||||
|
#define FEATURE_1_PAC 2
|
||||||
|
#define FEATURE_1_GCS 4
|
||||||
|
|
||||||
|
/* Add a NT_GNU_PROPERTY_TYPE_0 note. */
|
||||||
|
#define GNU_PROPERTY(type, value) \
|
||||||
|
.section .note.gnu.property, "a"; \
|
||||||
|
.p2align 3; \
|
||||||
|
.word 4; \
|
||||||
|
.word 16; \
|
||||||
|
.word 5; \
|
||||||
|
.asciz "GNU"; \
|
||||||
|
.word type; \
|
||||||
|
.word 4; \
|
||||||
|
.word value; \
|
||||||
|
.word 0; \
|
||||||
|
.text
|
||||||
|
|
||||||
|
/* Add GNU property note with the supported features to all asm code
|
||||||
|
where sysdep.h is included. */
|
||||||
|
#if HAVE_AARCH64_BTI && HAVE_AARCH64_PAC_RET
|
||||||
|
GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_PAC|FEATURE_1_GCS)
|
||||||
|
#elif HAVE_AARCH64_BTI
|
||||||
|
GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_GCS)
|
||||||
|
#endif
|
||||||
|
|
@ -20,6 +20,8 @@
|
||||||
On a typical Linux system with 8MiB "ulimit -s", that was enough
|
On a typical Linux system with 8MiB "ulimit -s", that was enough
|
||||||
to trigger stack overflow in open_verify. */
|
to trigger stack overflow in open_verify. */
|
||||||
|
|
||||||
|
#include "tst-asm-helper.h"
|
||||||
|
|
||||||
#define NOTE_SIZE 8*1024*1024
|
#define NOTE_SIZE 8*1024*1024
|
||||||
|
|
||||||
.pushsection .note.big,"a"
|
.pushsection .note.big,"a"
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,13 @@ SECTIONS
|
||||||
. = SIZEOF_HEADERS;
|
. = SIZEOF_HEADERS;
|
||||||
.dynamic : { *(.dynamic) } :text :dynamic
|
.dynamic : { *(.dynamic) } :text :dynamic
|
||||||
.rodata : { *(.data*) *(.bss*) } :text
|
.rodata : { *(.data*) *(.bss*) } :text
|
||||||
/DISCARD/ : {
|
.note : { *(.note) } :text :note
|
||||||
*(.note.gnu.property)
|
.note.gnu.property : { *(.note.gnu.property) } :text :gnu_property
|
||||||
}
|
|
||||||
.note : { *(.note.*) } :text :note
|
|
||||||
}
|
}
|
||||||
PHDRS
|
PHDRS
|
||||||
{
|
{
|
||||||
text PT_LOAD FLAGS(5) FILEHDR PHDRS;
|
text PT_LOAD FLAGS(5) FILEHDR PHDRS;
|
||||||
dynamic PT_DYNAMIC FLAGS(4);
|
dynamic PT_DYNAMIC FLAGS(4);
|
||||||
note PT_NOTE FLAGS(4);
|
note PT_NOTE FLAGS(4);
|
||||||
|
gnu_property PT_GNU_PROPERTY FLAGS(4);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@
|
||||||
License along with the GNU C Library. If not, see
|
License along with the GNU C Library. If not, see
|
||||||
<https://www.gnu.org/licenses/>. */
|
<https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#include "tst-asm-helper.h"
|
||||||
|
|
||||||
.variant_pcs vpcs_call
|
.variant_pcs vpcs_call
|
||||||
.global vpcs_call
|
.global vpcs_call
|
||||||
.type vpcs_call, %function
|
.type vpcs_call, %function
|
||||||
|
|
@ -121,7 +123,7 @@ vpcs_call_regs:
|
||||||
/* Emulate a BL using B, but save x30 before the branch. */
|
/* Emulate a BL using B, but save x30 before the branch. */
|
||||||
adr x30, .L_return_addr
|
adr x30, .L_return_addr
|
||||||
stp x30, x29, [x1, 240]
|
stp x30, x29, [x1, 240]
|
||||||
b vpcs_call
|
bl vpcs_call
|
||||||
.L_return_addr:
|
.L_return_addr:
|
||||||
|
|
||||||
/* Restore callee-saved registers. */
|
/* Restore callee-saved registers. */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue