From patchwork Mon Jul 24 17:15:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 1811958 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=E1PV/c0z; dkim-atps=neutral Received: from server2.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 ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R8myh6C4mz1yYc for ; Tue, 25 Jul 2023 03:15:56 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8BDA13856DD0 for ; Mon, 24 Jul 2023 17:15:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BDA13856DD0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690218954; bh=luVvpo0erkeDd0qdObtktBos9yyxcg8uHjr8Zl0iPq4=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=E1PV/c0zREF72nkRKhT3L3Hn8uXD119Lz/OhpU7fDVMmsWNM39Nff7c5hXuVSeRUN Lwi/Nz0H1bwXAO0TNdIbkeAQ78z97lt9AY6a48OWjC7HDP//wpikGV2CTrWRQLYtDr DduNgwDAyZ/v7FmiAxgv8gBGjn5GJoi4eL0vrtoY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) by sourceware.org (Postfix) with ESMTPS id 728A03858C66 for ; Mon, 24 Jul 2023 17:15:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 728A03858C66 Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-56584266c41so2801079eaf.2 for ; Mon, 24 Jul 2023 10:15:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690218932; x=1690823732; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=luVvpo0erkeDd0qdObtktBos9yyxcg8uHjr8Zl0iPq4=; b=LhxDL5+lq6wRv6UTl/ItHiLno2BxRQqJARe1NOElqU/JPPHOerVqWURA4zynqkGE+Q k5OvNfk0Qm2jtOnJXzwrTZGa8n6G/r5neKFGVKO/JsLuNRJCSD8+CJcPQDwiEDGgncnz QhT2dET6Sfqd3vnGPzvhWHz/VUSoiYVQKlhQev5yS6mBJsV/+KJp801/WIqiBBuhYils cy4HbfkqrvtDOCiWTaP3vTsYea+1BlgbN+id1QKfR8NkFCdSd7txDKwBxeQMxDx8lOaf e4UCSaxW4GPLpgu3xjNIS7Us4yjU0t8qzQub2lRQ/4NdH59kPBOFp7rF2MX6sRu8Hpcc BNSw== X-Gm-Message-State: ABy/qLbNrQriywmV3UGQNzkqdFCJ/LqsN0ddjE8Wf7dERvLgvMn7eXoU Oauvb5OukPUgbW/903d2on8glJZ2uwrpz0K+iYfgJg== X-Google-Smtp-Source: APBJJlGeAS1xKAHVjlEUB71hxF7VG+B7RQFi4cuVFA67KKC4jiGr2WwBjfpl/hynWE4R9/cFm9Gs0A== X-Received: by 2002:a4a:2401:0:b0:566:f94f:cd28 with SMTP id m1-20020a4a2401000000b00566f94fcd28mr9197613oof.3.1690218932066; Mon, 24 Jul 2023 10:15:32 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c0:d4d2:46e0:428c:6669:da90]) by smtp.gmail.com with ESMTPSA id x140-20020a4a4192000000b0055e489a7fdasm4602286ooa.0.2023.07.24.10.15.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 10:15:31 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 1/3] malloc: Fix set-freeres.c with gcc 6 Date: Mon, 24 Jul 2023 14:15:22 -0300 Message-Id: <20230724171524.2687112-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230724171524.2687112-1-adhemerval.zanella@linaro.org> References: <20230724171524.2687112-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" Old GCC might trigger the the comparison will always evaluate as ‘true’ warnig for static build: set-freeres.c:87:14: error: the comparison will always evaluate as ‘true’ for the address of ‘__libc_getgrgid_freemem_ptr’ will never be NULL [-Werror=address] if (&__ptr != NULL) \ So add pragma weak for all affected usages. Checked on x86_64 and i686 with gcc 6 and 13. Reviewed-by: Carlos O'Donell --- malloc/set-freeres.c | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/malloc/set-freeres.c b/malloc/set-freeres.c index 1aab34b586..41ef9c2dd6 100644 --- a/malloc/set-freeres.c +++ b/malloc/set-freeres.c @@ -63,6 +63,52 @@ # pragma weak __libpthread_freeres # pragma weak __libc_dlerror_result_free # pragma weak __check_pf_freemem +# pragma weak __libc_fgetgrent_freemem_ptr +# pragma weak __libc_fgetsgent_freeres_ptr +# pragma weak __libc_getnetgrent_freemem_ptr +# pragma weak __libc_rcmd_freemem_ptr +# pragma weak __libc_rexec_freemem_ptr +# pragma weak __libc_mntent_freemem_ptr +# pragma weak __libc_fgetpwent_freemem_ptr +# pragma weak __libc_getspent_freemem_ptr +# pragma weak __libc_resolv_res_hconf_freemem_ptr +# pragma weak __libc_fgetspent_freemem_ptr +# pragma weak __libc_tzfile_freemem_ptr +# pragma weak __libc_getnameinfo_freemem_ptr +# pragma weak __libc_getutent_freemem_ptr +# pragma weak __libc_getutid_freemem_ptr +# pragma weak __libc_getutline_freemem_ptr +# pragma weak __libc_reg_printf_freemem_ptr +# pragma weak __libc_reg_type_freemem_ptr +# pragma weak __libc_getgrgid_freemem_ptr +# pragma weak __libc_getgrnam_freemem_ptr +# pragma weak __libc_getpwnam_freemem_ptr +# pragma weak __libc_getpwuid_freemem_ptr +# pragma weak __libc_getspnam_freemem_ptr +# pragma weak __libc_getaliasbyname_freemem_ptr +# pragma weak __libc_gethostbyaddr_freemem_ptr +# pragma weak __libc_gethostbyname_freemem_ptr +# pragma weak __libc_gethostbyname2_freemem_ptr +# pragma weak __libc_getnetbyaddr_freemem_ptr +# pragma weak __libc_getnetbyname_freemem_ptr +# pragma weak __libc_getprotobynumber_freemem_ptr +# pragma weak __libc_getprotobyname_freemem_ptr +# pragma weak __libc_getrpcbyname_freemem_ptr +# pragma weak __libc_getrpcbynumber_freemem_ptr +# pragma weak __libc_getservbyname_freemem_ptr +# pragma weak __libc_getservbyport_freemem_ptr +# pragma weak __libc_getgrent_freemem_ptr +# pragma weak __libc_getpwent_freemem_ptr +# pragma weak __libc_getaliasent_freemem_ptr +# pragma weak __libc_gethostent_freemem_ptr +# pragma weak __libc_getnetent_freemem_ptr +# pragma weak __libc_getprotoent_freemem_ptr +# pragma weak __libc_getrpcent_freemem_ptr +# pragma weak __libc_getservent_freemem_ptr +# pragma weak __libc_efgcvt_freemem_ptr +# pragma weak __libc_qefgcvt_freemem_ptr +# pragma weak __libc_qefgcvt_freemem_ptr +# pragma weak __ttyname_freemem_ptr #endif #ifdef SHARED