From patchwork Fri Dec 11 22:22:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 41369 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C76B0397303D; Fri, 11 Dec 2020 22:23:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C76B0397303D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1607725409; bh=M7gVyHxIPC2Gl4HtU7axW6SxJCLRqgKBXmklrdDVlmU=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=csC4PY7fmRwQ3H8U+yYG62MqEYNEjJ7GkQb7q3HSTJ59nWoGY4crIiVERoBES+uhD zRAc6rcfVNPhXSuBgW0UcYhtEO0Uq3Qzk0qSvgrzqbgyzD15qb1ogihkUMHcA01vZ+ m0vNDumZD8fqE2si4XsrM2+ZI+6YV+0PaqBr8HTI= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oo1-xc2b.google.com (mail-oo1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) by sourceware.org (Postfix) with ESMTPS id 033723860C3D for ; Fri, 11 Dec 2020 22:23:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 033723860C3D Received: by mail-oo1-xc2b.google.com with SMTP id n20so2520870ooq.11 for ; Fri, 11 Dec 2020 14:23:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M7gVyHxIPC2Gl4HtU7axW6SxJCLRqgKBXmklrdDVlmU=; b=ZyaBDQ/za1nEKUOKPzEtkq1drXZS3cn5vAvNdrGAWZpGiHnReXiobKZQB8EVbA3Skr b2ytZ/Cf3NfaDAo2SW3FqjAVH4JFmWr1Nbi2Px+mKJpBSilAJR3pT+XPVB11dI2NZGLg LRXTn8zlh6fiWCNmI9WsEQcmJU5AmZ5/RyGZNJw+jJ/qaZK9ongJXlRclI1SpsgOruzd G3W4mJdhKNsAClAg2or1NJhAit9zJmzwMk5LzOE1Hj2LQ0Yhjjjd4pagTFJ6Qj+f+LJ+ e3C3cUo86afsUPtX+JAoTLjI6DhTfUR8d3HHdBa8hpxl1o3H9EGa4YB+ehb+dkf3vaEW khpQ== X-Gm-Message-State: AOAM531tG4tXdaJXSw+8UtgV8v+2A607aUIEMdEWer8v+Xe8rbAtm1p5 FQxPVfxAVun9Pv1IJAwTgwvQ0bsb35ODAczn2YjabGathAg= X-Google-Smtp-Source: ABdhPJyrvG/ASmNbURmTYjqo5Pb87ZtzrFVWKjo4/xJf9nGFONiiJiUATJya7Oy6xgdPJJ2Zelwl2cBb18A20Ack5dk= X-Received: by 2002:a4a:6459:: with SMTP id d25mr11765537oof.35.1607725406456; Fri, 11 Dec 2020 14:23:26 -0800 (PST) MIME-Version: 1.0 References: <20201202230943.4027351-1-hjl.tools@gmail.com> <87o8jb2pqh.fsf@oldenburg2.str.redhat.com> <87a6uv106x.fsf@oldenburg2.str.redhat.com> In-Reply-To: <87a6uv106x.fsf@oldenburg2.str.redhat.com> Date: Fri, 11 Dec 2020 14:22:50 -0800 Message-ID: Subject: V2 [PATCH] Mark __libc_freeres_fn as used [# 27002] To: Florian Weimer X-Spam-Status: No, score=-3036.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-Patchwork-Original-From: "H.J. Lu via Libc-alpha" From: "H.J. Lu" Reply-To: "H.J. Lu" Cc: "H.J. Lu via Libc-alpha" Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" On Thu, Dec 3, 2020 at 5:36 AM Florian Weimer wrote: > > * H. J. Lu: > > > GCC 11 is changed to place the used symbol in SHF_GNU_RETAIN section to > > support --gc-sections. If you believe it is wrong, please file a GCC bug. > > Okay, I filed: > Independent of the GCC issue, __libc_freeres_fn should have the used attribute. OK for master? From afb70a56cd57f0900f7a0b61e51500da2cdf1f4e Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 2 Dec 2020 14:26:28 -0800 Subject: [PATCH] Mark __libc_freeres_fn as used [BZ #27002] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC 11 with commit 6fbec038f7a7ddf29f074943611b53210d17c40c Author: H.J. Lu Date: Mon Feb 3 11:55:43 2020 -0800 Use SHF_GNU_RETAIN to preserve symbol definitions places used symbols in SECTION_RETAIN sections if assembler supports it. Mark __libc_freeres_fn as used to avoid gconv_dl.c: In function ‘free_mem’: gconv_dl.c:191:1: error: ‘do_release_all’ without ‘used’ attribute and ‘free_mem’ with ‘used’ attribute are placed in a section with the same name [-Werror=attributes] 191 | do_release_all (void *nodep) | ^~~~~~~~~~~~~~ In file included from : gconv_dl.c:202:18: note: ‘free_mem’ was declared here 202 | libc_freeres_fn (free_mem) | ^~~~~~~~ ./../include/libc-symbols.h:316:15: note: in definition of macro ‘libc_freeres_fn’ 316 | static void name (void) | ^~~~ cc1: all warnings being treated as errors --- include/libc-symbols.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/libc-symbols.h b/include/libc-symbols.h index 154a73b5e5..f06ce3053a 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -307,7 +307,7 @@ for linking") /* Resource freeing functions from libc.so go in this section. */ #define __libc_freeres_fn_section \ - __attribute__ ((section ("__libc_freeres_fn"))) + __attribute__ ((__used__, section ("__libc_freeres_fn"))) /* Resource freeing functions for libc.so. */ #define libc_freeres_fn(name) \ -- 2.29.2