Commit d455ef1
authored
[AAELF64] Allow R_AARCH64_TLS_DTPREL to be used statically. (#330)
Permit the R_AARCH64_TLS_DTPREL dynamic relocation to be used statically
so that debug information can describe the location of TLS variables.
All code sequences to access TLS data use immediates, hence all existing
static TLS relocations are instruction relocations.
To describe the location of a TLS variable in debug information requires
a static data relocation. The necessary expression needed is DTPREL(S +
A) which is performed by the traditional dialect dynamic relocation
R_AARCH64_TLS_DTPREL.
There is prior art in the x86_64 and PPC64 ABIs to use the equivalent
relocation R_X86_64_DTPOFF64 and R_PPC_DTPREL64 respectively for
relocating debug information statically.
We also introduce a syntax for assembler operators operating on data
directives, with an instance %dtprel(expr) to generate R_AARCH64_DTPREL.
The 32-bit Arm ABI uses the R_ARM_TLS_LDO32 static local dynamic
relocation. The advantage of using local dynamic is that these only
apply to a TLS variable local to the module so no additional note is
needed. An alternative design adds a new relocation code to local
dynamic.
fixes: #1761 parent a78fa26 commit d455ef1
2 files changed
+46
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
298 | 301 | | |
299 | 302 | | |
300 | 303 | | |
| |||
1730 | 1733 | | |
1731 | 1734 | | |
1732 | 1735 | | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
1733 | 1757 | | |
1734 | 1758 | | |
1735 | 1759 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
221 | 224 | | |
222 | 225 | | |
223 | 226 | | |
| |||
461 | 464 | | |
462 | 465 | | |
463 | 466 | | |
464 | | - | |
465 | | - | |
| 467 | + | |
| 468 | + | |
466 | 469 | | |
467 | 470 | | |
468 | 471 | | |
| |||
654 | 657 | | |
655 | 658 | | |
656 | 659 | | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
657 | 677 | | |
658 | 678 | | |
659 | 679 | | |
| |||
0 commit comments