Re: [PATCH v8 01/28] linkage: new macros for assembler symbols
From: Jiri Slaby
Date: Thu Aug 29 2019 - 06:48:32 EST
On 12. 08. 19, 19:06, Borislav Petkov wrote:
>> + Again, every ``SYM_CODE_START*`` **shall** be coupled by ``SYM_CODE_END``.
>
> Btw, this coupling: I haven't gone through the whole patchset but do we
> have automatic checking which makes sure a starting macro is coupled
> with the correct ending macro?
I do, but it's not part of this series. It's a pinch of link-time magic,
but it works reliably (see e.g. 1cbec37b3f9c). I will post it if/after
this gets merged. There were other approaches proposed in the past too
-- using objtool for that (not implemented).
>> +Overriding Macros
>> +~~~~~~~~~~~~~~~~~
>> +Architecture can also override any of the macros in their own
>
> "Other architectures... "
Not only "other", x86 can override the types if need be too.
>> +``asm/linkage.h``, including macros specifying the type of a symbol
>> +(``SYM_T_FUNC``, ``SYM_T_OBJECT``, and ``SYM_T_NONE``). As every macro
>> +described in this file is surrounded by ``#ifdef`` + ``#endif``, it is enough
>> +to define the macros differently in the aforementioned architecture-dependent
>> +header.
thanks,
--
js
suse labs