Checking patch sysdeps/loongarch/dl-machine.h... error: while searching for: { td->arg = _dl_make_tlsdesc_dynamic (sym_map, sym->st_value + reloc->r_addend); td->entry = _dl_tlsdesc_dynamic; } else error: patch failed: sysdeps/loongarch/dl-machine.h:223 error: sysdeps/loongarch/dl-machine.h: patch does not apply Checking patch sysdeps/loongarch/dl-tlsdesc-dynamic.h... error: sysdeps/loongarch/dl-tlsdesc-dynamic.h: already exists in working directory Checking patch sysdeps/loongarch/dl-tlsdesc.S... error: while searching for: cfi_endproc .size _dl_tlsdesc_undefweak, .-_dl_tlsdesc_undefweak #ifdef SHARED #define FRAME_SIZE (-((-14 * SZREG) & ALMASK)) #define FRAME_SIZE_LSX (-((-32 * SZVREG) & ALMASK)) #define FRAME_SIZE_LASX (-((-32 * SZXREG) & ALMASK)) #define FRAME_SIZE_FLOAT (-((-24 * SZFREG) & ALMASK)) /* Handler for dynamic TLS symbols. Prototype: _dl_tlsdesc_dynamic (tlsdesc *) ; The second word of the descriptor points to a tlsdesc_dynamic_arg structure. Returns the offset between the thread pointer and the object referenced by the argument. ptrdiff_t _dl_tlsdesc_dynamic (struct tlsdesc *tdp) { struct tlsdesc_dynamic_arg *td = tdp->arg; dtv_t *dtv = *(dtv_t **)((char *)__thread_pointer - SIZE_OF_TCB); if (__glibc_likely (td->gen_count <= dtv[0].counter && (dtv[td->tlsinfo.ti_module].pointer.val != TLS_DTV_UNALLOCATED), 1)) return dtv[td->tlsinfo.ti_module].pointer.val + td->tlsinfo.ti_offset - __thread_pointer; return ___tls_get_addr (&td->tlsinfo) - __thread_pointer; } */ .hidden _dl_tlsdesc_dynamic .global _dl_tlsdesc_dynamic .type _dl_tlsdesc_dynamic,%function cfi_startproc .align 2 _dl_tlsdesc_dynamic: /* Save just enough registers to support fast path, if we fall into slow path we will save additional registers. */ ADDI sp, sp, -32 REG_S t0, sp, 0 REG_S t1, sp, 8 REG_S t2, sp, 16 /* Runtime Storage Layout of Thread-Local Storage TP point to the start of TLS block. dtv Low address TCB ----------------> dtv0(counter) TP --> static_block0 <----- dtv1 static_block1 <----- dtv2 static_block2 <----- dtv3 dynamic_block0 <----- dtv4 Hign address dynamic_block1 <----- dtv5 */ REG_L t0, tp, -SIZE_OF_TCB /* t0 = dtv */ REG_L a0, a0, TLSDESC_ARG /* a0(td) = tdp->arg */ REG_L t1, a0, TLSDESC_GEN_COUNT /* t1 = td->gen_count */ REG_L t2, t0, DTV_COUNTER /* t2 = dtv[0].counter */ /* If dtv[0].counter < td->gen_count, goto slow path. */ bltu t2, t1, .Lslow REG_L t1, a0, TLSDESC_MODID /* t1 = td->tlsinfo.ti_module */ /* t1 = t1 * sizeof(dtv_t) = t1 * (2 * sizeof(void*)) */ slli.d t1, t1, 4 add.d t1, t1, t0 /* t1 = dtv[td->tlsinfo.ti_module] */ REG_L t1, t1, 0 /* t1 = dtv[td->tlsinfo.ti_module].pointer.val */ li.d t2, TLS_DTV_UNALLOCATED /* If dtv[td->tlsinfo.ti_module].pointer.val is TLS_DTV_UNALLOCATED, goto slow path. */ beq t1, t2, .Lslow REG_L t2, a0, TLSDESC_MODOFF /* t2 = td->tlsinfo.ti_offset */ /* dtv[td->tlsinfo.ti_module].pointer.val + td->tlsinfo.ti_offset */ add.d a0, t1, t2 .Lret: sub.d a0, a0, tp REG_L t0, sp, 0 REG_L t1, sp, 8 REG_L t2, sp, 16 ADDI sp, sp, 32 RET .Lslow: /* This is the slow path. We need to call __tls_get_addr() which means we need to save and restore all the register that the callee will trash. */ /* Save the remaining registers that we must treat as caller save. */ ADDI sp, sp, -FRAME_SIZE REG_S ra, sp, 0 * SZREG REG_S a1, sp, 1 * SZREG REG_S a2, sp, 2 * SZREG REG_S a3, sp, 3 * SZREG REG_S a4, sp, 4 * SZREG REG_S a5, sp, 5 * SZREG REG_S a6, sp, 6 * SZREG REG_S a7, sp, 7 * SZREG REG_S t3, sp, 8 * SZREG REG_S t4, sp, 9 * SZREG REG_S t5, sp, 10 * SZREG REG_S t6, sp, 11 * SZREG REG_S t7, sp, 12 * SZREG REG_S t8, sp, 13 * SZREG #ifndef __loongarch_soft_float /* Save fcsr0 register. Only one physical fcsr0 register, fcsr1-fcsr3 are aliases of some fields in fcsr0. */ movfcsr2gr t0, fcsr0 st.w t0, sp, FRAME_SIZE + 24 /* Use the spare slot above t2 */ /* Whether support LASX. */ la.global t0, _rtld_global_ro REG_L t0, t0, GLRO_DL_HWCAP_OFFSET andi t1, t0, HWCAP_LOONGARCH_LASX beqz t1, .Llsx /* Save 256-bit vector registers. FIXME: Without vector ABI, save all vector registers. */ ADDI sp, sp, -FRAME_SIZE_LASX xvst xr0, sp, 0*SZXREG xvst xr1, sp, 1*SZXREG xvst xr2, sp, 2*SZXREG xvst xr3, sp, 3*SZXREG xvst xr4, sp, 4*SZXREG xvst xr5, sp, 5*SZXREG xvst xr6, sp, 6*SZXREG xvst xr7, sp, 7*SZXREG xvst xr8, sp, 8*SZXREG xvst xr9, sp, 9*SZXREG xvst error: patch failed: sysdeps/loongarch/dl-tlsdesc.S:59 error: sysdeps/loongarch/dl-tlsdesc.S: patch does not apply Checking patch sysdeps/loongarch/dl-tlsdesc.h... error: while searching for: #ifdef SHARED extern void *_dl_make_tlsdesc_dynamic (struct link_map *, size_t); extern ptrdiff_t attribute_hidden _dl_tlsdesc_dynamic (struct tlsdesc *); #endif error: patch failed: sysdeps/loongarch/dl-tlsdesc.h:43 error: sysdeps/loongarch/dl-tlsdesc.h: patch does not apply