From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (wildebeest.demon.nl [212.238.236.112]) by sourceware.org (Postfix) with ESMTPS id 4CA843857839 for ; Fri, 6 Nov 2020 17:43:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4CA843857839 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mark@klomp.org Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 5E13B30291AB for ; Fri, 6 Nov 2020 18:43:11 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 4AB6740007C3; Fri, 6 Nov 2020 18:43:11 +0100 (CET) Message-ID: Subject: Re: [PATCH] libelf: Use GElf_Ehdr instead of Elf handle in __libelf_data_type From: Mark Wielaard To: elfutils-devel@sourceware.org Date: Fri, 06 Nov 2020 18:43:11 +0100 In-Reply-To: <20201101183635.22410-1-mark@klomp.org> References: <20201101183635.22410-1-mark@klomp.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.28.5 (3.28.5-10.el7) Mime-Version: 1.0 X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Nov 2020 17:43:13 -0000 On Sun, 2020-11-01 at 19:36 +0100, Mark Wielaard wrote: > GCC with -flto detects some (very) unlikely issues in error paths. > In theory getting the Ehdr from an Elf handle might fail. But in > most cases where __libelf_data_type is used, we already have the > Ehdr anyway. So simply pass that to __libelf_data_type. In the one > place where we don't have it yet, get it and check for failure > before calling __libelf_data_type. Pushed.