[PATCH] setjmp: Replace jmp_buf-macros.h with jmp_buf-macros.sym

Adhemerval Zanella adhemerval.zanella@linaro.org
Fri Nov 19 18:41:36 GMT 2021



On 19/11/2021 15:38, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>> On 19/11/2021 15:33, Florian Weimer wrote:
>>> * Adhemerval Zanella:
>>>
>>>> On 19/11/2021 15:28, Florian Weimer wrote:
>>>>> * Adhemerval Zanella via Libc-alpha:
>>>>>
>>>>>> diff --git a/setjmp/__setjmp_check.c b/setjmp/__setjmp_check.c
>>>>>> new file mode 100644
>>>>>> index 0000000000..4be6e432b3
>>>>>> --- /dev/null
>>>>>> +++ b/setjmp/__setjmp_check.c
>>>>>> @@ -0,0 +1,34 @@
>>>>>> +/* Check jmp_buf sizes, alignments and offsets.  */
>>>>>
>>>>> Shouldn't this be an internal test?
>>>>>
>>>>> I checked the generated constants against the removed files, and found
>>>>> no discrepancies, so I think this can go in.
>>>>
>>>> My understanding is the _Static_assert would be more useful at build time,
>>>> specially for cross-compilation.
>>>
>>> An internal will still have the same effect when cross-compiled.
>>
>> I don't have a strong preference in fact, I think an object consumes slight
>> less resources through (cpu time to build, disk size).
> 
> It consumes space in the installed artifacts, though.
> 
> $ ar t libc.a | grep setjmp
> setjmp.o
> bsd-setjmp.o
> bsd-_setjmp.o
> __setjmp_check.o
> $ readelf -sW libc.so.6 | grep setjmp
>    304: 0000000000041010    10 FUNC    GLOBAL DEFAULT   14 setjmp@@GLIBC_2.2.5
>    546: 0000000000041020     7 FUNC    GLOBAL DEFAULT   14 _setjmp@@GLIBC_2.2.5
>   1012: 0000000000040f80    87 FUNC    GLOBAL DEFAULT   14 __sigsetjmp@@GLIBC_2.2.5
>    286: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS __setjmp_check.c
>   4893: 0000000000040f80    87 FUNC    LOCAL  DEFAULT   14 __GI___sigsetjmp
>   5090: 0000000000041020     7 FUNC    LOCAL  DEFAULT   14 __GI__setjmp
>   7075: 0000000000040f80    87 FUNC    GLOBAL DEFAULT   14 __sigsetjmp
>   9251: 0000000000041020     7 FUNC    GLOBAL DEFAULT   14 _setjmp
>   9705: 0000000000041010    10 FUNC    GLOBAL DEFAULT   14 setjmp

Hum I forgot to verify this, I will change to an internal test.


More information about the Libc-alpha mailing list