Re: PING: [PATCH] x86: Force __x86_indirect_thunk_reg for function call via GOT

2018-03-20 Thread H.J. Lu
On Tue, Mar 20, 2018 at 7:48 AM, Jan Hubicka wrote: >> On Tue, Feb 27, 2018 at 11:39 AM, H.J. Lu wrote: >> > For x86 targets, when -fno-plt is used, external functions are called >> > via GOT slot, in 64-bit mode: >> > >> > [bnd] call/jmp *foo@GOTPCREL(%rip) >> > >> > and in 32-bit mode:

Re: PING: [PATCH] x86: Force __x86_indirect_thunk_reg for function call via GOT

2018-03-20 Thread Jan Hubicka
> On Tue, Feb 27, 2018 at 11:39 AM, H.J. Lu wrote: > > For x86 targets, when -fno-plt is used, external functions are called > > via GOT slot, in 64-bit mode: > > > > [bnd] call/jmp *foo@GOTPCREL(%rip) > > > > and in 32-bit mode: > > > > [bnd] call/jmp *foo@GOT[(%reg)] > > > > With

Re: PING^3: [PATCH] x86: Force __x86_indirect_thunk_reg for function call via GOT

2018-03-15 Thread H.J. Lu
On Thu, Mar 15, 2018 at 2:03 PM, Jan Hubicka wrote: >> >> >>> in ix86_output_indirect_branch. Since this is performed during RTL >> >> >>> expansion, other instructions may be inserted between movl and >> >> >>> call/jmp. >> >> >>> Linker optimization isn't always possible. >> > >> > I suppose w

Re: PING^3: [PATCH] x86: Force __x86_indirect_thunk_reg for function call via GOT

2018-03-15 Thread Jan Hubicka
> >> >>> in ix86_output_indirect_branch. Since this is performed during RTL > >> >>> expansion, other instructions may be inserted between movl and > >> >>> call/jmp. > >> >>> Linker optimization isn't always possible. > > > > I suppose we can just combine those into patterns if we want to preven

Re: PING^3: [PATCH] x86: Force __x86_indirect_thunk_reg for function call via GOT

2018-03-15 Thread H.J. Lu
On Thu, Mar 15, 2018 at 1:41 PM, Jan Hubicka wrote: >> On Sun, Mar 11, 2018 at 7:40 AM, H.J. Lu wrote: >> > On Mon, Mar 5, 2018 at 4:20 AM, H.J. Lu wrote: >> >> On Tue, Feb 27, 2018 at 11:39 AM, H.J. Lu wrote: >> >>> For x86 targets, when -fno-plt is used, external functions are called >> >>> v

Re: PING^3: [PATCH] x86: Force __x86_indirect_thunk_reg for function call via GOT

2018-03-15 Thread Jan Hubicka
> On Sun, Mar 11, 2018 at 7:40 AM, H.J. Lu wrote: > > On Mon, Mar 5, 2018 at 4:20 AM, H.J. Lu wrote: > >> On Tue, Feb 27, 2018 at 11:39 AM, H.J. Lu wrote: > >>> For x86 targets, when -fno-plt is used, external functions are called > >>> via GOT slot, in 64-bit mode: > >>> > >>> [bnd] cal

PING^3: [PATCH] x86: Force __x86_indirect_thunk_reg for function call via GOT

2018-03-15 Thread H.J. Lu
On Sun, Mar 11, 2018 at 7:40 AM, H.J. Lu wrote: > On Mon, Mar 5, 2018 at 4:20 AM, H.J. Lu wrote: >> On Tue, Feb 27, 2018 at 11:39 AM, H.J. Lu wrote: >>> For x86 targets, when -fno-plt is used, external functions are called >>> via GOT slot, in 64-bit mode: >>> >>> [bnd] call/jmp *foo@GOT

PING^2: [PATCH] x86: Force __x86_indirect_thunk_reg for function call via GOT

2018-03-11 Thread H.J. Lu
On Mon, Mar 5, 2018 at 4:20 AM, H.J. Lu wrote: > On Tue, Feb 27, 2018 at 11:39 AM, H.J. Lu wrote: >> For x86 targets, when -fno-plt is used, external functions are called >> via GOT slot, in 64-bit mode: >> >> [bnd] call/jmp *foo@GOTPCREL(%rip) >> >> and in 32-bit mode: >> >> [bnd

PING: [PATCH] x86: Force __x86_indirect_thunk_reg for function call via GOT

2018-03-05 Thread H.J. Lu
On Tue, Feb 27, 2018 at 11:39 AM, H.J. Lu wrote: > For x86 targets, when -fno-plt is used, external functions are called > via GOT slot, in 64-bit mode: > > [bnd] call/jmp *foo@GOTPCREL(%rip) > > and in 32-bit mode: > > [bnd] call/jmp *foo@GOT[(%reg)] > > With -mindirect-branch=, t

[PATCH] x86: Force __x86_indirect_thunk_reg for function call via GOT

2018-02-27 Thread H.J. Lu
For x86 targets, when -fno-plt is used, external functions are called via GOT slot, in 64-bit mode: [bnd] call/jmp *foo@GOTPCREL(%rip) and in 32-bit mode: [bnd] call/jmp *foo@GOT[(%reg)] With -mindirect-branch=, they are converted to, in 64-bit mode: pushq foo@