Skip to content
This repository has been archived by the owner on Aug 17, 2022. It is now read-only.

Don't use "_gp" on RISC-V, use "_global_pointer$" instead #56

Merged
merged 1 commit into from
Feb 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bfd/elfnn-riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion ld/emulparams/elf32lriscv-defs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}}"
Expand Down