mailing list of musl libc
 help / color / mirror / code / Atom feed
74e7a37e3c6928f69e6ca15ec27d874be854ebe1 blob 1002 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
 
.text
.global __tlsdesc_static
.hidden __tlsdesc_static
.type __tlsdesc_static,%function
__tlsdesc_static:
    ld.d $a0, $a0, 8
    jr $ra
# size_t __tlsdesc_dynamic(size_t *a)
# {
#      struct {size_t modidx,off;} *p = (void*)a[1];
#      size_t *dtv = *(size_t**)(tp - 8);
#      return dtv[p->modidx] + p->off - tp;
# }
.global __tlsdesc_dynamic
.hidden __tlsdesc_dynamic
.type __tlsdesc_dynamic,%function
__tlsdesc_dynamic:
    addi.d $sp, $sp, -16
    st.d $t1, $sp, 0
    st.d $t2, $sp, 8

    ld.d $t2, $tp, -8 # t2=dtv

    ld.d $a0, $a0, 8  # a0=&{modidx,off}
    ld.d $t1, $a0, 8  # t1=off
    ld.d $a0, $a0, 0  # a0=modidx
    slli.d $a0, $a0, 3  # a0=8*modidx

    add.d $a0, $a0, $t2  # a0=dtv+8*modidx
    ld.d $a0, $a0, 0  # a0=dtv[modidx]
    add.d $a0, $a0, $t1 # a0=dtv[modidx]+off
    sub.d $a0, $a0, $tp # a0=dtv[modidx]+off-tp

    ld.d $t1, $sp, 0
    ld.d $t2, $sp, 8
    addi.d $sp, $sp, 16
    jr $ra
debug log:

solving 4b6ea0e5 ...
found 4b6ea0e5 in https://inbox.vuxu.org/musl/6033018e-ebbb-a91f-fc54-8c655f127e02@loongson.cn/ ||
	https://inbox.vuxu.org/musl/20240910011533.1419388-1-lixing@loongson.cn/

applying [1/2] https://inbox.vuxu.org/musl/6033018e-ebbb-a91f-fc54-8c655f127e02@loongson.cn/
diff --git a/src/ldso/loongarch64/tlsdesc.s b/src/ldso/loongarch64/tlsdesc.s
new file mode 100644
index 00000000..4b6ea0e5

Checking patch src/ldso/loongarch64/tlsdesc.s...
Applied patch src/ldso/loongarch64/tlsdesc.s cleanly.

skipping https://inbox.vuxu.org/musl/20240910011533.1419388-1-lixing@loongson.cn/ for 4b6ea0e5
index at:
100644 74e7a37e3c6928f69e6ca15ec27d874be854ebe1	src/ldso/loongarch64/tlsdesc.s

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).