]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Don't use "_gp" on RISC-V, use "_global_pointer$" instead
authorPalmer Dabbelt <palmer@dabbelt.com>
Wed, 8 Feb 2017 19:26:07 +0000 (11:26 -0800)
committerPalmer Dabbelt <palmer@dabbelt.com>
Mon, 13 Feb 2017 17:52:15 +0000 (09:52 -0800)
"_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$.

bfd/ChangeLog
bfd/elfnn-riscv.c
ld/ChangeLog
ld/emulparams/elf32lriscv-defs.sh

index 8ceba712c427429afff24fedff146c1df9835e51..d10fe8c64803ca8088e595df8137a4ed59511e72 100644 (file)
@@ -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  Maciej W. Rozycki  <macro@imgtec.com>
 
        * elfxx-mips.c (mips_elf_hash_sort_data): Add
index f414429ebe8420a3cf66e2c4d326c60740a888fa..ab002b673cf9382023d89a18608b03d17f4f831d 100644 (file)
@@ -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;
 
index 75ede4ab5f1d124f12bf7cba9039a36da299227f..c9aef537dd164c72e548deabb94d2425a85e0c67 100644 (file)
@@ -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-03  Alan Modra  <amodra@gmail.com>
 
        PR ld/21000
index 0eba0d1a0cb39a082b4022b64b9a9145da6213b3..ab803332898b1e4559fe48b7c5fe59dcfcbe458e 100644 (file)
@@ -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}}"