Re: %pc relative addressing of string literals/const data

2010-11-08 Thread Joakim Tjernlund
Dave Korn dave.korn.cyg...@gmail.com wrote on 2010/10/27 13:59:00: On 27/10/2010 07:47, Joakim Tjernlund wrote: Alan Modra amo...@gmail.com wrote on 2010/10/27 04:01:50: On Wed, Oct 27, 2010 at 12:53:00AM +0100, Dave Korn wrote: On 26/10/2010 23:37, Joakim Tjernlund wrote: Everything

Re: %pc relative addressing of string literals/const data

2010-11-08 Thread Dave Korn
On 08/11/2010 13:44, Joakim Tjernlund wrote: One ping and a few days later and nothing. Very frustrating. I don't believe all PPC devs are so busy that none has the time to look at a simple one liner. What is up? There's only the one of him. He probably is that busy. He's a very nice

Re: %pc relative addressing of string literals/const data

2010-11-08 Thread Peter Bergner
latOn Mon, 2010-11-08 at 21:13 +, Dave Korn wrote: On 08/11/2010 13:44, Joakim Tjernlund wrote: One ping and a few days later and nothing. Very frustrating. I don't believe all PPC devs are so busy that none has the time to look at a simple one liner. What is up? There's only the

Re: %pc relative addressing of string literals/const data

2010-10-27 Thread Joakim Tjernlund
Alan Modra amo...@gmail.com wrote on 2010/10/27 04:01:50: On Wed, Oct 27, 2010 at 12:53:00AM +0100, Dave Korn wrote: On 26/10/2010 23:37, Joakim Tjernlund wrote: Everything went dead quiet the minute I stated to send patches, what did I do wrong? Nothing, you just ran into the

Re: %pc relative addressing of string literals/const data

2010-10-27 Thread Dave Korn
On 27/10/2010 07:47, Joakim Tjernlund wrote: Alan Modra amo...@gmail.com wrote on 2010/10/27 04:01:50: On Wed, Oct 27, 2010 at 12:53:00AM +0100, Dave Korn wrote: On 26/10/2010 23:37, Joakim Tjernlund wrote: Everything went dead quiet the minute I stated to send patches, what did I do wrong?

Re: %pc relative addressing of string literals/const data

2010-10-26 Thread Joakim Tjernlund
Joakim Tjernlund/Transmode wrote on 2010/10/14 15:54:32: Joakim Tjernlund/Transmode wrote on 2010/10/12 11:00:36: Alan Modra amo...@gmail.com wrote on 2010/10/11 14:58:45: On Sun, Oct 10, 2010 at 11:20:06AM +0200, Joakim Tjernlund wrote: Now I have had a closer look at this and it

Re: %pc relative addressing of string literals/const data

2010-10-26 Thread Dave Korn
On 26/10/2010 23:37, Joakim Tjernlund wrote: Everything went dead quiet the minute I stated to send patches, what did I do wrong? Nothing, you just ran into the lack-of-manpower problem. Sorry! And I can't even help, I'm not a ppc maintainer. But you definitely didn't do anything wrong.

Re: %pc relative addressing of string literals/const data

2010-10-26 Thread Alan Modra
On Wed, Oct 27, 2010 at 12:53:00AM +0100, Dave Korn wrote: On 26/10/2010 23:37, Joakim Tjernlund wrote: Everything went dead quiet the minute I stated to send patches, what did I do wrong? Nothing, you just ran into the lack-of-manpower problem. Sorry! And I can't even help, I'm not

Re: %pc relative addressing of string literals/const data

2010-10-21 Thread Gunther Nikl
Michael Meissner wrote: Note, the 64-bit ABI requires that r2 have the current function's GOT in it when the function is called, while the 32-bit ABI uses r2 as a small data pointer (and possibly r13 as a second small data pointer). If the 32-bit ABI is the SYSV-ABI, then you got the register

Re: %pc relative addressing of string literals/const data

2010-10-21 Thread Michael Meissner
On Thu, Oct 21, 2010 at 08:17:51PM +0200, Gunther Nikl wrote: Michael Meissner wrote: Note, the 64-bit ABI requires that r2 have the current function's GOT in it when the function is called, while the 32-bit ABI uses r2 as a small data pointer (and possibly r13 as a second small data

Re: %pc relative addressing of string literals/const data

2010-10-14 Thread Joakim Tjernlund
Joakim Tjernlund/Transmode wrote on 2010/10/12 11:00:36: Alan Modra amo...@gmail.com wrote on 2010/10/11 14:58:45: On Sun, Oct 10, 2010 at 11:20:06AM +0200, Joakim Tjernlund wrote: Now I have had a closer look at this and it looks much like -fpic on ppc32, you still use the GOT/TOC

Re: %pc relative addressing of string literals/const data

2010-10-12 Thread Joakim Tjernlund
Alan Modra amo...@gmail.com wrote on 2010/10/11 14:58:45: On Sun, Oct 10, 2010 at 11:20:06AM +0200, Joakim Tjernlund wrote: Now I have had a closer look at this and it looks much like -fpic on ppc32, you still use the GOT/TOC to load the address where the data is. No, with ppc64

Re: %pc relative addressing of string literals/const data

2010-10-12 Thread Joakim Tjernlund
Joakim Tjernlund/Transmode wrote on 2010/10/09 18:32:40: Michael Meissner meiss...@linux.vnet.ibm.com wrote on 2010/10/07 20:21:38: On Thu, Oct 07, 2010 at 04:50:50PM +0200, Joakim Tjernlund wrote: Why not offer some of this on PowerPC32? mcmodel=small would probably be enough.

Re: %pc relative addressing of string literals/const data

2010-10-11 Thread Alan Modra
On Sun, Oct 10, 2010 at 11:20:06AM +0200, Joakim Tjernlund wrote: Now I have had a closer look at this and it looks much like -fpic on ppc32, you still use the GOT/TOC to load the address where the data is. No, with ppc64 -mcmodel=medium you use the GOT/TOC pointer plus an offset to address

Re: %pc relative addressing of string literals/const data

2010-10-11 Thread Joakim Tjernlund
Alan Modra amo...@gmail.com wrote on 2010/10/11 14:58:45: On Sun, Oct 10, 2010 at 11:20:06AM +0200, Joakim Tjernlund wrote: Now I have had a closer look at this and it looks much like -fpic on ppc32, you still use the GOT/TOC to load the address where the data is. No, with ppc64

Re: %pc relative addressing of string literals/const data

2010-10-10 Thread Joakim Tjernlund
Alan Modra amo...@gmail.com wrote on 2010/10/06 00:19:26: On Tue, Oct 05, 2010 at 11:40:11PM +0200, Joakim Tjernlund wrote: yes, but this could be a new PIC mode that uses a new better PIC mode for everything. Especially one that doesn't require each function to calculate the GOT address

Re: %pc relative addressing of string literals/const data

2010-10-09 Thread Joakim Tjernlund
Michael Meissner meiss...@linux.vnet.ibm.com wrote on 2010/10/07 20:21:38: On Thu, Oct 07, 2010 at 04:50:50PM +0200, Joakim Tjernlund wrote: Why not offer some of this on PowerPC32? mcmodel=small would probably be enough. Well as they say, contributions are welcome. Note, 32-bit mode

Re: %pc relative addressing of string literals/const data

2010-10-07 Thread Michael Meissner
On Tue, Oct 05, 2010 at 11:56:55AM -0700, Richard Henderson wrote: On 10/05/2010 06:54 AM, Joakim Tjernlund wrote: Ian Lance Taylor i...@google.com wrote on 2010/10/05 15:47:38: Joakim Tjernlund joakim.tjernl...@transmode.se writes: While doing relocation work on u-boot I often whish for

Re: %pc relative addressing of string literals/const data

2010-10-07 Thread Joakim Tjernlund
Richard Henderson r...@redhat.com wrote on 2010/10/06 00:13:22: On 10/05/2010 02:40 PM, Joakim Tjernlund wrote: Especially one that doesn't require each function to calculate the GOT address in the function prologue(why is that so?) Because PIC code can be called from non-PIC code and

Re: %pc relative addressing of string literals/const data

2010-10-07 Thread Joakim Tjernlund
Michael Meissner meiss...@linux.vnet.ibm.com wrote on 2010/10/07 15:00:25: On Tue, Oct 05, 2010 at 11:56:55AM -0700, Richard Henderson wrote: On 10/05/2010 06:54 AM, Joakim Tjernlund wrote: Ian Lance Taylor i...@google.com wrote on 2010/10/05 15:47:38: Joakim Tjernlund

Re: %pc relative addressing of string literals/const data

2010-10-07 Thread Michael Meissner
On Thu, Oct 07, 2010 at 04:50:50PM +0200, Joakim Tjernlund wrote: Why not offer some of this on PowerPC32? mcmodel=small would probably be enough. Well as they say, contributions are welcome. Note, 32-bit mode doesn't need this when compiling for the main program, since it does addis/addi

Re: %pc relative addressing of string literals/const data

2010-10-07 Thread Joakim Tjernlund
Michael Meissner meiss...@linux.vnet.ibm.com wrote on 2010/10/07 20:21:38: On Thu, Oct 07, 2010 at 04:50:50PM +0200, Joakim Tjernlund wrote: Why not offer some of this on PowerPC32? mcmodel=small would probably be enough. Well as they say, contributions are welcome. Note, 32-bit mode

Re: %pc relative addressing of string literals/const data

2010-10-06 Thread Joakim Tjernlund
Alan Modra amo...@gmail.com wrote on 2010/10/06 00:19:26: On Tue, Oct 05, 2010 at 11:40:11PM +0200, Joakim Tjernlund wrote: yes, but this could be a new PIC mode that uses a new better PIC mode for everything. Especially one that doesn't require each function to calculate the GOT address

Re: %pc relative addressing of string literals/const data

2010-10-06 Thread Gabriel Paubert
On Tue, Oct 05, 2010 at 10:55:36PM +0200, Joakim Tjernlund wrote: Richard Henderson r...@redhat.com wrote on 2010/10/05 20:56:55: On 10/05/2010 06:54 AM, Joakim Tjernlund wrote: Ian Lance Taylor i...@google.com wrote on 2010/10/05 15:47:38: Joakim Tjernlund joakim.tjernl...@transmode.se

Re: %pc relative addressing of string literals/const data

2010-10-06 Thread Joakim Tjernlund
Gabriel Paubert paub...@iram.es wrote on 2010/10/06 10:15:26: On Tue, Oct 05, 2010 at 10:55:36PM +0200, Joakim Tjernlund wrote: Richard Henderson r...@redhat.com wrote on 2010/10/05 20:56:55: On 10/05/2010 06:54 AM, Joakim Tjernlund wrote: Ian Lance Taylor i...@google.com wrote on

Re: %pc relative addressing of string literals/const data

2010-10-06 Thread Ian Lance Taylor
Joakim Tjernlund joakim.tjernl...@transmode.se writes: I really wish mrelocatable is added to all archs. The normal ELF relocs are too big to fit well in u-boot. Every architecture is different and requires a thoughtful approach to determine the best way to handle these issues for that

Re: %pc relative addressing of string literals/const data

2010-10-06 Thread Matt Thomas
On Oct 6, 2010, at 6:52 AM, Ian Lance Taylor wrote: Joakim Tjernlund joakim.tjernl...@transmode.se writes: I really wish mrelocatable is added to all archs. The normal ELF relocs are too big to fit well in u-boot. Every architecture is different and requires a thoughtful approach to

%pc relative addressing of string literals/const data

2010-10-05 Thread Joakim Tjernlund
While doing relocation work on u-boot I often whish for strings/const data to be accessible through %pc relative address rather than and ABS address or through GOT. Has this feature ever been considered by gcc? Jocke

Re: %pc relative addressing of string literals/const data

2010-10-05 Thread Ian Lance Taylor
Joakim Tjernlund joakim.tjernl...@transmode.se writes: While doing relocation work on u-boot I often whish for strings/const data to be accessible through %pc relative address rather than and ABS address or through GOT. Has this feature ever been considered by gcc? The feature can only be

Re: %pc relative addressing of string literals/const data

2010-10-05 Thread Joakim Tjernlund
Ian Lance Taylor i...@google.com wrote on 2010/10/05 15:47:38: Joakim Tjernlund joakim.tjernl...@transmode.se writes: While doing relocation work on u-boot I often whish for strings/const data to be accessible through %pc relative address rather than and ABS address or through GOT. Has

Re: %pc relative addressing of string literals/const data

2010-10-05 Thread Richard Henderson
On 10/05/2010 06:54 AM, Joakim Tjernlund wrote: Ian Lance Taylor i...@google.com wrote on 2010/10/05 15:47:38: Joakim Tjernlund joakim.tjernl...@transmode.se writes: While doing relocation work on u-boot I often whish for strings/const data to be accessible through %pc relative address rather

Re: %pc relative addressing of string literals/const data

2010-10-05 Thread Richard Henderson
On 10/05/2010 01:55 PM, Joakim Tjernlund wrote: I don't do x86 or alpha so let me ask: If you run the code on an address != link address, will it do the right thing? Yes of course. It wouldn't be -fpic code otherwise. I tested the #pragma/no #pragma on PPC and the resulting code was the

Re: %pc relative addressing of string literals/const data

2010-10-05 Thread Joakim Tjernlund
Richard Henderson r...@redhat.com wrote on 2010/10/05 23:12:19: On 10/05/2010 01:55 PM, Joakim Tjernlund wrote: I don't do x86 or alpha so let me ask: If you run the code on an address != link address, will it do the right thing? Yes of course. It wouldn't be -fpic code otherwise. Just

Re: %pc relative addressing of string literals/const data

2010-10-05 Thread Richard Henderson
On 10/05/2010 02:40 PM, Joakim Tjernlund wrote: Especially one that doesn't require each function to calculate the GOT address in the function prologue(why is that so?) Because PIC code can be called from non-PIC code and because the non-PIC code does not load the GOT address. Avoiding

Re: %pc relative addressing of string literals/const data

2010-10-05 Thread Alan Modra
On Tue, Oct 05, 2010 at 11:40:11PM +0200, Joakim Tjernlund wrote: yes, but this could be a new PIC mode that uses a new better PIC mode for everything. Especially one that doesn't require each function to calculate the GOT address in the function prologue(why is that so?) The ppc32 ABI is old,