This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, BFD, LD, AArch64, 0/4] Add support for AArch64 BTI and PAC in the linker


Hi Nick

On 07/03/2019 15:33, Nick Clifton wrote:
> 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 ?
> 

Yes
> 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 ?
> 

The linker is capable of doing the right thing on its own without any 
user option. It will silently remove the BTI note on the output if there 
are objects with missing BTI note section. The user options are an 
indication of what they want, *to turn on BTI*. They can use --bti, 
where the linker will complain about the missing BTI marking and they 
can go back and check the objects that need recompiling or use 
--bti-nowarn when they are sure that even if there is any object with 
missing BTI note section it is still safe to turn on BTI (or they still 
want to turn on BTI). We think that these options would be most helpful 
in early deployment.

Sudi

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]