[PATCH] Avoid .symver on common symbols [BZ #21666]

H.J. Lu hjl.tools@gmail.com
Fri Jun 23 16:27:00 GMT 2017


On Fri, Jun 23, 2017 at 9:17 AM, Florian Weimer <fweimer@redhat.com> wrote:
> On 06/23/2017 06:11 PM, H.J. Lu wrote:
>> +/* Define the variables used for the interface.  Avoid .symver on common
>> +   symbol, which just creates a new common symbol, not an alias.  */
>> +char *loc1 = NULL;
>> +char *loc2 = NULL;
>
> I think __attribute__ ((nocommon)) without the initializer would be more
> explicit.  We already use that for _res in resolv/res_libc.c.

Done.

> Does this result in a visible difference for applications?  If yes,
> please file a bug for this and reference it in the ChangeLog and commit
> message.

It will be very hard to tell since these symbols were exported from libc.so
by accident and we only keep them in libc.so for backward binary compatibility.
Application can no longer reference them from libc.so.

> Why didn't our test suite catch it?

We never tried to catch errors like this.

Here is the updated patch.  OK for master?

Thanks.

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Avoid-.symver-on-common-symbols-BZ-21666.patch
Type: text/x-patch
Size: 2231 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20170623/4b8c39f6/attachment.bin>


More information about the Libc-alpha mailing list