[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH v6 6/6] tests/tcg/aarch64: Add bti smoke test
From: |
Richard Henderson |
Subject: |
Re: [Qemu-arm] [PATCH v6 6/6] tests/tcg/aarch64: Add bti smoke test |
Date: |
Thu, 6 Jun 2019 09:24:07 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 |
On 6/6/19 5:21 AM, Dave Martin wrote:
>> +/*
>> + * Create the PT_NOTE that will enable BTI in the page tables.
>> + * This will be created by the compiler with -mbranch-protection=standard,
>> + * but as of 2019-03-29, this is has not been committed to gcc mainline.
>> + * This will probably be in GCC10.
>
> FYI, GCC9 has it.
Thanks.
>> + */
>> +asm(".section .note.gnu.property,\"a\"\n\
>> + .align 3\n\
>> + .long 4\n\
>> + .long 16\n\
>> + .long 5\n\
>> + .string \"GNU\"\n\
>> + .long 0xc0000000\n\
>> + .long 4\n\
>> + .long 1\n\
>> + .align 3\n\
>> + .previous");
>
> Note, this won't be enough to generate the PT_GNU_PROPERTY entry in the
> program header table using older tools.
>
> This may be work-round-able with a linker script, but I haven't looked
> into it.
Yes, a linker script can create such an entry.
>> +AARCH64_TESTS += bti-1
>> +bti-1: LDFLAGS += -nostartfiles -nodefaultlibs -nostdlib
>> +
>
> Doesn't -nostdlib imply -nodefaultlibs and -nostartfiles?
I don't believe so, but I'll double-check.
r~
- Re: [Qemu-arm] [Qemu-devel] [PATCH v6 2/6] linux-user: Validate mmap/mprotect prot value, (continued)
- [Qemu-arm] [PATCH v6 3/6] linux-user: Set PAGE_TARGET_1 for TARGET_PROT_BTI, Richard Henderson, 2019/06/05
- [Qemu-arm] [PATCH v6 4/6] include/elf: Add defines related to notes for GNU systems, Richard Henderson, 2019/06/05
- [Qemu-arm] [PATCH v6 5/6] linux-user: Parse NT_GNU_PROPERTY_TYPE_0 notes, Richard Henderson, 2019/06/05
- [Qemu-arm] [PATCH v6 6/6] tests/tcg/aarch64: Add bti smoke test, Richard Henderson, 2019/06/05
- Re: [Qemu-arm] [Qemu-devel] [PATCH v6 0/6] linux-user/aarch64: Support PROT_BTI, no-reply, 2019/06/05