This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
binutils-2_28-branch, master: Don't use "_gp" on RISC-V, use "_global_pointer$" instead
- From: Palmer Dabbelt <palmer at dabbelt dot com>
- To: binutils at sourceware dot org
- To: gingold at adacore dot com
- Date: Thu, 9 Feb 2017 18:12:41 -0800
- Subject: binutils-2_28-branch, master: Don't use "_gp" on RISC-V, use "_global_pointer$" instead
- Authentication-results: sourceware.org; auth=none
This was one of the things Andrew and I found during our pre-upstreaming code
review, but we forgot about it. I was recently cleaning up the bugs in our
Github bug tracker and found it, and I thought it would be worth proposing a
fix here.
The issue is that we use the "_gp" symbol to store the global pointer, which
can conflict with ABI-complient code on RISC-V (it's not in any namespace or
anything). This was copied from MIPS, so hopefully it's not going to break
real programs, but we thought that we should try and fix it while we still can.
This will break the RISC-V ABI, but my understanding is that is still OK
because we haven't released yet. That means we _need_ to get this on the 2.28
branch if it lands on master, which is why I've added Tristan Gingold and the
binutils-2_28-branch tag even though this hasn't made it to master yet.
This patch passes all my test cases, and Andrew and I approve of it. I'm
mostly wondering if this is still OK to change in our port, and if it's OK for
2.28.
Sorry for the trouble!
[PATCH] Don't use "_gp" on RISC-V, use "_global_pointer$" instead