[PATCH] Don't access items in .sdata section using gp-relative addressing when target is NaCl.

Eric Christopher echristo at gmail.com
Tue Jun 17 16:39:41 PDT 2014


On Tue, Jun 17, 2014 at 4:31 PM, Sasa Stankovic
<Sasa.Stankovic at imgtec.com> wrote:
>> Would it make sense to turn off use of sdata by default, and have it only enabled by a compiler flag or llc flag?  That would be cleaner and is not very difficult to do.  It should come with a warning like "this is an optimisation that might cause moderate-sized programs to fail to link".
>
> This is what Mips gcc for Linux does - gp-relative addressing is not enabled by default, but it can be requested at command line (gcc doesn't issue a warning though). I also tested a bare-metal Mips gcc toolchain, and it has different behavior - gp-relative addressing is enabled by default. I'll ask Daniel Sanders (LLVM code owner for MIPS backend) whether we should add a command line flag for this.
>

Yep. This is because of the various interop issues on the various
platforms. It seems entirely reasonable to copy gcc here.

-eric




More information about the llvm-commits mailing list