This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gold patch] PR 17643: Add -z bndplt support (for Intel MPX)
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Cary Coutant <ccoutant at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>, Roland McGrath <mcgrathr at google dot com>
- Date: Wed, 11 Jan 2017 12:12:01 -0800
- Subject: Re: [gold patch] PR 17643: Add -z bndplt support (for Intel MPX)
- Authentication-results: sourceware.org; auth=none
- References: <CAJimCsGp_9j=Kg0K-MNvD=x7_bTM9-mrZ9+eUqE8wwZhn3Ccgg@mail.gmail.com> <CAMe9rOoyo2PuGr=w5hNdPzicAhJoyEHO8B_ysPhs=v+eiGFgEw@mail.gmail.com>
On Tue, Jan 10, 2017 at 2:03 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Dec 15, 2016 at 5:20 PM, Cary Coutant <ccoutant@gmail.com> wrote:
>> HJ,
>>
>> Here's a preliminary patch to add -z bndplt support to gold. If you
>> could take a look and give it a try, I'd appreciate it. I'm hoping to
>> get this into the 2.28 release.
>>
>> I haven't added any tests yet, and I haven't yet adjusted the EH table
>> descriptors for the new PLT entries. Do you have a spec or a template
>> for what the EH descriptors should look like?
>
> I just noticed that ld generates incorrect unwind info for BND PLT.
>
>> The PLT code seems to match what ld generates (which does not quite
>> match the psABI spec -- see my email on the psABI list), and a basic
>> test program works. I haven't actually run any tests that verify that
>> the BND registers aren't getting cleared, though.
>>
>> Gold adds the APLT into the .plt section rather than creating a new
>> .plt.bnd section, and that seems to be preventing objdump and gdb from
>> correctly symbolizing some of the code, but I'd hope those can be
>> fixed so that they don't depend on having two (or three) separate .plt
>> sections in the executable.
>>
>
> Ld is similar. The difference is there is an entry in section table for
> the second PLT. There is no difference in memory layout.
>
The problems with a single PLT sections are
1. sh_entsize is wrong for APLT:
[ 5] .plt PROGBITS 0000000000000290 000290 000040
10 AX 0 0 16
2. Unwind info is wrong for APLT.
--
H.J.