mailing list of musl libc
 help / color / mirror / code / Atom feed
ba6a30b271847442e0154473363163304539d01d blob 1006 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
 
#include <stdint.h>
#include <elf.h>
#include "pthread_impl.h"
#include "libc.h"

#define HWCAP_TLS (1 << 15)

extern const unsigned char __attribute__((__visibility__("hidden")))
	__atomics_base[], __atomics_oldkuser_base[],
	__atomics_v6_base[], __atomics_v7_base[];

extern uintptr_t __atomics_selector __attribute__((__visibility__("hidden")));

int __set_thread_area(void *p)
{
#if !__ARM_ARCH_7A__ && !__ARM_ARCH_7R__ && __ARM_ARCH < 7
	uintptr_t sel;
	if (__hwcap & HWCAP_TLS) {
		size_t *aux;
		sel = (uintptr_t)__atomics_v7_base;
		for (aux=libc.auxv; *aux; aux+=2) {
			if (*aux != AT_PLATFORM) continue;
			const char *s = (void *)aux[1];
			if (s[0]=='v' && s[1]=='6' && s[2]-'0'>=10u)
				sel = (uintptr_t)__atomics_v6_base;
			break;
		}
	} else {
		int ver = *(int *)0xffff0ffc;
		sel = (uintptr_t)0xffff0fa0;
		if (ver < 2) a_crash();
		if (ver < 3) sel = (uintptr_t)__atomics_oldkuser_base;
	}
	__atomics_selector = sel - (uintptr_t)__atomics_base;
#endif
	return __syscall(0xf0005, p);
}
debug log:

solving ba6a30b ...
found ba6a30b in https://inbox.vuxu.org/musl/20141118030037.GA32132@brightrain.aerifal.cx/
found e69de29 in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391	arch/arm/src/__set_thread_area.c

applying [1/1] https://inbox.vuxu.org/musl/20141118030037.GA32132@brightrain.aerifal.cx/
diff --git a/arch/arm/src/__set_thread_area.c b/arch/arm/src/__set_thread_area.c
index e69de29..ba6a30b 100644

Checking patch arch/arm/src/__set_thread_area.c...
Applied patch arch/arm/src/__set_thread_area.c cleanly.

index at:
100644 ba6a30b271847442e0154473363163304539d01d	arch/arm/src/__set_thread_area.c

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).