From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x244.google.com (mail-oi1-x244.google.com [IPv6:2607:f8b0:4864:20::244]) by sourceware.org (Postfix) with ESMTPS id 89BC6387089C for ; Thu, 10 Dec 2020 02:14:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 89BC6387089C Received: by mail-oi1-x244.google.com with SMTP id 15so4061237oix.8 for ; Wed, 09 Dec 2020 18:14:41 -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:content-transfer-encoding; bh=PaeOHyk7i/caZR/GhbP5V038nFLSLTxF23hOGxMZ9/A=; b=Z1DCimfF9ioB5YntOt+J66CJcHqU5zK57W5mS7WYVHQWQ6vjk5MJQ3NRvJhLkRS0VY FoECWyC8h1rWZzf3VyHiCbsP6mTv28NFKmJPEflOJ63Wm8q1XW5rv+b/WJPyLBhK9XBr sJSxiuNYppOowg2CK0/8BXFHm20xsSj6ep/a7Qha8wNoLBJ+WleMHg/k6yN/3UFwIxIl sXw9TXloFDubhKKsw6cBt5BFLfrndKffbd6PN/3z0lhgELqRikBCKXSGmc44WsYN23Gb 0uEKZuthjupei7KvIdj+seblEMJHIvVqFp/ZHjrfhmMyfegGwFB2D2irJ+B4zWbkJaPj LrhQ== X-Gm-Message-State: AOAM533r5wBDSxutVHXV1zopSBNNvX6AF+rIJACedkpEsEzHnXu3wC53 0J0CEH5e1ETW8WNZq68d3Ww1NqJj1vyxH/cavZk= X-Google-Smtp-Source: ABdhPJwrgS/TxNSED10rW5DhdMSdnu4PDjT1VCG3lJUH4sRX07afm9Q2iH00/2kFdhCKda9GIUMVPUoBDA1tUK7NtCY= X-Received: by 2002:aca:f5d3:: with SMTP id t202mr4031828oih.25.1607566480862; Wed, 09 Dec 2020 18:14:40 -0800 (PST) MIME-Version: 1.0 References: <20201208125128.775313-1-hjl.tools@gmail.com> In-Reply-To: From: "H.J. Lu" Date: Wed, 9 Dec 2020 18:14:04 -0800 Message-ID: Subject: Re: V3 [PATCH 0/2] Switch to a new section if the SECTION_RETAIN bit doesn't match To: Jim Wilson Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3030.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2020 02:14:42 -0000 On Wed, Dec 9, 2020 at 6:08 PM Jim Wilson wrote: > > On Tue, Dec 8, 2020 at 4:51 AM H.J. Lu via Gcc-patches wrote: >> >> When SECTION_RETAIN is used, definitions marked with used attribute and >> unmarked definitions are placed in a section with the same name. Instea= d >> of issue an error: > > > Have you tested glibc builds with this patch? I noticed yesterday that y= our earlier patch had broken glibc builds, and was about to raise a bug rep= ort for that. I'm seeing > > In file included from : > gconv_db.c: In function 'free_mem': > gconv_db.c:831:18: error: 'free_mem' causes a section type conflict with = 'free_derivation' > 831 | libc_freeres_fn (free_mem) > | ^~~~~~~~ > ./../include/libc-symbols.h:316:15: note: in definition of macro 'libc_fr= eeres_fn' > 316 | static void name (void) > | ^~~~ > gconv_db.c:174:1: note: 'free_derivation' was declared here > 174 | free_derivation (void *p) > | ^~~~~~~~~~~~~~~ > > This is because free_derivation and free_mem are in the same section, but= free_mem has attribute used and free_derivation does not. > > This patch is changing the error to a warning, which I think solves the p= roblem unless --enable-werror is used, which is probably good enough. We c= ould maybe decide that what glibc is doing is wrong and fix glibc to use di= fferent section names or mark both functions as attribute used. > I tested it with glibc build. Glibc build issue is the reason I didn't combine 2 patches into one. If GCC does issue a warning, which it should, we will change glibc. If we decide not to issue a warning, there is no need to change glibc. BTW, I believe glibc should be changed. --=20 H.J.