This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: 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: gingold at adacore dot com
- Cc: binutils at sourceware dot org
- Cc: Andrew Waterman <andrew at sifive dot com>
- Date: Mon, 13 Feb 2017 09:55:12 -0800 (PST)
- Subject: Re: binutils-2_28-branch, master: Don't use "_gp" on RISC-V, use "_global_pointer$" instead
- Authentication-results: sourceware.org; auth=none
On Fri, 10 Feb 2017 00:28:11 PST (-0800), gingold@adacore.com wrote:
>
>> On 10 Feb 2017, at 03:12, Palmer Dabbelt <palmer@dabbelt.com> wrote:
>>
>> 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.
>
> That's ok for 2.28 once in the trunk.
I committed this to master and to 2.28.
Thanks!