From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by sourceware.org (Postfix) with ESMTPS id C67163875409 for ; Thu, 4 Mar 2021 06:13:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C67163875409 Received: by mail-pj1-x1035.google.com with SMTP id ch11so141139pjb.4 for ; Wed, 03 Mar 2021 22:13:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=dJk1TCGsnRwuBeYXoLWEpOCp/xOXIzqgORe38tC16rE=; b=dNGJzfwhaPNL+vqGotjRMU2f4pOgad8TnaqMAPs2aSBZnH+aehrti6XEZE/WQRx7fO hnRm+nNWvza5yU/kIdHxrcSNbZw5X9Rb7vaVxsePiZRx20iUPrQkgjooz/QUPvoMwTVV CCCTzqyWvhxATYOlzAK7AaKfKKiQ03eDTBYRIglsX810bw4ASAYKfeLPbunKxcTwDGbU AQndxReRGzed/cf/TTMkTXh8p5GaDdfta9miZOZlFyGj4YkpzxYbB5k6FbBcwGH782mN G2mfiXhYXTSNp+v04exiFMNJRgPEca5nA6FMSQFTSYk1OVKc+iJC7wuxP1frBjR+19g4 h4dw== X-Gm-Message-State: AOAM533/byqs9jJ9t+AKOo0uJasPZyo9GKgYVGP2SA7q2Erod+QyDXLw cN4riC11Y9xuS2S5fRfkzG4z2HPMODAj4Q== X-Google-Smtp-Source: ABdhPJzM+0PGhxj49Vr2DJEAbKbfUuPhb4EHpwFEJD6cqexT/pstFw5Oudkuk5R5pToxHLl82WDnSA== X-Received: by 2002:a17:902:cb0b:b029:e5:b670:d905 with SMTP id c11-20020a170902cb0bb02900e5b670d905mr2723840ply.18.1614838394641; Wed, 03 Mar 2021 22:13:14 -0800 (PST) Received: from bubble.grove.modra.org ([2406:3400:51d:8cc0:1173:7b53:14ee:6c5e]) by smtp.gmail.com with ESMTPSA id iq6sm8864938pjb.31.2021.03.03.22.13.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 22:13:14 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id AF5AA41D76; Thu, 4 Mar 2021 16:43:10 +1030 (ACDT) Date: Thu, 4 Mar 2021 16:43:10 +1030 From: Alan Modra To: Jan Beulich Cc: Binutils Subject: Re: [PATCH 5/6] bfd: don't silently wrap or truncate PE image section RVAs Message-ID: <20210304061310.GT6042@bubble.grove.modra.org> References: <67c184ec-e370-46ee-46d3-bd001ef80445@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-3032.1 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 06:13:17 -0000 On Tue, Mar 02, 2021 at 10:49:54AM +0100, Jan Beulich via Binutils wrote: > In PE images section addresses get expressed as addresses relative to > the image base. Therefore the VA of a section must be no less than the > image base, and after subtraction of the image base the resulting value > should fit in 32 bits. (The issue is particularly obvious to notice when > sections, perhaps because of ELF assumptions, get placed at VA 0 by > default. Debugging info sections as well as .comment, when input files > are ELF, are a good example. All such sections need proper mentioning in > the linker script to avoid this warning.) > > There are a number of test cases which previously produced bogus images, > yet still declared the test a success. Like done for other tests > already, force a zero image base for these. This then also allows (and > requires) dropping again xfail-s which 39a7b38fac0e ("Fix linker tests > to work with 16-bit targets") had added to ld-scripts/default-script*.d > (originally as skip-s). This also depends on similar adjustments to > testsuite/ld-scripts/map-address.* made by an earlier patch. > > For ld-scripts/print-memory-usage.* I suppose xcoff could be dropped > from the exclusion list by suppressing garbage collection, just like > already done in e.g. (as seen in the diff here) ld-scripts/data.*, but I > didn't want to make unrelated adjustments. > > bfd/ > 2021-02-XX Jan Beulich > > * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Diagnose out of range RVA. > > ld/ > 2021-02-XX Jan Beulich > > * testsuite/ld-scripts/alignof.exp, > testsuite/ld-scripts/data.exp, > testsuite/ld-scripts/default-script.exp, > testsuite/ld-scripts/log2.exp, > testsuite/ld-scripts/print-memory-usage.exp, > testsuite/ld-scripts/sizeof.exp, > testsuite/ld-undefined/weak-undef.exp: Set image base to zero > for PE/COFF. > * testsuite/ld-scripts/default-script1.d, > testsuite/ld-scripts/default-script2.d, > testsuite/ld-scripts/default-script3.d, > testsuite/ld-scripts/default-script4.d: Drop xfail and comment. OK, but again you need to add some spaces before function call open parentheses. -- Alan Modra Australia Development Lab, IBM