[PATCH v1 3/4] aarch64 DWARF: add new CFI directive for PAuth_LR
Matthieu Longo
matthieu.longo@arm.com
Tue Dec 10 17:27:59 GMT 2024
On 2024-11-26 07:20, Jan Beulich wrote:
> On 25.11.2024 18:37, Matthieu Longo wrote:
>> On 2024-11-25 16:42, Jan Beulich wrote:
>>> On 25.11.2024 17:28, Matthieu Longo wrote:
>>>> --- a/gas/dw2gencfi.c
>>>> +++ b/gas/dw2gencfi.c
>>>> @@ -718,6 +718,7 @@ const pseudo_typeS cfi_pseudo_table[] =
>>>> { "cfi_restore_state", dot_cfi, DW_CFA_restore_state },
>>>> { "cfi_window_save", dot_cfi, DW_CFA_GNU_window_save },
>>>> { "cfi_negate_ra_state", dot_cfi, DW_CFA_AARCH64_negate_ra_state },
>>>> + { "cfi_negate_ra_state_with_pc", dot_cfi, DW_CFA_AARCH64_negate_ra_state_with_pc },
>>>> { "cfi_escape", dot_cfi_escape, 0 },
>>>> { "cfi_signal_frame", dot_cfi, CFI_signal_frame },
>>>> { "cfi_personality", dot_cfi_personality, 0 },
>>>> @@ -918,6 +919,10 @@ dot_cfi (int arg)
>>>> cfi_add_CFA_insn (DW_CFA_GNU_window_save);
>>>> break;
>>>>
>>>> + case DW_CFA_AARCH64_negate_ra_state_with_pc:
>>>> + cfi_add_CFA_insn (DW_CFA_AARCH64_negate_ra_state_with_pc);
>>>> + break;
>>>
>>> Oh, and: Shouldn't we learn from the confusion about the two other,
>>> aliasing directives? IOW - what if this new directive is used on other
>>> than Aarch64? Imo that would better be refused, to avoid ending up with
>>> a similar problem again.
>>
>> I agree with you, that would be the best approach.
>> That's what I did recently in GCC by moving architecture extension to
>> the backend:
>> https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=9e1c71bab50d51a1a8ec1a75080ffde6ca3d854c
>> Unfortunately, from my understanding, this requires a major refactoring
>> of the current implementation.
>
> Well, wouldn't a simple "#ifdef TC_AARCH64" do?
>
> Jan
Please note that I didn't ignore in the next revision [1] the issue that
you raised.
I planned to address it in another patch series where I will address
this larger issue of enabling/disabling architecture-specific code in
bfd, binutils, etc... via a definition like TC_AARCH64.
The patch series is ready today, but it is pending on internal reviews.
I should publish it in the coming days hopefully.
If you agree, I would like to move on with the patch 3/4 without the
#ifdef as the situation is not worse than before.
Matthieu
[1]:
https://inbox.sourceware.org/binutils/20241210151211.1387578-1-matthieu.longo@arm.com/
More information about the Binutils
mailing list