This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH, BFD, LD, AArch64, 0/4] Add support for AArch64 BTI and PAC in the linker
Hi Sudi,
>>> 3)--bti-nowarn - Same as above but does not emit any warnings.
>>
>> I am not clear about the purpose/need for this option. According to this:
>>
>>> 2) For BTI, the linker must also check for the
>>> GNU_PROPERTY_AARCH64_FEATURE_1_BTI in its input. If all inputs have
>>> GNU_PROPERTY_AARCH64_FEATURE_1_BTI, the final output will also be marked
>>> as such. The PLT should also be protected with a BTI PLT in this case.
>>> Thus even if there is no linker option to use BTI PLT, the linker
>>> should be able to use them depending on the NOTE section. The user can
>>> use the linker option --bti, to make sure that their intention of having
>>> all input objects (and hence the output) marked with BTI is not
>>> disrupted by any stray objects as this option will warn about it.
>>
>> The linker will automatically set the BTI tag if all of the inputs have
>> the BTI note, and, by default, will not warn if one or more of the inputs
>> do not have the note. So what does the --bti-nowarn option do ?
>
> The linker should automatically collect all note sections and mark the
> output with BTI if ALL the inputs have BTI in them. However, in this
> default behavior, if there is any stray objects without the BTI note
> section, the linker will silently remove the BTI note section from the
> output. Both the linker command line options are for users to specify
> that they want the output to be marked with BTI. The difference is that
> --bti will warn about the stray object and --bti-nowarn will not warn.
OK, so just to be clear, with --bti or --bti-nowarn the output will be
given the BTI tag *even if* some of the input files do not have the BTI note ?
This sounds like a serious potential problem. If BTI is enabled and a
particular object file has not been built with BTI support enabled, then
won't any function calls into that object file fail ?
>> OK, that's it for general comments. I will reserve patch specific comments
>> for each individual patch.
[These will probably be tomorrow now as I am a little bit swamped with other things today]
Cheers
Nick
- References:
- [PATCH, BFD, LD, AArch64, 0/4] Add support for AArch64 BTI and PAC in the linker
- Re: [PATCH, BFD, LD, AArch64, 0/4] Add support for AArch64 BTI and PAC in the linker
- Re: [PATCH, BFD, LD, AArch64, 0/4] Add support for AArch64 BTI and PAC in the linker