Commit b9cfa55
committed
[X86][LLD] Handle R_X86_64_CODE_6_GOTTPOFF relocation type
For
add %reg1, name@GOTTPOFF(%rip), %reg2
add name@GOTTPOFF(%rip), %reg1, %reg2
{nf} add %reg1, name@GOTTPOFF(%rip), %reg2
{nf} add name@GOTTPOFF(%rip), %reg1, %reg2
{nf} add name@GOTTPOFF(%rip), %reg
add
R_X86_64_CODE_6_GOTTPOFF = 50
in #117277.
Linker can treat R_X86_64_CODE_6_GOTTPOFF as R_X86_64_GOTTPOFF or convert the
instructions above to
add $name@tpoff, %reg1, %reg2
add $name@tpoff, %reg1, %reg2
{nf} add $name@tpoff, %reg1, %reg2
{nf} add $name@tpoff, %reg1, %reg2
{nf} add $name@tpoff, %reg
if the first byte of the instruction at the relocation offset - 6 is 0x62
(namely, encoded w/EVEX prefix) when possible.
Binutils patch: bminor/binutils-gdb@5bc71c2
Binutils mailthread: https://sourceware.org/pipermail/binutils/2024-February/132351.html
ABI discussion: https://groups.google.com/g/x86-64-abi/c/FhEZjCtDLFw/m/VHDjN4orAgAJ
Blog: https://kanrobert.github.io/rfc/All-about-APX-relocation1 parent fad5ed6 commit b9cfa55
2 files changed
+43
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
| 404 | + | |
404 | 405 | | |
405 | 406 | | |
406 | 407 | | |
| |||
562 | 563 | | |
563 | 564 | | |
564 | 565 | | |
565 | | - | |
566 | | - | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
567 | 569 | | |
568 | 570 | | |
569 | 571 | | |
| |||
623 | 625 | | |
624 | 626 | | |
625 | 627 | | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
626 | 648 | | |
627 | 649 | | |
628 | 650 | | |
| |||
782 | 804 | | |
783 | 805 | | |
784 | 806 | | |
| 807 | + | |
785 | 808 | | |
786 | 809 | | |
787 | 810 | | |
| |||
893 | 916 | | |
894 | 917 | | |
895 | 918 | | |
| 919 | + | |
896 | 920 | | |
897 | 921 | | |
898 | 922 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
29 | 37 | | |
30 | 38 | | |
31 | 39 | | |
| |||
82 | 90 | | |
83 | 91 | | |
84 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
85 | 102 | | |
86 | 103 | | |
87 | 104 | | |
| |||
0 commit comments