From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id DEB2A1F8C6 for ; Sat, 31 Jul 2021 06:41:49 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A5223384640D for ; Sat, 31 Jul 2021 06:41:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A5223384640D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627713708; bh=lPjHDep//XmkDaDyb6BfteKRMXokcASt3gUnRZejlsU=; h=To:Subject:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=GMhTPecZLpO2sEnPoLNtRhkPZR4j93iJ6bipg0B2rwm8z4cfz/t/d1Vx7XvNYKzc0 d4ApGYRFdYahsljGwjk4SHT7iNoKBRUHdNUt9IbEY8Vgofe9fnmfUpbOy+iq1zz+HF fQrDKnSddvLM8n+knAUE7BckcjcVXj93KRhO0Hxs= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 618943857C65 for ; Sat, 31 Jul 2021 06:41:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 618943857C65 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-578-t7kUzFGCNbiH6JxjMsyx7Q-1; Sat, 31 Jul 2021 02:41:24 -0400 X-MC-Unique: t7kUzFGCNbiH6JxjMsyx7Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DABB2939; Sat, 31 Jul 2021 06:41:23 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.123]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 07AA299BD; Sat, 31 Jul 2021 06:41:22 +0000 (UTC) To: =?utf-8?B?RsSBbmctcnXDrCBTw7JuZw==?= Subject: Re: [PATCH 0/3] Allow LLD 13.0.0 and improve compatibility with gold and clang References: <20210726035802.275992-1-maskray@google.com> <87o8akz12h.fsf@oldenburg.str.redhat.com> Date: Sat, 31 Jul 2021 08:41:21 +0200 In-Reply-To: (=?utf-8?B?IkbEgW5nLXJ1w6wgU8OybmciJ3M=?= message of "Fri, 30 Jul 2021 23:34:09 -0700") Message-ID: <87a6m3vvce.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Florian Weimer via Libc-alpha Reply-To: Florian Weimer Cc: Fangrui Song via Libc-alpha Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" * F=C4=81ng-ru=C3=AC S=C3=B2ng: > On Fri, Jul 30, 2021 at 12:57 AM Florian Weimer wrot= e: >> >> * Fangrui Song via Libc-alpha: >> >> > For malloc/tst-compathooks-on, >> > >> > malloc/tst-compathooks-on: Symbol `__free_hook' has different size= in shared object, consider re-linking >> > >> > the root cause is that lld's symbol versioning is different from GNU l= d in an unusal case: >> > >> > __asm__ (".symver " "__free_hook" "," "__free_hook" "@" "GLIBC_2.2= .5"); >> > >> > This leaves two symbols __free_hook and __free_hook@GLIBC_2.2.5. >> > __free_hook is then attached a default version GLIBC_2.2.5. >> > I think malloc/malloc-debug.c uses a fragile versioned symbol here. >> > If the inline asm uses @@ the failure should go away. >> >> But we want to produce a compat symbol here. With the current version >> scripts, BFD ld will not export a symbol unless it is listed in the >> version script. That is, if I remove __free_hook from libc_malloc_debug >> in malloc/Versions, I get an ABI check failure: >> >> --- ../sysdeps/unix/sysv/linux/x86_64/64/libc_malloc_debug.abilist = 2021-07-27 16:14:51.516781791 +0200 >> +++ =E2=80=A6/malloc/libc_malloc_debug.symlist 2021-07-30 09:55:09.8188= 75449 +0200 >> @@ -3 +2,0 @@ GLIBC_2.16 aligned_alloc F >> -GLIBC_2.2.5 __free_hook D 0x8 >> >> If this works with a linker, it appears to ignore =E2=80=9Clocal: *;=E2= =80=9D in version >> nodes for versioned symbols. That looks like a linker bug. >> >> Thanks, >> Florian >> > > I have a comment on https://sourceware.org/bugzilla/show_bug.cgi?id=3D233= 28#c6 > > How does removing __free_hook from malloc/Versions break the ABI check te= st? > > % cat a.s > .symver __free_hook, __free_hook@GLIBC_2.2.5 > .globl __free_hook > __free_hook: > nop > % cat a.ver > GLIBC_2.2.5 {}; /* should not list the non-default version __free_hook *= / > local { local: *; }; We currently generate this: GLIBC_2.2.5 { global: __malloc_hook; __memalign_hook; __realloc_hook; calloc; free; mallinfo; malloc; malloc_get_state; malloc_set_state; malloc_stats; malloc_trim; malloc_usable_size; mallopt; mcheck; mcheck_check_all; mcheck_pedantic; memalign; mprobe; mtrace; muntrace; posix_memalign; pvalloc; realloc; valloc; local: *; }; See libc_malloc_debug.map in the build tree. Thanks, Florian