Remove R_X86_64_PC32_BND and R_X86_64_PLT32_BND

27 views
Skip to first unread message

Igor Zamyatin

unread,
Sep 9, 2014, 10:20:09 AM9/9/14
to x86-6...@googlegroups.com
Hi!
 
It is appeared that for 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.
 
We are going to create separate linker option (-z bndplt) which forces linker to create extended PLT entry for any call and also this option will be passed to linker when compilation is in MPX mode.
Thus we can omit R_X86_64_*_BND relocations completely.
 
So we propose to remove generation of these relocations from assembler (but leave their handling in linker for backward compatibility). Also MPX ABI will be changed.
 
Any thougts on this proposition?
 
Thanks,
Igor

Igor Zamyatin

unread,
Nov 10, 2014, 12:13:43 PM11/10/14
to x86-6...@googlegroups.com
Ping!

H.J. Lu

unread,
Nov 10, 2014, 1:22:59 PM11/10/14
to Igor Zamyatin, x86-6...@googlegroups.com
Given that there are no objections. Please update MPX x86-64 psABI:

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

to remove those R_X86_64_*_BND relocations. Please mark
relocation numbers 39 and 40 reserved so that they won't be
reused in the future for other purposes.

Thanks.

--
H.J.

H.J. Lu

unread,
Nov 11, 2014, 12:56:55 PM11/11/14
to Igor Zamyatin, x86-6...@googlegroups.com
I updated hjl/mpx/master:

commit 7324f75b41b095d1a2d3b3a9020094e2675ae21e
Author: H.J. Lu <hjl....@gmail.com>
Date: Tue Nov 11 09:53:21 2014 -0800

Remove R_X86_64_PC32_BND and R_X86_64_PLT32_BND

Specify that branches in all BND procedure linkage table entries must have
the BFD prefix to support indirect branches with the BND prefix. Mark
relocation numbers 39 and 40 as reserved so that they won't used for
other purposes.

Igor, please submit your binutils patch.

Thanks.


H.J.
Reply all
Reply to author
Forward
0 new messages