Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-10-07 Thread Ilya Enkovich
2013/10/7 Jakub Jelinek : > On Mon, Oct 07, 2013 at 01:31:29PM +0400, Ilya Enkovich wrote: >> Seems assembler may not always detect MPX relocation. For simple calls >> it may check for 'bnd' prefix, but for indirect call we need to >> generate MPX relocation for 'mov' instruction storing address of

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-10-07 Thread Jakub Jelinek
On Mon, Oct 07, 2013 at 01:31:29PM +0400, Ilya Enkovich wrote: > Seems assembler may not always detect MPX relocation. For simple calls > it may check for 'bnd' prefix, but for indirect call we need to > generate MPX relocation for 'mov' instruction storing address of the > called function. This in

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-10-07 Thread Ilya Enkovich
2013/10/2 Ilya Enkovich : > 2013/10/1 Jakub Jelinek : >> On Tue, Oct 01, 2013 at 04:15:53PM +0400, Ilya Enkovich wrote: >>> I'd like to restart discussion on this topic. I see two viable options >>> in this thread for PLT entry for MPX. >>> >>> The first one is to use new relocation for calls requi

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-10-02 Thread Ilya Enkovich
2013/10/1 Jakub Jelinek : > On Tue, Oct 01, 2013 at 04:15:53PM +0400, Ilya Enkovich wrote: >> I'd like to restart discussion on this topic. I see two viable options >> in this thread for PLT entry for MPX. >> >> The first one is to use new relocation for calls requiring extended >> PLT. Linker may

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-10-01 Thread Jakub Jelinek
On Tue, Oct 01, 2013 at 04:15:53PM +0400, Ilya Enkovich wrote: > I'd like to restart discussion on this topic. I see two viable options > in this thread for PLT entry for MPX. > > The first one is to use new relocation for calls requiring extended > PLT. Linker may decide then which PLT entries sh

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-10-01 Thread Ilya Enkovich
Hi all, I'd like to restart discussion on this topic. I see two viable options in this thread for PLT entry for MPX. The first one is to use new relocation for calls requiring extended PLT. Linker may decide then which PLT entries should be extended and use 16 byte entries when possible. The only

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-08-19 Thread H.J. Lu
On Wed, Aug 14, 2013 at 8:49 AM, Jakub Jelinek wrote: > On Tue, Jul 23, 2013 at 12:49:06PM -0700, H.J. Lu wrote: >> There are 2 psABI considerations: >> >> 1. Should PLT entries in all binaries, with and without MPX, be changed >> to 32-byte or just the necessary ones? > > Ugh, please don't.

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-08-14 Thread Jakub Jelinek
On Tue, Jul 23, 2013 at 12:49:06PM -0700, H.J. Lu wrote: > There are 2 psABI considerations: > > 1. Should PLT entries in all binaries, with and without MPX, be changed > to 32-byte or just the necessary ones? Ugh, please don't. > 2. Only branch to PLT entry with BND prefix needs 32-byte P

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-08-12 Thread Jan Beulich
>>> On 09.08.13 at 19:03, "H.J. Lu" wrote: > On Fri, Aug 9, 2013 at 12:08 AM, Jan Beulich wrote: > On 08.08.13 at 18:01, "H.J. Lu" wrote: >>> On Thu, Aug 8, 2013 at 12:19 AM, Jan Beulich wrote: >>> On 08.08.13 at 02:33, "H.J. Lu" wrote: > We use the .gnu_attribute directive to reco

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-08-09 Thread H.J. Lu
On Fri, Aug 9, 2013 at 12:08 AM, Jan Beulich wrote: On 08.08.13 at 18:01, "H.J. Lu" wrote: >> On Thu, Aug 8, 2013 at 12:19 AM, Jan Beulich wrote: >> On 08.08.13 at 02:33, "H.J. Lu" wrote: We use the .gnu_attribute directive to record an object attribute: enum {

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-08-09 Thread Jan Beulich
>>> On 08.08.13 at 18:01, "H.J. Lu" wrote: > On Thu, Aug 8, 2013 at 12:19 AM, Jan Beulich wrote: > On 08.08.13 at 02:33, "H.J. Lu" wrote: >>> We use the .gnu_attribute directive to record an object attribute: >>> >>> enum >>> { >>> Tag_GNU_X86_EXTERN_BRANCH = 4, >>> }; >>> >>> for the type

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-08-08 Thread H.J. Lu
On Thu, Aug 8, 2013 at 12:19 AM, Jan Beulich wrote: On 08.08.13 at 02:33, "H.J. Lu" wrote: >> We use the .gnu_attribute directive to record an object attribute: >> >> enum >> { >> Tag_GNU_X86_EXTERN_BRANCH = 4, >> }; >> >> for the types of external branch instructions in relocatable files.

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-08-08 Thread Jan Beulich
>>> On 08.08.13 at 02:33, "H.J. Lu" wrote: > We use the .gnu_attribute directive to record an object attribute: > > enum > { > Tag_GNU_X86_EXTERN_BRANCH = 4, > }; > > for the types of external branch instructions in relocatable files. > > enum > { > /* All external branch instructions are l

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-08-07 Thread H.J. Lu
Here is the proposal to add Tag_GNU_X86_EXTERN_BRANCH and NT_X86_FEATURE_PLT_BND. Any comments? -- H.J. --- Intel MPX: http://software.intel.com/sites/default/files/319433-015.pdf introduces 4 bound registers, which will be used for parameter passing in x86-64. Bound registers are cleared by

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-07-25 Thread H.J. Lu
On Wed, Jul 24, 2013 at 5:23 PM, Ian Lance Taylor wrote: >> * The foo@plt pseudo-symbols that e.g. objdump will display are based on >> the BFD backend knowing the size of PLT entries. Arguably this ought >> to look at sh_entsize of .plt instead of using baked-in knowledge, but >> it doesn'

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-07-25 Thread H.J. Lu
On Wed, Jul 24, 2013 at 4:36 PM, Roland McGrath wrote: > I've read through the MPX spec once, but most of it is still not very > clear to me. So please correct any misconceptions. (HJ, if you answer > any or all of these questions in your usual style with just, "It's not a > problem," I will fin

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-07-25 Thread H.J. Lu
On Thu, Jul 25, 2013 at 4:08 AM, Ilya Enkovich wrote: > 2013/7/25 Ian Lance Taylor : >> On Wed, Jul 24, 2013 at 4:36 PM, Roland McGrath wrote: >>> >>> Will an MPX-using binary require an MPX-supporting dynamic linker to run >>> correctly? >>> >>> * An old dynamic linker won't clobber %bndN direct

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-07-25 Thread Ilya Enkovich
2013/7/25 Ian Lance Taylor : > On Wed, Jul 24, 2013 at 4:36 PM, Roland McGrath wrote: >> >> Will an MPX-using binary require an MPX-supporting dynamic linker to run >> correctly? >> >> * An old dynamic linker won't clobber %bndN directly, so that's not a >> problem. > > These are my answers and

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-07-24 Thread Ian Lance Taylor
On Wed, Jul 24, 2013 at 4:36 PM, Roland McGrath wrote: > > Will an MPX-using binary require an MPX-supporting dynamic linker to run > correctly? > > * An old dynamic linker won't clobber %bndN directly, so that's not a > problem. These are my answers and likely incorrect. It will clobber the r

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-07-24 Thread Roland McGrath
I've read through the MPX spec once, but most of it is still not very clear to me. So please correct any misconceptions. (HJ, if you answer any or all of these questions in your usual style with just, "It's not a problem," I will find you and I will kill you. Explain!) Will an MPX-using binary

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-07-24 Thread H.J. Lu
On Wed, Jul 24, 2013 at 11:59 AM, Ian Lance Taylor wrote: > On Wed, Jul 24, 2013 at 11:53 AM, H.J. Lu wrote: >> On Wed, Jul 24, 2013 at 9:45 AM, Ian Lance Taylor wrote: >>> On Tue, Jul 23, 2013 at 12:49 PM, H.J. Lu wrote: http://software.intel.com/sites/default/files/319433-015.pdf >>

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-07-24 Thread Ian Lance Taylor
On Wed, Jul 24, 2013 at 11:53 AM, H.J. Lu wrote: > On Wed, Jul 24, 2013 at 9:45 AM, Ian Lance Taylor wrote: >> On Tue, Jul 23, 2013 at 12:49 PM, H.J. Lu wrote: >>> >>> http://software.intel.com/sites/default/files/319433-015.pdf >>> >>> introduces 4 bound registers, which will be used for parame

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-07-24 Thread H.J. Lu
On Wed, Jul 24, 2013 at 9:45 AM, Ian Lance Taylor wrote: > On Tue, Jul 23, 2013 at 12:49 PM, H.J. Lu wrote: >> >> http://software.intel.com/sites/default/files/319433-015.pdf >> >> introduces 4 bound registers, which will be used for parameter passing >> in x86-64. Bound registers are cleared by

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-07-24 Thread Ian Lance Taylor
On Tue, Jul 23, 2013 at 12:49 PM, H.J. Lu wrote: > > http://software.intel.com/sites/default/files/319433-015.pdf > > introduces 4 bound registers, which will be used for parameter passing > in x86-64. Bound registers are cleared by branch instructions. Branch > instructions with BND prefix will

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-07-24 Thread H.J. Lu
On Wed, Jul 24, 2013 at 1:43 AM, Florian Weimer wrote: > On 07/23/2013 09:49 PM, H.J. Lu wrote: >> >> 2. Extend the current 16-byte PLT entry: >> >>ff 25 32 8b 21 00jmpq *name@GOTPCREL(%rip) >>68 00 00 00 00 pushq $index >>e9 00 00 00 00 jmpq PLT0 >>

Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-07-24 Thread Florian Weimer
On 07/23/2013 09:49 PM, H.J. Lu wrote: 2. Extend the current 16-byte PLT entry: ff 25 32 8b 21 00jmpq *name@GOTPCREL(%rip) 68 00 00 00 00 pushq $index e9 00 00 00 00 jmpq PLT0 which clear bound registers, to 32-byte to add BND prefix to branch

[x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX

2013-07-23 Thread H.J. Lu
Intel MPX: http://software.intel.com/sites/default/files/319433-015.pdf introduces 4 bound registers, which will be used for parameter passing in x86-64. Bound registers are cleared by branch instructions. Branch instructions with BND prefix will keep bound register contents. This leads to 2 re