Re: [PATCH] i386: Honour -mdirect-extern-access when calling __fentry__

2023-05-12 Thread Ard Biesheuvel via Gcc-patches
On Fri, 12 May 2023 at 19:05, Uros Bizjak wrote: > > On Fri, May 12, 2023 at 4:07 PM Ard Biesheuvel wrote: > > > > > > > Note that the GOT reference in question is in fact a data > > > > > > reference: we > > > > > > explicitly load the address of __fentry__ from the GOT, which > > > > > > amou

Re: [PATCH] i386: Honour -mdirect-extern-access when calling __fentry__

2023-05-12 Thread Uros Bizjak via Gcc-patches
On Fri, May 12, 2023 at 4:07 PM Ard Biesheuvel wrote: > > > > > Note that the GOT reference in question is in fact a data reference: > > > > > we > > > > > explicitly load the address of __fentry__ from the GOT, which amounts > > > > > to > > > > > eager binding, rather than emitting a PLT call

Re: [PATCH] i386: Honour -mdirect-extern-access when calling __fentry__

2023-05-12 Thread Ard Biesheuvel via Gcc-patches
On Thu, 11 May 2023 at 08:08, Uros Bizjak wrote: > > On Thu, May 11, 2023 at 12:04 AM H.J. Lu wrote: > > > > On Wed, May 10, 2023 at 2:17 AM Uros Bizjak wrote: > > > > > > On Tue, May 9, 2023 at 10:58 AM Ard Biesheuvel wrote: > > > > > > > > The small and medium PIC code models generate profili

Re: [PATCH] i386: Honour -mdirect-extern-access when calling __fentry__

2023-05-10 Thread Uros Bizjak via Gcc-patches
On Thu, May 11, 2023 at 12:04 AM H.J. Lu wrote: > > On Wed, May 10, 2023 at 2:17 AM Uros Bizjak wrote: > > > > On Tue, May 9, 2023 at 10:58 AM Ard Biesheuvel wrote: > > > > > > The small and medium PIC code models generate profiling calls that > > > always load the address of __fentry__() via th

Re: [PATCH] i386: Honour -mdirect-extern-access when calling __fentry__

2023-05-10 Thread H.J. Lu via Gcc-patches
On Wed, May 10, 2023 at 2:17 AM Uros Bizjak wrote: > > On Tue, May 9, 2023 at 10:58 AM Ard Biesheuvel wrote: > > > > The small and medium PIC code models generate profiling calls that > > always load the address of __fentry__() via the GOT, even if > > -mdirect-extern-access is in effect. > > > >

Re: [PATCH] i386: Honour -mdirect-extern-access when calling __fentry__

2023-05-10 Thread Uros Bizjak via Gcc-patches
On Tue, May 9, 2023 at 10:58 AM Ard Biesheuvel wrote: > > The small and medium PIC code models generate profiling calls that > always load the address of __fentry__() via the GOT, even if > -mdirect-extern-access is in effect. > > This deviates from the behavior with respect to other external > re

[PATCH] i386: Honour -mdirect-extern-access when calling __fentry__

2023-05-09 Thread Ard Biesheuvel via Gcc-patches
The small and medium PIC code models generate profiling calls that always load the address of __fentry__() via the GOT, even if -mdirect-extern-access is in effect. This deviates from the behavior with respect to other external references, and results in a longer opcode that relies on linker relax