From: "H.J. Lu" <hjl.tools@gmail.com>
To: Alan Modra <amodra@gmail.com>
Cc: binutils@sourceware.org
Subject: Re: [PATCH v3 0/6] elf: Use mmap to map in section contents
Date: Wed, 6 Mar 2024 15:26:43 -0800 [thread overview]
Message-ID: <CAMe9rOqu4ijN6pqC5fTwbZWtDE-N2OMmFnjm54Gg1g0NCssHRw@mail.gmail.com> (raw)
In-Reply-To: <Zej1fM0pT9g+S3id@squeak.grove.modra.org>
On Wed, Mar 6, 2024 at 3:00 PM Alan Modra <amodra@gmail.com> wrote:
>
> On Wed, Mar 06, 2024 at 12:47:25PM -0800, H.J. Lu wrote:
> > Changes in v3:
>
> I ran my target tests against this version and found two regressions.
> mipsisa32r2el-elf +FAIL: MIPS eh-frame 3
> mipstx39-elf +FAIL: MIPS eh-frame 3
>
> The keep_memory change causes this code in
> bfd/elfxx-mips.c:_bfd_mips_elf_eh_frame_address_size to fail:
>
> if (sec->reloc_count > 0
> && elf_section_data (sec)->relocs != NULL
> && (ELF32_R_TYPE (elf_section_data (sec)->relocs[0].r_info)
> == R_MIPS_64))
> return 8;
>
> Yes, the test also fails with --no-keep-memory so this is really a bug
> in the mips backend, but we should try to not break this code.
>
I changed it to
bool
_bfd_elf_link_keep_memory (struct bfd_link_info *info)
{
#ifdef USE_MMAP
/* Don't cache symbol nor relocation tables if they are mapped in.
NB: Since the --no-keep-memory linker option causes
FAIL: MIPS eh-frame 3
in the linker testsuite for mipsisa32r2el-elf target, this is
opt-in by each backend. */
const struct elf_backend_data *bed
= get_elf_backend_data (info->output_bfd);
if (bed->use_mmap)
return false;
#endif
The v4 patch is at
https://patchwork.sourceware.org/project/binutils/list/?series=31668
--
H.J.
prev parent reply other threads:[~2024-03-06 23:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-06 20:47 H.J. Lu
2024-03-06 20:47 ` [PATCH v3 1/6] bfd: Don't hard-code BFD_JUMP_TABLE_COPY H.J. Lu
2024-03-06 20:47 ` [PATCH v3 2/6] bfd: Change the --with-mmap default to true H.J. Lu
2024-03-06 20:47 ` [PATCH v3 3/6] elf: Use mmap to map in read-only sections H.J. Lu
2024-03-06 20:47 ` [PATCH v3 4/6] elf: Add _bfd_elf_mmap_section and _bfd_elf_munmap_section_contents H.J. Lu
2024-03-06 20:47 ` [PATCH v3 5/6] elf: Use mmap to map in symbol and relocation tables H.J. Lu
2024-03-06 20:47 ` [PATCH v3 6/6] elf: Don't cache symbol nor relocation tables with mmap H.J. Lu
2024-03-06 23:00 ` [PATCH v3 0/6] elf: Use mmap to map in section contents Alan Modra
2024-03-06 23:26 ` H.J. Lu [this message]
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=CAMe9rOqu4ijN6pqC5fTwbZWtDE-N2OMmFnjm54Gg1g0NCssHRw@mail.gmail.com \
--to=hjl.tools@gmail.com \
--cc=amodra@gmail.com \
--cc=binutils@sourceware.org \
/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).