[v2] RISC-V: Enable static-pie.
Checks
Context |
Check |
Description |
redhat-pt-bot/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
linaro-tcwg-bot/tcwg_glibc_build--master-arm |
success
|
Testing passed
|
redhat-pt-bot/TryBot-32bit |
success
|
Build for i686
|
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 |
success
|
Testing passed
|
Commit Message
From: Yanzhang Wang <yanzhang.wang@intel.com>
This patch referents the commit 374cef3 to add static-pie support. And
because the dummy link map is used when relocating ourselves, so need
not to set __global_pointer$ at this time.
---
sysdeps/riscv/configure | 1 +
sysdeps/riscv/configure.ac | 3 +++
sysdeps/riscv/dl-machine.h | 2 +-
3 files changed, 5 insertions(+), 1 deletion(-)
@@ -31,3 +31,4 @@ printf "%s\n" "$libc_cv_riscv_r_align" >&6; }
config_vars="$config_vars
riscv-r-align = $libc_cv_riscv_r_align"
+$as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h
@@ -16,3 +16,6 @@ EOF
fi
rm -rf conftest.*])
LIBC_CONFIG_VAR([riscv-r-align], [$libc_cv_riscv_r_align])
+
+dnl Static PIE is supported.
+AC_DEFINE(SUPPORT_STATIC_PIE)
@@ -323,7 +323,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
gotplt[1] = (ElfW(Addr)) l;
}
- if (l->l_type == lt_executable)
+ if (l->l_type == lt_executable && l->l_scope != NULL)
{
/* The __global_pointer$ may not be defined by the linker if the
$gp register does not be used to access the global variable