This patch optimize the GOTPCRELX Reloations, which is described in X86-64 psabi chapter B.2. And Not all optimization of this chapter is implemented.
- Convert call and jmp has been implemented
- Convert mov, but the optimization that when the symbol is defined in the lower 32-bit address space, memory operand in mov can be convertted into immediate operand has not been implemented.
- Conver Test and Binop has not been implemented.
The new test file named ELF_got_plt_optimizations.s has been added, and I moved some test cases about optimization of got/plt from ELF_x86_64_small_pic_relocations.s to the new test file.
By referencing the lld, so, the optimization Convert call and jmp is not same as what psabi says, and I have explained it in the comment.
BlockData should be FixupData.
I know that was my name originally, but now that this function is getting more attention we should fix my old mistakes. ;)