From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by sourceware.org (Postfix) with ESMTPS id 79E1F385B513 for ; Thu, 29 Dec 2022 00:57:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 79E1F385B513 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x62e.google.com with SMTP id d3so17500637plr.10 for ; Wed, 28 Dec 2022 16:57:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=h16EYdt2vTvK4aQ1ILN3m5edPTgCyZis+A00QZyGI7I=; b=eGqbV3nejmrAJoYLnKli3M5w0K3vbEzptQsDJK5bUILYFR9xPKgsqmg4RZbGWY9HOI GixLDOd4aIupbbe0DGOV4LbUDs0bWXRWYzHOEMG2qCX1OiZIxnm7cJ/zEd2umHgpW6Sz NMav7+T+V6iUzeYYpDSQAFLh/cnxiKTDvDYTdG1LVO14xnUvBMIomFw0UnhFfJpdy6cH JCW1ijwKi0dCuom3Y3NalWD3JuVboYQ+88S9l1kIyQdByZkwcKTPLr9l8naQ9y5MZwbP 6G8pEoh/7aVcTF21uZhrazMvD9VnaXM11ya0RUjxjFH5IdxmmMGWiwEZv37HVOncpcs1 i04A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=h16EYdt2vTvK4aQ1ILN3m5edPTgCyZis+A00QZyGI7I=; b=Sh7LGKOyz9KgntliiAOw968FM/i4mCqcYMRwGnGLj3Ap92hRZ4rU7ab0jOHLkP0Fh9 wxwClu2oLwP7eZKLFl5SioBfpyax1QCFBmKdPeOtc+kwfgDmUzUHqPwzHOLAeFIx3z1K UyM130ZKyNambYGABJEnVD+oc6aZ/A1l7vdm4tkc8lwd4oxoXoy7ujNQGs7LEnZ4/3Qq XbzEt5A33JZpZQwQuC4PZe7eA6Dtd++3EDxwwbHXlzO1HVODUiZvktXFqcOdu6k1tFQq L/sGeBiAdqsDKmvknS1sGeydQ6ICiHDCKTjuwaGc6wgWQWm0dsYrSnJP2K2qxJsERhwb M3LQ== X-Gm-Message-State: AFqh2kpKWsfo9SDfZj250PyjY76sLP/VGVDDhseQdYmqdvxOzEY5hYwh mY1oD+VVU7ezuD1RSa3lp24/o8t9wjc= X-Google-Smtp-Source: AMrXdXvVmChLhaZTNRYFs8cIBXCPooyJeOyxPf2aOUebU3AmnZJ7i3gZPf3n6jleMbXznHIbpYxO+w== X-Received: by 2002:a17:902:e84c:b0:189:340c:20d2 with SMTP id t12-20020a170902e84c00b00189340c20d2mr43915337plg.23.1672275437434; Wed, 28 Dec 2022 16:57:17 -0800 (PST) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id ix20-20020a170902f81400b0018982bf03b4sm11693185plb.117.2022.12.28.16.57.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Dec 2022 16:57:17 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id C2C9E114078C; Thu, 29 Dec 2022 11:27:13 +1030 (ACDT) Date: Thu, 29 Dec 2022 11:27:13 +1030 From: Alan Modra To: "H.J. Lu" Cc: binutils@sourceware.org Subject: Re: [PATCH] x86-64: Allocate input section memory if needed Message-ID: References: <20221227194756.448332-1-hjl.tools@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3029.8 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, Dec 28, 2022 at 03:44:55PM -0800, H.J. Lu wrote: > On Wed, Dec 28, 2022 at 2:07 PM Alan Modra wrote: > > > > On Wed, Dec 28, 2022 at 09:23:21AM -0800, H.J. Lu wrote: > > > On Tue, Dec 27, 2022 at 5:16 PM Alan Modra wrote: > > > > > > > > On Tue, Dec 27, 2022 at 11:47:56AM -0800, H.J. Lu via Binutils wrote: > > > > > + /* Cache the section contents for > > > > > + elf_link_input_bfd. */ > > > > > + elf_section_data (sec)->this_hdr.contents > > > > > + = contents; > > > > > > > > You shouldn't really be caching unaltered section contents when > > > > !info->keep_memory. I'm not saying the patch is wrong, but please fix > > > > this when you have some time. > > But elf_x86_size_or_finish_relative_reloc modifies the section > contents by storing r_addend in it. Oh, so it does. I missed seeing that and thought contents were unaltered. Yes, you always need to cache contents in that case. Sorry for the noise. -- Alan Modra Australia Development Lab, IBM