This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

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 directly, so that's not a
>>>   problem.
>> These are my answers and likely incorrect.
> Hi,
> I want add some comments to your answers.
>> It will clobber the registers indirectly, though, as soon as it
>> executes a branching instruction.  The effect will be that calls from
>> bnd-checked code to bnd-checked code through the dynamic linker will
>> not succeed.
> I would not say that call will fail. Some bound info will just be
> lost. MPX binaries should still work correctly with old dynamic
> linker. The problem here is that when you decrease level of MPX
> support (use legacy dynamic linker, and legacy libraries) you decrease
> a quality of bound violation detection. BTW if new PLT section is used
> then table fixup after the first call will lead to correct bounds
> transfer in subsequent calls.

To make it clear, the sequence is

MPX code -> PLT -> -> PLT -> MPX library

If doesn't preserve bound registers, bound registers
will be cleared, which means the lower bound is 0 and
upper bound is -1 (MAX), when MPX library is reached.
The MPX library will work correctly, but without MPX
protections on pointers passed in registers.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]