This is the mail archive of the
mailing list for the binutils project.
Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, GCC Development <gcc at gcc dot gnu dot org>, Binutils <binutils at sourceware dot org>, "Girkar, Milind" <milind dot girkar at intel dot com>, "Kreitzer, David L" <david dot l dot kreitzer at intel dot com>
- Date: Wed, 24 Jul 2013 12:13:45 -0700
- Subject: Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX
- References: <CAMe9rOp=1v38F_aV-pbv50YOGSEr_ju+byZP1L_G_h4bm5Ad3w at mail dot gmail dot com> <CAKOQZ8y-8Q7f063mM4zKN3QDCLBAqng-9xNVYoARD8uR_K297A at mail dot gmail dot com> <CAMe9rOqJK7qFdkyuKAcnb0xxxj=Yx+73knQ=+RNLr1KP_V7Sew at mail dot gmail dot com> <CAKOQZ8xqfywfxQ+_FN+x9JPCMR6GFy3Z8MFApqJ1OGqWazaSCg at mail dot gmail dot com>
On Wed, Jul 24, 2013 at 11:59 AM, Ian Lance Taylor <email@example.com> wrote:
> On Wed, Jul 24, 2013 at 11:53 AM, H.J. Lu <firstname.lastname@example.org> wrote:
>> On Wed, Jul 24, 2013 at 9:45 AM, Ian Lance Taylor <email@example.com> wrote:
>>> On Tue, Jul 23, 2013 at 12:49 PM, H.J. Lu <firstname.lastname@example.org> wrote:
>>>> 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.
>>> I took a very quick look at the doc. Why shouldn't we run the kernel
>>> with BNDPRESERVE = 1, to avoid this behaviour of clearing the bound
>>> registers on branch instructions? That would let us avoid these
>> This doesn't work in case of legacy callees which return pointers.
>> The bound registers will be incorrect since they are set in the
>> last MPX function. MPX callers will get wrong bounds on
>> pointers returned by legacy callees
> As far as I can see the compiler needs to know the pair of bound
> registers associated with a pointer anyhow. So if the compiler calls
> some function and gets a pointer, it needs to know the bound registers
> that go with that pointer. Are you suggesting that not only are bound
> registers passed as parameters to functions, they are also implicitly
> returned by functions?
Yes, when pointer is returned in register.