From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id C27B4385C426 for ; Thu, 16 Apr 2020 16:52:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C27B4385C426 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 03GGqext027649 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Apr 2020 12:52:45 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 03GGqext027649 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 75A3B1E827; Thu, 16 Apr 2020 12:52:38 -0400 (EDT) Subject: Re: [PATCH] gdb: make is_linked_with_cygwin_dll handle import table not at beginning of .idata section To: Pedro Alves , gdb-patches@sourceware.org References: <20200416154508.168585-1-simon.marchi@polymtl.ca> From: Simon Marchi Message-ID: Date: Thu, 16 Apr 2020 12:52:38 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 16 Apr 2020 16:52:40 +0000 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2020 16:52:50 -0000 On 2020-04-16 12:27 p.m., Pedro Alves wrote: > On 4/16/20 4:45 PM, Simon Marchi via Gdb-patches wrote: >> + /* The section's virtual address as reported by BFD has the image base applied, >> + remove it. */ >> + gdb_assert (idata_section_va >= pe_extra->ImageBase); >> + idata_section_va -= pe_extra->ImageBase; >> + >> + /* Assert that the import table is indeed within the .idata section's range. */ >> + gdb_assert (import_table_va >= idata_section_va); >> + gdb_assert (import_table_va < (idata_section_va + idata_section_size)); > > Couldn't these be triggered with malformed files? I.e., seems like an assertion > is too strong, and we should maybe warn and return false instead. Hmm yes, that's right, I'll fix it. Simon