public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-6881] libphobos: Fix executables segfault on mipsel architecture
@ 2021-01-24 0:09 Iain Buclaw
0 siblings, 0 replies; only message in thread
From: Iain Buclaw @ 2021-01-24 0:09 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:81f928ec8e8abf1f21c5ff008c39b5d6af78f6cb
commit r11-6881-g81f928ec8e8abf1f21c5ff008c39b5d6af78f6cb
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date: Sun Jan 24 00:20:25 2021 +0100
libphobos: Fix executables segfault on mipsel architecture
The dynamic section on MIPS is read-only, but this was not properly
handled in the runtime library. The segfault only occurred for programs
that linked to the shared libphobos library.
libphobos/ChangeLog:
PR d/98806
* libdruntime/gcc/sections/elf_shared.d (MIPS_Any): Declare version
for MIPS32 and MIPS64.
(getDependencies): Adjust dlpi_addr on MIPS_Any.
Diff:
---
libphobos/libdruntime/gcc/sections/elf_shared.d | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libphobos/libdruntime/gcc/sections/elf_shared.d b/libphobos/libdruntime/gcc/sections/elf_shared.d
index 9050413b261..427759a4f94 100644
--- a/libphobos/libdruntime/gcc/sections/elf_shared.d
+++ b/libphobos/libdruntime/gcc/sections/elf_shared.d
@@ -22,6 +22,8 @@
module gcc.sections.elf_shared;
+version (MIPS32) version = MIPS_Any;
+version (MIPS64) version = MIPS_Any;
version (RISCV32) version = RISCV_Any;
version (RISCV64) version = RISCV_Any;
version (S390) version = IBMZ_Any;
@@ -763,6 +765,8 @@ version (Shared)
// in glibc: #define DL_RO_DYN_SECTION 1
version (RISCV_Any)
strtab = cast(const(char)*)(info.dlpi_addr + dyn.d_un.d_ptr); // relocate
+ else version (MIPS_Any)
+ strtab = cast(const(char)*)(info.dlpi_addr + dyn.d_un.d_ptr); // relocate
else
strtab = cast(const(char)*)dyn.d_un.d_ptr;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-24 0:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-24 0:09 [gcc r11-6881] libphobos: Fix executables segfault on mipsel architecture Iain Buclaw
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).