Commit 3faf3ae
committed
[PPC][BOLT] Compute PPC64 ELFv2 TOC base as .got + 0x8000
According to the ELFv2 ABI, the TOC base register (r2) point to the address .got + 0x8000. This patch computes the correct TOC base when processing PPC64 binaries and uses it to anchor TOC-relative relocations.
This resolves warnings such as:
"ignoring symbol .TOC. at 0x10027f00, which lies outside .got"1 parent 966b070 commit 3faf3ae
File tree
3 files changed
+55
-0
lines changed- bolt
- include/bolt/Rewrite
- lib
- Rewrite
- Target/PowerPC
3 files changed
+55
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
520 | 528 | | |
521 | 529 | | |
522 | 530 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
743 | 743 | | |
744 | 744 | | |
745 | 745 | | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
746 | 759 | | |
747 | 760 | | |
748 | 761 | | |
| |||
2415 | 2428 | | |
2416 | 2429 | | |
2417 | 2430 | | |
| 2431 | + | |
| 2432 | + | |
| 2433 | + | |
| 2434 | + | |
| 2435 | + | |
| 2436 | + | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
| 2441 | + | |
| 2442 | + | |
| 2443 | + | |
| 2444 | + | |
| 2445 | + | |
| 2446 | + | |
2418 | 2447 | | |
2419 | 2448 | | |
2420 | 2449 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
409 | 427 | | |
410 | 428 | | |
411 | 429 | | |
| |||
0 commit comments