etc:users:jcmvbkbc:binutils-xtensa
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
etc:users:jcmvbkbc:binutils-xtensa [2024/02/24 20:38] – add TLS LD sequence jcmvbkbc | etc:users:jcmvbkbc:binutils-xtensa [2024/03/18 14:47] (current) – jcmvbkbc | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== binutils support for Xtensa ===== | + | ====== binutils support for Xtensa |
* git tree: https:// | * git tree: https:// | ||
- | ==== FDPIC support ==== | + | ===== FDPIC support |
* [+] static linking | * [+] static linking | ||
Line 9: | Line 9: | ||
* [+] PIE | * [+] PIE | ||
* [±] PLT and lazy binding | * [±] PLT and lazy binding | ||
- | * [-] TLS | + | * [+] TLS |
- | ==== FDPIC instruction sequences ==== | + | ===== FDPIC instruction sequences |
- | === Local call ==== | + | ==== Local call ==== |
Default local call | Default local call | ||
Line 44: | Line 44: | ||
</ | </ | ||
- | === PLT call ==== | + | ==== PLT call ==== |
Obvious version: | Obvious version: | ||
Line 73: | Line 73: | ||
</ | </ | ||
that reduces the inline part from 14 to 5 bytes, but adds two jumps to each call and some special logic to the resolver to avoid name resolution on each call. | that reduces the inline part from 14 to 5 bytes, but adds two jumps to each call and some special logic to the resolver to avoid name resolution on each call. | ||
+ | |||
+ | ==== TLS Support ==== | ||
=== TLS General Dynamic === | === TLS General Dynamic === | ||
Line 78: | Line 80: | ||
< | < | ||
+0: | +0: | ||
- | +3: | + | +3: |
- | +5: | + | +5: |
- | +7: | + | +7: |
- | +9: l32i | + | +9: _l32i tmp3, tmp2, 0 # TLS_FUNC |
- | +11: callx0 | + | +12: callx0 |
</ | </ | ||
Line 89: | Line 91: | ||
=== TLS Local Dynamic === | === TLS Local Dynamic === | ||
+ | Header getting the address of the _TLS_MODULE_BASE_ is the same as in General Dynamic, or a possible one instruction less version: | ||
< | < | ||
+0: | +0: | ||
+2: | +2: | ||
+4: | +4: | ||
- | +6: l32i | + | +6: _l32i tmp2, tmp1, 0 |
- | +8: | + | +9: |
... | ... | ||
+m: | +m: | ||
- | +m+3: | + | +m+3: |
... | ... | ||
</ | </ | ||
- | _TLS_MODULE_BASE_DESC_OFF is an entry at a small fixed offset (16?) from the GOT base with R_XTENSA_TLSDESC(_TLS_MODULE_BASE_) relocation against it. | + | _TLS_MODULE_BASE_DESC_OFF is a small fixed offset (16?) from the GOT base where an entry with R_XTENSA_TLSDESC(_TLS_MODULE_BASE_) relocation against it is placed. |
+ | |||
+ | === TLS Initial Exec === | ||
+ | |||
+ | < | ||
+ | +0: | ||
+ | +3: | ||
+ | +5: | ||
+ | +7: | ||
+ | +10: add res, tmp3, tmp4 | ||
+ | </ | ||
+ | |||
+ | === TLS Local Exec === | ||
+ | |||
+ | < | ||
+ | +0: | ||
+ | +3: | ||
+ | +6: | ||
+ | </ | ||
+ | |||
+ | ==== Linker optimizations ==== | ||
+ | |||
+ | === General Dynamic -> Initial Exec === | ||
+ | |||
+ | < | ||
+ | +0: | ||
+ | +3: | ||
+ | +5: | ||
+ | +7: | ||
+ | +9: | ||
+ | +12: callx0 | ||
+ | </ | ||
+ | |||
+ | === General Dynamic -> Local Exec === | ||
+ | |||
+ | < | ||
+ | +0: | ||
+ | +3: | ||
+ | +5: | ||
+ | +7: | ||
+ | +9: | ||
+ | +12: callx0 | ||
+ | </ | ||
+ | |||
+ | === Initial Exec -> Local Exec === | ||
+ | |||
+ | < | ||
+ | +0: | ||
+ | +3: | ||
+ | +5: | ||
+ | +7: | ||
+ | +10: add res, tmp3, tmp4 | ||
+ | </ | ||
==== Manual toolchain building script ==== | ==== Manual toolchain building script ==== |
etc/users/jcmvbkbc/binutils-xtensa.1708796320.txt.gz · Last modified: 2024/02/24 20:38 by jcmvbkbc