This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Don't use "_gp" on RISC-V, use "_global_pointer$" instead
- From: Palmer Dabbelt <palmer at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 13 Feb 2017 17:54:26 -0000
- Subject: [binutils-gdb] Don't use "_gp" on RISC-V, use "_global_pointer$" instead
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=10ddfe62f8979cfe380b07c4f827e72681cc612a
commit 10ddfe62f8979cfe380b07c4f827e72681cc612a
Author: Palmer Dabbelt <palmer@dabbelt.com>
Date: Wed Feb 8 11:26:07 2017 -0800
Don't use "_gp" on RISC-V, use "_global_pointer$" instead
"_gp" could conflict with ABI-complient code. While it's probably OK
because MIPS uses this name, we figured it'd be good to clean this up
before a release with RISC-V in it.
ld/ChangeLog:
2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
* emulparams/elf32lriscv-defs.sh (SDATA_START_SYMBOLS): Change
_gp to __global_pointer$.
bfd/ChangeLog:
2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
* elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
__global_pointer$.
Diff:
---
bfd/ChangeLog | 5 +++++
bfd/elfnn-riscv.c | 2 +-
ld/ChangeLog | 5 +++++
ld/emulparams/elf32lriscv-defs.sh | 2 +-
4 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 1c3d701..db620e2 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
+
+ * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
+ __global_pointer$.
+
2017-02-13 Nick Clifton <nickc@redhat.com>
PR binutils/21151
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
index b8dd1f2..6c14313 100644
--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -1463,7 +1463,7 @@ riscv_global_pointer_value (struct bfd_link_info *info)
{
struct bfd_link_hash_entry *h;
- h = bfd_link_hash_lookup (info->hash, "_gp", FALSE, FALSE, TRUE);
+ h = bfd_link_hash_lookup (info->hash, "__global_pointer$", FALSE, FALSE, TRUE);
if (h == NULL || h->type != bfd_link_hash_defined)
return 0;
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 397dbeb..4bb505d 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
+
+ * emulparams/elf32lriscv-defs.sh (SDATA_START_SYMBOLS): Change
+ _gp to __global_pointer$
+
2017-02-08 Andrew Burgess <andrew.burgess@embecosm.com>
* configure.tgt (arc*-*-linux*): Change the default linker
diff --git a/ld/emulparams/elf32lriscv-defs.sh b/ld/emulparams/elf32lriscv-defs.sh
index 0eba0d1..ab80333 100644
--- a/ld/emulparams/elf32lriscv-defs.sh
+++ b/ld/emulparams/elf32lriscv-defs.sh
@@ -23,7 +23,7 @@ TEXT_START_ADDR=0x10000
MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
-SDATA_START_SYMBOLS="_gp = . + 0x800;
+SDATA_START_SYMBOLS="__global_pointer$ = . + 0x800;
*(.srodata.cst16) *(.srodata.cst8) *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*)"
INITIAL_READONLY_SECTIONS=".interp : { *(.interp) } ${CREATE_PIE-${INITIAL_READONLY_SECTIONS}}"