This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: [gold patch] PR 17643: Add -z bndplt support (for Intel MPX)


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.


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