public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Alan Modra <amodra@gmail.com>
Cc: binutils@sourceware.org, goldstein.w.n@gmail.com
Subject: Re: [PATCH 0/4] elf: Use mmap to map in section contents
Date: Wed, 6 Mar 2024 08:16:54 -0800	[thread overview]
Message-ID: <CAMe9rOrPxTYFC9UqBtQgymzm01XazLJzKaUULT1mY57P-gMapQ@mail.gmail.com> (raw)
In-Reply-To: <Zee98D8It1VCWv7M@squeak.grove.modra.org>

On Tue, Mar 5, 2024 at 4:51 PM Alan Modra <amodra@gmail.com> wrote:
>
> On Tue, Mar 05, 2024 at 09:00:53AM -0800, H.J. Lu wrote:
> > We can use mmap to map in ELF section contents, instead of copying them
> > into memory by hand.  We don't need to cache symbol nor relocation tables
> > if they are mapped in.  Data to link the 3.5GB clang executable in LLVM
> > 17 debug build on Linux/x86-64 with 32GB RAM is:
>
> I like the idea.  Some comments on the patch:
> - You should probably replace occurrences of HAVE_MMAP with USE_MMAP,
>   and change the config default for --with-mmap.

Fixed.

> - There doesn't seem to be any reason to have an asize parameter to
>   _bfd_mmap_readonly_tracked if you are going to give an error on
>   unterminated string tables.  (BTW, I don't disagree with giving an
>   error.)

Fixed.

> - Can you put contents_addr in bfd_elf_section_data rather than
>   bfd_section so that the extra pointer doesn't affect non-ELF
>   targets?

Fixed.

> - _bfd_link_keep_memory should probably be moved to elflink.c, renamed
>   to _elf_link_keep_memory and declared in elf-bfd.h.
>

I renamed it to _bfd_elf_link_keep_memory.

Here is the v2 patch:

https://patchwork.sourceware.org/project/binutils/list/?series=31657

Thanks.

-- 
H.J.

  reply	other threads:[~2024-03-06 16:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-05 17:00 H.J. Lu
2024-03-05 17:00 ` [PATCH 1/4] elf: Use mmap to map in read-only sections H.J. Lu
2024-03-05 17:00 ` [PATCH 2/4] elf: Add _bfd_elf_mmap_section and _bfd_elf_munmap_section_contents H.J. Lu
2024-03-05 17:00 ` [PATCH 3/4] elf: Use mmap to map in symbol and relocation tables H.J. Lu
2024-03-05 17:00 ` [PATCH 4/4] elf: Don't cache symbol nor relocation tables with mmap H.J. Lu
2024-03-05 17:03 ` [PATCH 0/4] elf: Use mmap to map in section contents Noah Goldstein
2024-03-06  0:50 ` Alan Modra
2024-03-06 16:16   ` H.J. Lu [this message]
2024-03-06 20:51     ` H.J. Lu
2024-03-06  4:45 ` Sam James

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=CAMe9rOrPxTYFC9UqBtQgymzm01XazLJzKaUULT1mY57P-gMapQ@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=goldstein.w.n@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).