aboutsummaryrefslogtreecommitdiff
path: root/libphobos/libdruntime/gcc
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2019-04-23 22:53:12 +0000
committerIain Buclaw <ibuclaw@gcc.gnu.org>2019-04-23 22:53:12 +0000
commitd9392bfa032b448839abadb523aff65b8ccb3dba (patch)
tree1eaa98a40c61f1dcde726eeb560ca71882af7b82 /libphobos/libdruntime/gcc
parent1bacd25b0c2c6ce3f1f737a4a84dc9c806e9af4b (diff)
downloadgcc-d9392bfa032b448839abadb523aff65b8ccb3dba.zip
gcc-d9392bfa032b448839abadb523aff65b8ccb3dba.tar.gz
gcc-d9392bfa032b448839abadb523aff65b8ccb3dba.tar.bz2
libphobos: Add D support for RISC-V Linux
2019-04-23 Iain Buclaw <ibuclaw@gdcproject.org> * configure.tgt: Add riscv*-*-linux* as supported target. * libdruntime/gcc/sections/elf_shared.d (getDependencies): Adjust dlpi_addr on RISCV32 and RISCV64. * src/std/math.d: Add IEEE FPU control support for RISCV. From-SVN: r270522
Diffstat (limited to 'libphobos/libdruntime/gcc')
-rw-r--r--libphobos/libdruntime/gcc/sections/elf_shared.d14
1 files changed, 13 insertions, 1 deletions
diff --git a/libphobos/libdruntime/gcc/sections/elf_shared.d b/libphobos/libdruntime/gcc/sections/elf_shared.d
index 4cf5a23..89adcea 100644
--- a/libphobos/libdruntime/gcc/sections/elf_shared.d
+++ b/libphobos/libdruntime/gcc/sections/elf_shared.d
@@ -22,6 +22,9 @@
module gcc.sections.elf_shared;
+version (RISCV32) version = RISCV_Any;
+version (RISCV64) version = RISCV_Any;
+
version (CRuntime_Glibc) enum SharedELF = true;
else version (CRuntime_Musl) enum SharedELF = true;
else version (FreeBSD) enum SharedELF = true;
@@ -723,7 +726,16 @@ version (Shared)
version (CRuntime_Musl)
strtab = cast(const(char)*)(info.dlpi_addr + dyn.d_un.d_ptr); // relocate
else version (linux)
- strtab = cast(const(char)*)dyn.d_un.d_ptr;
+ {
+ // This might change in future glibc releases (after 2.29) as dynamic sections
+ // are not required to be read-only on RISC-V. This was copy & pasted from MIPS
+ // while upstreaming RISC-V support. Otherwise MIPS is the only arch which sets
+ // 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
+ strtab = cast(const(char)*)dyn.d_un.d_ptr;
+ }
else version (FreeBSD)
strtab = cast(const(char)*)(info.dlpi_addr + dyn.d_un.d_ptr); // relocate
else version (NetBSD)