[PATCH v7 2/8] Remove __morecore and __default_morecore

Siddhesh Poyarekar siddhesh@sourceware.org
Fri Jul 9 07:02:14 GMT 2021


On 7/9/21 11:57 AM, Florian Weimer via Libc-alpha wrote:
> * Siddhesh Poyarekar:
> 
>> diff --git a/malloc/hooks.c b/malloc/hooks.c
>> index 45c91d6502..4aa6dadcff 100644
>> --- a/malloc/hooks.c
>> +++ b/malloc/hooks.c
>> @@ -20,6 +20,8 @@
>>   #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_34)
>>   void weak_variable (*__after_morecore_hook) (void) = NULL;
>>   compat_symbol (libc, __after_morecore_hook, __after_morecore_hook, GLIBC_2_0);
>> +void *(*__morecore)(ptrdiff_t);
>> +compat_symbol (libc, __morecore, __morecore, GLIBC_2_0);
>>   #endif
> 
> This fails to assemble on ARC (and elsewhere with GCC 9 and earlier):
> 
> /tmp/ccEXL6bz.s: Assembler messages:
> /tmp/ccEXL6bz.s: Error: `__morecore@GLIBC_2.32' can't be versioned to common sym
> bol '__morecore'
> 
> You need to add __attribute__ ((morecore)).

I could do this (I know you mean nocommon there)...

> I posted a generic fix for this:
> 
>    Force building with -fno-common
>    <https://sourceware.org/pipermail/libc-alpha/2021-July/128716.html>
> 
> But until then, every instance needs to be fixed manually.

... or I could review your generic fix instead.  It seems like a much 
better cleanup than having to specify the attribute on everything that 
changes.  What do you think?

Siddhesh


More information about the Libc-alpha mailing list