public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: binutils@sourceware.org
Subject: Re: [PATCH] x86-64: Allocate input section memory if needed
Date: Thu, 29 Dec 2022 11:27:13 +1030	[thread overview]
Message-ID: <Y6zl6UFeLcO+vVS9@squeak.grove.modra.org> (raw)
In-Reply-To: <CAMe9rOpXvqHkGY-0w4tGtP5SfeMbDukPnDYB8ZjpE8nReHLMXA@mail.gmail.com>

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 <amodra@gmail.com> 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 <amodra@gmail.com> 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

  reply	other threads:[~2022-12-29  0:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-27 19:47 H.J. Lu
2022-12-28  1:16 ` Alan Modra
2022-12-28 17:23   ` H.J. Lu
2022-12-28 22:06     ` Alan Modra
2022-12-28 23:44       ` H.J. Lu
2022-12-29  0:57         ` Alan Modra [this message]
2023-01-03 21:59 ` H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y6zl6UFeLcO+vVS9@squeak.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=hjl.tools@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).