Relocations to use when eliding plts

2015-05-27 Thread Richard Henderson
There's one problem with the couple of patches that I've seen go by wrt eliding PLTs with -z now, and relaxing inlined PLTs (aka -fno-plt): They're currently using the same relocations used by data, and thus the linker and dynamic linker must ensure that pointer equality is maintained. Which resu

Re: Relocations to use when eliding plts

2015-05-27 Thread H.J. Lu
On Wed, May 27, 2015 at 1:03 PM, Richard Henderson wrote: > There's one problem with the couple of patches that I've seen go by wrt > eliding > PLTs with -z now, and relaxing inlined PLTs (aka -fno-plt): > > They're currently using the same relocations used by data, and thus the linker > and dyna

Re: Relocations to use when eliding plts

2015-05-27 Thread H.J. Lu
On Wed, May 27, 2015 at 1:03 PM, Richard Henderson wrote: > There's one problem with the couple of patches that I've seen go by wrt > eliding > PLTs with -z now, and relaxing inlined PLTs (aka -fno-plt): > > They're currently using the same relocations used by data, and thus the linker > and dyna

Re: Relocations to use when eliding plts

2015-05-28 Thread H.J. Lu
Adding ia32/x86-64 psABI. On Wed, May 27, 2015 at 5:44 PM, H.J. Lu wrote: > On Wed, May 27, 2015 at 1:03 PM, Richard Henderson wrote: >> There's one problem with the couple of patches that I've seen go by wrt >> eliding >> PLTs with -z now, and relaxing inlined PLTs (aka -fno-plt): >> >> They'r

Re: Relocations to use when eliding plts

2015-05-28 Thread Richard Henderson
On 05/28/2015 04:27 AM, H.J. Lu wrote: > You get consecutive jmpq's because x86 PLT entry is used as the > canonical function address. If you compile main with -fno-plt -fPIE, you > get: Well, duh. If the main executable has no PLTs, they aren't used as the canonical function address. Surely yo

Re: Relocations to use when eliding plts

2015-05-28 Thread H.J. Lu
On Thu, May 28, 2015 at 8:29 AM, Richard Henderson wrote: > On 05/28/2015 04:27 AM, H.J. Lu wrote: >> You get consecutive jmpq's because x86 PLT entry is used as the >> canonical function address. If you compile main with -fno-plt -fPIE, you >> get: > > Well, duh. If the main executable has no P

Re: Relocations to use when eliding plts

2015-05-28 Thread Richard Henderson
On 05/28/2015 08:42 AM, H.J. Lu wrote: > On Thu, May 28, 2015 at 8:29 AM, Richard Henderson wrote: >> On 05/28/2015 04:27 AM, H.J. Lu wrote: >>> You get consecutive jmpq's because x86 PLT entry is used as the >>> canonical function address. If you compile main with -fno-plt -fPIE, you >>> get: >>

Re: Relocations to use when eliding plts

2015-05-28 Thread Jakub Jelinek
On Thu, May 28, 2015 at 08:52:28AM -0700, Richard Henderson wrote: > On 05/28/2015 08:42 AM, H.J. Lu wrote: > > On Thu, May 28, 2015 at 8:29 AM, Richard Henderson wrote: > >> On 05/28/2015 04:27 AM, H.J. Lu wrote: > >>> You get consecutive jmpq's because x86 PLT entry is used as the > >>> canonica

Re: Relocations to use when eliding plts

2015-05-28 Thread H.J. Lu
On Thu, May 28, 2015 at 9:02 AM, Jakub Jelinek wrote: > On Thu, May 28, 2015 at 08:52:28AM -0700, Richard Henderson wrote: >> On 05/28/2015 08:42 AM, H.J. Lu wrote: >> > On Thu, May 28, 2015 at 8:29 AM, Richard Henderson wrote: >> >> On 05/28/2015 04:27 AM, H.J. Lu wrote: >> >>> You get consecuti

Re: Relocations to use when eliding plts

2015-05-28 Thread Rich Felker
On Thu, May 28, 2015 at 08:29:31AM -0700, Richard Henderson wrote: > On 05/28/2015 04:27 AM, H.J. Lu wrote: > > You get consecutive jmpq's because x86 PLT entry is used as the > > canonical function address. If you compile main with -fno-plt -fPIE, you > > get: > > Well, duh. If the main executa

Re: Relocations to use when eliding plts

2015-05-28 Thread Richard Henderson
On 05/28/2015 10:59 AM, Rich Felker wrote: Am I missing something? You're not missing anything. But do you want the performance of a library to depend on how the main executable is compiled? r~

Re: Relocations to use when eliding plts

2015-05-28 Thread Rich Felker
On Thu, May 28, 2015 at 11:41:10AM -0700, Richard Henderson wrote: > On 05/28/2015 10:59 AM, Rich Felker wrote: > >Am I missing something? > > You're not missing anything. But do you want the performance of a > library to depend on how the main executable is compiled? Not directly. But I'd rathe

Re: Relocations to use when eliding plts

2015-05-28 Thread Jakub Jelinek
On Thu, May 28, 2015 at 03:29:02PM -0400, Rich Felker wrote: > > You're not missing anything. But do you want the performance of a > > library to depend on how the main executable is compiled? > > Not directly. But I'd rather be in that situation than have > pessimizations in library codegen to a

Re: Relocations to use when eliding plts

2015-05-28 Thread Rich Felker
On Thu, May 28, 2015 at 09:40:57PM +0200, Jakub Jelinek wrote: > On Thu, May 28, 2015 at 03:29:02PM -0400, Rich Felker wrote: > > > You're not missing anything. But do you want the performance of a > > > library to depend on how the main executable is compiled? > > > > Not directly. But I'd rathe

Re: Relocations to use when eliding plts

2015-05-29 Thread Richard Henderson
On 05/28/2015 01:36 PM, Rich Felker wrote: > On Thu, May 28, 2015 at 09:40:57PM +0200, Jakub Jelinek wrote: >> On Thu, May 28, 2015 at 03:29:02PM -0400, Rich Felker wrote: You're not missing anything. But do you want the performance of a library to depend on how the main executable is co

Re: Relocations to use when eliding plts

2015-05-29 Thread H.J. Lu
On Fri, May 29, 2015 at 8:38 AM, Richard Henderson wrote: > On 05/28/2015 01:36 PM, Rich Felker wrote: >> On Thu, May 28, 2015 at 09:40:57PM +0200, Jakub Jelinek wrote: >>> On Thu, May 28, 2015 at 03:29:02PM -0400, Rich Felker wrote: > You're not missing anything. But do you want the performa

Re: Relocations to use when eliding plts

2015-05-29 Thread H.J. Lu
On Fri, May 29, 2015 at 10:59 AM, H.J. Lu wrote: > On Fri, May 29, 2015 at 8:38 AM, Richard Henderson wrote: >> On 05/28/2015 01:36 PM, Rich Felker wrote: >>> On Thu, May 28, 2015 at 09:40:57PM +0200, Jakub Jelinek wrote: On Thu, May 28, 2015 at 03:29:02PM -0400, Rich Felker wrote: >> Yo