[PATCH v3] i386: Prefer PLT indirection for __fentry__ calls under -fPIC

2025-04-10 Thread Ard Biesheuvel
From: Ard Biesheuvel Commit bde21de1205 ("i386: Honour -mdirect-extern-access when calling __fentry__") updated the logic that emits mcount() / __fentry__() calls into function prologues when profiling is enabled, to avoid GOT-based indirect calls when a direct call would suffice. There are two

Re: [PATCH v3] i386: Prefer PLT indirection for __fentry__ calls under -fPIC

2025-04-10 Thread Ard Biesheuvel
On Wed, 9 Apr 2025 at 09:12, Uros Bizjak wrote: > > On Tue, Apr 8, 2025 at 6:59 PM Ard Biesheuvel wrote: > > > > On Tue, 8 Apr 2025 at 18:44, H.J. Lu wrote: > > > > > > On Tue, Apr 8, 2025 at 9:39 AM Ard Biesheuvel wrote: > > > > > > > > On Tue, 8 Apr 2025 at 15:33, H.J. Lu wrote: > > > > > >

Re: [PATCH v3] i386: Prefer PLT indirection for __fentry__ calls under -fPIC

2025-04-09 Thread Ard Biesheuvel
On Tue, 8 Apr 2025 at 15:33, H.J. Lu wrote: > > On Tue, Apr 8, 2025 at 3:46 AM Ard Biesheuvel wrote: > > > > From: Ard Biesheuvel > > > > Commit bde21de1205 ("i386: Honour -mdirect-extern-access when calling > > __fentry__") updated the logic that emits mcount() / __fentry__() calls > > into fun

Re: [PATCH v3] i386: Prefer PLT indirection for __fentry__ calls under -fPIC

2025-04-09 Thread Uros Bizjak
On Tue, Apr 8, 2025 at 7:09 PM H.J. Lu wrote: > > Are there any existing test cases I should look at? > > Please see "gcc.target/i386/pr67215-*.c" While looking there, I noticed that the asterisk is not correctly escaped in scan strings. Asterisk in [...]* applies to square brackets, not scan st

Re: [PATCH v3] i386: Prefer PLT indirection for __fentry__ calls under -fPIC

2025-04-09 Thread Uros Bizjak
On Tue, Apr 8, 2025 at 6:59 PM Ard Biesheuvel wrote: > > On Tue, 8 Apr 2025 at 18:44, H.J. Lu wrote: > > > > On Tue, Apr 8, 2025 at 9:39 AM Ard Biesheuvel wrote: > > > > > > On Tue, 8 Apr 2025 at 15:33, H.J. Lu wrote: > > > > > > > > On Tue, Apr 8, 2025 at 3:46 AM Ard Biesheuvel > > > > wrote

Re: [PATCH v3] i386: Prefer PLT indirection for __fentry__ calls under -fPIC

2025-04-08 Thread Ard Biesheuvel
On Tue, 8 Apr 2025 at 18:44, H.J. Lu wrote: > > On Tue, Apr 8, 2025 at 9:39 AM Ard Biesheuvel wrote: > > > > On Tue, 8 Apr 2025 at 15:33, H.J. Lu wrote: > > > > > > On Tue, Apr 8, 2025 at 3:46 AM Ard Biesheuvel wrote: > > > > > > > > From: Ard Biesheuvel > > > > > > > > Commit bde21de1205 ("i3

Re: [PATCH v3] i386: Prefer PLT indirection for __fentry__ calls under -fPIC

2025-04-08 Thread H.J. Lu
On Tue, Apr 8, 2025 at 9:59 AM Ard Biesheuvel wrote: > > On Tue, 8 Apr 2025 at 18:44, H.J. Lu wrote: > > > > On Tue, Apr 8, 2025 at 9:39 AM Ard Biesheuvel wrote: > > > > > > On Tue, 8 Apr 2025 at 15:33, H.J. Lu wrote: > > > > > > > > On Tue, Apr 8, 2025 at 3:46 AM Ard Biesheuvel > > > > wrote

Re: [PATCH v3] i386: Prefer PLT indirection for __fentry__ calls under -fPIC

2025-04-08 Thread H.J. Lu
On Tue, Apr 8, 2025 at 9:39 AM Ard Biesheuvel wrote: > > On Tue, 8 Apr 2025 at 15:33, H.J. Lu wrote: > > > > On Tue, Apr 8, 2025 at 3:46 AM Ard Biesheuvel wrote: > > > > > > From: Ard Biesheuvel > > > > > > Commit bde21de1205 ("i386: Honour -mdirect-extern-access when calling > > > __fentry__")

Re: [PATCH v3] i386: Prefer PLT indirection for __fentry__ calls under -fPIC

2025-04-08 Thread H.J. Lu
On Tue, Apr 8, 2025 at 3:46 AM Ard Biesheuvel wrote: > > From: Ard Biesheuvel > > Commit bde21de1205 ("i386: Honour -mdirect-extern-access when calling > __fentry__") updated the logic that emits mcount() / __fentry__() calls > into function prologues when profiling is enabled, to avoid GOT-based

Re: [PATCH v3] i386: Prefer PLT indirection for __fentry__ calls under -fPIC

2025-04-08 Thread Michael Matz
Hey, On Tue, 8 Apr 2025, Uros Bizjak wrote: > > From: Ard Biesheuvel > > > > Commit bde21de1205 ("i386: Honour -mdirect-extern-access when calling > > __fentry__") updated the logic that emits mcount() / __fentry__() calls > > into function prologues when profiling is enabled, to avoid GOT-based

Re: [PATCH v3] i386: Prefer PLT indirection for __fentry__ calls under -fPIC

2025-04-08 Thread Uros Bizjak
On Tue, Apr 8, 2025 at 12:47 PM Ard Biesheuvel wrote: > > From: Ard Biesheuvel > > Commit bde21de1205 ("i386: Honour -mdirect-extern-access when calling > __fentry__") updated the logic that emits mcount() / __fentry__() calls > into function prologues when profiling is enabled, to avoid GOT-base