From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by sourceware.org (Postfix) with ESMTP id 2B372385DC04 for ; Thu, 16 Apr 2020 16:27:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2B372385DC04 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-72-ILyAwMpqOliBZ3oZrH6ogg-1; Thu, 16 Apr 2020 12:27:44 -0400 X-MC-Unique: ILyAwMpqOliBZ3oZrH6ogg-1 Received: by mail-ed1-f72.google.com with SMTP id y66so5380683ede.19 for ; Thu, 16 Apr 2020 09:27:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ZzYcxZQ2vJZM0HroWKgzcIpNA7JiqSv3jAAVeY9lMuE=; b=EfKvzn+64TyyRHUmKBsMySAtYcc8CD2pj+DQ09id0TEeLyIDZPD8e5kOCG4ZefB74U gFha3tsSClj/zjINMqLsTEVR7CENYvcV2I/V/puXDL4LgR6O3ttXLUe9rnbjuBjtYGjK 52CksbfFPNO+d804gaUMJDcjPtuxxMPvJ0FG+uqsgU6j9hIFrwAaC+1CMSD0oY4SKgzN OyE37/zk+Ewv+rlYNkjUXeSJGx7vzef03YDbyo4JfK6KhECul2JIs8W+er+4uLM4sRxM uNY9dhT/3vCURWuA4LjcOFzLgdnoUrZt0vTcD7sxr6H2cBLWA3xeiB3dLvWyYgSi8Tvl OpnA== X-Gm-Message-State: AGi0PuYmIDh55FMZ/g52ZnWfYKdJCiZUORz3XngoF0cBR3u4hps2CSGD /Ch+GmKHF6dIxHMopCmqLABVP3cqtzXXGqGxgrurd2kRqcCQiJNCBFxXH2xrdWxOxxKAQP26+Dg vLI1NtMDPc5K0wCj8rrnkIQ== X-Received: by 2002:aa7:d0d6:: with SMTP id u22mr14989084edo.262.1587054462662; Thu, 16 Apr 2020 09:27:42 -0700 (PDT) X-Google-Smtp-Source: APiQypLvRvhKHSkh1+ANExnCF+kRQVA1L4kxSkdKW0c3xb6EuyD/7Rxjj9VCHPBDV3J67K9ceKBc0A== X-Received: by 2002:aa7:d0d6:: with SMTP id u22mr14989074edo.262.1587054462540; Thu, 16 Apr 2020 09:27:42 -0700 (PDT) Received: from ?IPv6:2001:8a0:f909:7b00:56ee:75ff:fe8d:232b? ([2001:8a0:f909:7b00:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id k33sm2584933edc.18.2020.04.16.09.27.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Apr 2020 09:27:41 -0700 (PDT) Subject: Re: [PATCH] gdb: make is_linked_with_cygwin_dll handle import table not at beginning of .idata section To: Simon Marchi , gdb-patches@sourceware.org References: <20200416154508.168585-1-simon.marchi@polymtl.ca> From: Pedro Alves Message-ID: Date: Thu, 16 Apr 2020 17:27:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20200416154508.168585-1-simon.marchi@polymtl.ca> Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: 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:27:47 -0000 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. Thanks, Pedro Alves