Request for a new relaxed relocation type for Basic Block Section jumps

H.J. Lu hjl.tools@gmail.com
Tue Jan 1 00:00:00 GMT 2019


On Wed, Nov 6, 2019 at 9:56 AM Sriraman Tallam <tmsriram@google.com> wrote:
>
> Hello H.J.,
>
>     We are looking at supporting Basic Block Sections in the compiler (LLVM for now) similar to function and data sections, please see our RFC here: http://lists.llvm.org/pipermail/llvm-dev/2019-September/135393.html  In order to support basic block sections, the compiler needs to generate unconditional branches between basic blocks that would otherwise be a fall through.  Further, all inter-basic block branches have to use relocations to allow the linker to arbitrarily reorder basic blocks.
>
>    We relax these branches in the linker by eliminating fall throughs after reordering the basic blocks.  Using a separate relocation type for such relocations would make it really easy to identify and relax these branches. We are doing this by inspecting the opcode bytes of the relocation to check if it is a branch and this is potentially prone to errors. How do we go about adding a new relocation type for this?
>

So you need a new PC relative 32-bit signed relocation for jmp.  Is
this correct?
Can it be simply treated as R_X86_64_PC32 and work correctly?  Can it
be used with
jcc and call?

-- 
H.J.



More information about the Gnu-gabi mailing list