[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/32266] ld.bfd segfaults when linking libclang_rt.asan-powerpc64.
From: |
cvs-commit at gcc dot gnu.org |
Subject: |
[Bug ld/32266] ld.bfd segfaults when linking libclang_rt.asan-powerpc64.so on 32-bit PowerPC |
Date: |
Sat, 04 Jan 2025 09:31:43 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=32266
--- Comment #8 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The binutils-2_43-branch branch has been updated by Alan Modra
<amodra@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=412919cb962e984e5272435ad6aa4766029954e9
commit 412919cb962e984e5272435ad6aa4766029954e9
Author: Alan Modra <amodra@gmail.com>
Date: Sun Oct 13 15:11:59 2024 +1030
PR32266, segv when linking libclang_rt.asan-powerpc64.so
Change the mmap support added with commit 9ba56acee518 to always mmap
memory with PROT_READ | PROT_WRITE. Prior to that commit most file
contents were read into a buffer allocated with bfd_alloc or
bfd_malloc and thus the memory was read/write. Even after that commit
any section contents with relocations must be read/write to apply the
relocs. Making them all read/write is not a major change, and it
should not introduce any measurable linker slowdown for contents that
are not modified. More importantly, it removes a BFD behaviour
difference that only triggers when large files are involved.
PR 32266
PR 32109
* libbfd.c (bfd_mmap_local): Remove prot param. Always mmap
with PROT_READ | PROT_WRITE. Adjust all calls.
(_bfd_mmap_temporary): Rename from _bfd_mmap_readonly_temporary.
(_bfd_munmap_temporary): Rename from
_bfd_munmap_readonly_temporary.
_bfd_mmap_persistent): Rename from _bfd_mmap_readonly_persistent.
(_bfd_generic_get_section_contents): Use PROT_READ | PROT_WRITE
regardless of relocs.
* libbfd-in.h: Update decls to suit. Make non-USE_MMAP variants
static inline functions.
* elflink.c: Update all uses of _bfd_mmap functions.
* elf.c: Likewise.
(bfd_elf_get_str_section): Revert commit 656f8fbaae.
* libbfd.h: Regenerate.
(cherry picked from commit 76eab8f47a743bde86be410bce8fd8382eaea6c2)
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/32266] ld.bfd segfaults when linking libclang_rt.asan-powerpc64.so on 32-bit PowerPC,
cvs-commit at gcc dot gnu.org <=