[PATCH] D15779: [ELF] - Implemented optimization for R_X86_64_GOTPCREL relocation.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 25 09:16:35 PST 2015
grimar created this revision.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar.
System V Application Binary Interface AMD64 Architecture Processor Supplement Draft Version 0.99.8
(https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-r249.pdf, B.2 "B.2 Optimize GOTPCRELX Relocations")
introduces possible relaxations for GOTPCRELX Relocations.
R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX should be generated instead of R_X86_64_GOTPCREL for places where relaxation is possible.
At the same time nothing stops us from using it right now for R_X86_64_GOTPCREL if we perform additional check of instructions.
Both gold and bfd do the same for R_X86_64_GOTPCREL now.
That patch implements the next relaxation: mov foo at GOTPCREL(%rip), %reg => lea foo(%rip), %reg
Below link is a patch for gold used as reference.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 20557 bytes
Desc: not available
More information about the llvm-commits