https://sourceware.org/bugzilla/show_bug.cgi?id=17643

            Bug ID: 17643
           Summary: [x86-64] missing -z bndplt support
           Product: binutils
           Version: 2.26 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gold
          Assignee: ccoutant at google dot com
          Reporter: hjl.tools at gmail dot com
                CC: ian at airs dot com

For Intel MPX, R_X86_64_*_BND relocations are not enough in case of
indirect calls like:

foo:
         movq    fp@GOTPCREL(%rip), %rax
         bnd jmp     *(%rax)
         .globl  fp
         .section        .data.rel,"aw",@progbits
         .align 8
         .type   fp, @object
         .size   fp, 8
 fp:
         .quad   memcpy

There will be no R_X86_64_*_BND relocation but anyway linker needs to
generate extended PLT entry for memcpy.

A linker option (-z bndplt) is needed to create PLT entry with BND prefix for
all external branches and GCC will pass this option to linker for -mmpx.  The
-z bndplt is implemented in bfd ld:

https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=d258b828287a863376af60a1ef7ceafbccc83d93

and the PLT entry example with BND prefix can be found at:

https://github.com/hjl-tools/x86-64-psABI/tree/hjl/mpx/master

-- 
You are receiving this mail because:
You are on the CC list for the bug.

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to