qemu-arm
[Top][All Lists]
Advanced

[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~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]