This is the mail archive of the 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]

[gold patch] PR 17643: Add -z bndplt support (for Intel MPX)


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?

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.

Roland, I haven't done anything with the nacl port, because I wasn't
sure what to do there, or even if it makes sense to support bndplt.


2016-12-15  Cary Coutant  <>

        PR gold/17643
        * options.h (-z bndplt): New option.
        * (Output_data_plt_x86_64::regular_count): New method.
        (Output_data_plt_x86_64::address_for_global): Move implementation into
        virtual method.
        (Output_data_plt_x86_64::address_for_local): Likewise.
        (Output_data_plt_x86_64::got): New method.
        (Output_data_plt_x86_64::got_plt): New method.
        (Output_data_plt_x86_64::got_irelative): New method.
        (Output_data_plt_x86_64::do_address_for_global): New virtual method.
        (Output_data_plt_x86_64::do_address_for_local): New virtual method.
        (class Output_data_plt_x86_64_bnd): New class.
        (Target_x86_64::do_make_data_plt): Move out of line and specialize
        for each size (both overloads).
        (Output_data_plt_x86_64::set_final_data_size): Cosmetic changes.

Attachment: bndplt.patch
Description: Binary data

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