devel
Threads by month
- ----- 2026 -----
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- 1 participants
- 1176 discussions
30 Jul '16
To be more consistent separate all TLS macros in separate files and
remove obsolete macros for not supported architectures.
Signed-off-by: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
---
Any objections?
---
test/tls/tls-macros-alpha.h | 25 ++
test/tls/tls-macros-arc.h | 28 ++
test/tls/tls-macros-i386.h | 76 ++++
test/tls/tls-macros-ia64.h | 63 +++
test/tls/tls-macros-metag.h | 38 ++
test/tls/tls-macros-powerpc.h | 87 ++++
test/tls/tls-macros-sh.h | 143 ++++++
test/tls/tls-macros-sparc.h | 67 +++
test/tls/tls-macros-x86_64.h | 40 ++
test/tls/tls-macros-xtensa.h | 61 +++
test/tls/tls-macros.h | 984 ++---------------------------------------
11 files changed, 657 insertions(+), 955 deletions(-)
create mode 100644 test/tls/tls-macros-alpha.h
create mode 100644 test/tls/tls-macros-arc.h
create mode 100644 test/tls/tls-macros-i386.h
create mode 100644 test/tls/tls-macros-ia64.h
create mode 100644 test/tls/tls-macros-metag.h
create mode 100644 test/tls/tls-macros-powerpc.h
create mode 100644 test/tls/tls-macros-sh.h
create mode 100644 test/tls/tls-macros-sparc.h
create mode 100644 test/tls/tls-macros-x86_64.h
create mode 100644 test/tls/tls-macros-xtensa.h
diff --git a/test/tls/tls-macros-alpha.h b/test/tls/tls-macros-alpha.h
new file mode 100644
index 0000000..78820ec
--- /dev/null
+++ b/test/tls/tls-macros-alpha.h
@@ -0,0 +1,25 @@
+register void *__gp __asm__("$29");
+
+# define TLS_LE(x) \
+ ({ int *__l; \
+ __asm__ ("call_pal 158\n\tlda $0," #x "($0)\t\t!tprel" : "=v"(__l)); \
+ __l; })
+
+# define TLS_IE(x) \
+ ({ char *__tp; unsigned long __o; \
+ __asm__ ("call_pal 158\n\tldq %1," #x "($gp)\t\t!gottprel" \
+ : "=v"(__tp), "=r"(__o) : "r"(__gp)); \
+ (int *)(__tp + __o); })
+
+# define TLS_LD(x) \
+ ({ extern void *__tls_get_addr(void *); int *__l; void *__i; \
+ __asm__ ("lda %0," #x "($gp)\t\t!tlsldm" : "=r" (__i) : "r"(__gp)); \
+ __i = __tls_get_addr(__i); \
+ __asm__ ("lda %0, " #x "(%1)\t\t!dtprel" : "=r"(__l) : "r"(__i)); \
+ __l; })
+
+# define TLS_GD(x) \
+ ({ extern void *__tls_get_addr(void *); void *__i; \
+ __asm__ ("lda %0," #x "($gp)\t\t!tlsgd" : "=r" (__i) : "r"(__gp)); \
+ (int *) __tls_get_addr(__i); })
+
diff --git a/test/tls/tls-macros-arc.h b/test/tls/tls-macros-arc.h
new file mode 100644
index 0000000..4b2d6f8
--- /dev/null
+++ b/test/tls/tls-macros-arc.h
@@ -0,0 +1,28 @@
+/* For now */
+#define TLS_LD(x) TLS_IE(x)
+
+#define TLS_GD(x) \
+ ({ int *__result; \
+ __asm__ ("add r0, pcl, @" #x "@tlsgd \n" \
+ ".tls_gd_ld " #x "`bl __tls_get_addr@plt \n" \
+ "mov %0, r0 \n" \
+ : "=&r" (__result) \
+ ::"r0","r1","r2","r3","r4","r5","r6","r7", \
+ "r8","r9","r10","r11","r12"); \
+ __result; })
+
+#define TLS_LE(x) \
+ ({ int *__result; \
+ void *tp = __builtin_thread_pointer(); \
+ __asm__ ("add %0, %1, @" #x "@tpoff \n" \
+ : "=r" (__result) : "r"(tp)); \
+ __result; })
+
+#define TLS_IE(x) \
+ ({ int *__result; \
+ void *tp = __builtin_thread_pointer(); \
+ __asm__ ("ld %0, [pcl, @" #x "@tlsie] \n" \
+ "add %0, %1, %0 \n" \
+ : "=&r" (__result) : "r" (tp)); \
+ __result; })
+
diff --git a/test/tls/tls-macros-i386.h b/test/tls/tls-macros-i386.h
new file mode 100644
index 0000000..6690753
--- /dev/null
+++ b/test/tls/tls-macros-i386.h
@@ -0,0 +1,76 @@
+#define TLS_LE(x) \
+ ({ int *__l; \
+ __asm__ ("movl %%gs:0,%0\n\t" \
+ "subl $" #x "@tpoff,%0" \
+ : "=r" (__l)); \
+ __l; })
+
+#ifdef __PIC__
+# define TLS_IE(x) \
+ ({ int *__l; \
+ __asm__ ("movl %%gs:0,%0\n\t" \
+ "subl " #x "@gottpoff(%%ebx),%0" \
+ : "=r" (__l)); \
+ __l; })
+#else
+# define TLS_IE(x) \
+ ({ int *__l; \
+ __asm__ ("call 1f\n\t" \
+ ".subsection 1\n" \
+ "1:\tmovl (%%esp), %%ebx\n\t" \
+ "ret\n\t" \
+ ".previous\n\t" \
+ "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n\t" \
+ "movl %%gs:0,%0\n\t" \
+ "subl " #x "@gottpoff(%%ebx),%0" \
+ : "=r" (__l)); \
+ __l; })
+#endif
+
+#ifdef __PIC__
+# define TLS_LD(x) \
+ ({ int *__l, __c, __d; \
+ __asm__ ("leal " #x "@tlsldm(%%ebx),%%eax\n\t" \
+ "call ___tls_get_addr@plt\n\t" \
+ "leal " #x "@dtpoff(%%eax), %%eax" \
+ : "=a" (__l), "=&c" (__c), "=&d" (__d)); \
+ __l; })
+#else
+# define TLS_LD(x) \
+ ({ int *__l, __b, __c, __d; \
+ __asm__ ("call 1f\n\t" \
+ ".subsection 1\n" \
+ "1:\tmovl (%%esp), %%ebx\n\t" \
+ "ret\n\t" \
+ ".previous\n\t" \
+ "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n\t" \
+ "leal " #x "@tlsldm(%%ebx),%%eax\n\t" \
+ "call ___tls_get_addr@plt\n\t" \
+ "leal " #x "@dtpoff(%%eax), %%eax" \
+ : "=a" (__l), "=&b" (__b), "=&c" (__c), "=&d" (__d)); \
+ __l; })
+#endif
+
+#ifdef __PIC__
+# define TLS_GD(x) \
+ ({ int *__l, __c, __d; \
+ __asm__ ("leal " #x "@tlsgd(%%ebx),%%eax\n\t" \
+ "call ___tls_get_addr@plt\n\t" \
+ "nop" \
+ : "=a" (__l), "=&c" (__c), "=&d" (__d)); \
+ __l; })
+#else
+# define TLS_GD(x) \
+ ({ int *__l, __c, __d; \
+ __asm__ ("call 1f\n\t" \
+ ".subsection 1\n" \
+ "1:\tmovl (%%esp), %%ebx\n\t" \
+ "ret\n\t" \
+ ".previous\n\t" \
+ "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n\t" \
+ "leal " #x "@tlsgd(%%ebx),%%eax\n\t" \
+ "call ___tls_get_addr@plt\n\t" \
+ "nop" \
+ : "=a" (__l), "=&c" (__c), "=&d" (__d)); \
+ __l; })
+#endif
diff --git a/test/tls/tls-macros-ia64.h b/test/tls/tls-macros-ia64.h
new file mode 100644
index 0000000..2584020
--- /dev/null
+++ b/test/tls/tls-macros-ia64.h
@@ -0,0 +1,63 @@
+#define TLS_LE(x) \
+ ({ void *__l; \
+ __asm__ ("mov r2=r13\n\t" \
+ ";;\n\t" \
+ "addl %0=@tprel(" #x "),r2\n\t" \
+ : "=r" (__l) : : "r2" ); __l; })
+
+#define TLS_IE(x) \
+ ({ void *__l; \
+ register long __gp __asm__ ("gp"); \
+ __asm__ (";;\n\t" \
+ "addl r16=@ltoff(@tprel(" #x ")),gp\n\t" \
+ ";;\n\t" \
+ "ld8 r17=[r16]\n\t" \
+ ";;\n\t" \
+ "add %0=r13,r17\n\t" \
+ ";;\n\t" \
+ : "=r" (__l) : "r" (__gp) : "r16", "r17" ); __l; })
+
+#define __TLS_CALL_CLOBBERS \
+ "r2", "r3", "r8", "r9", "r10", "r11", "r14", "r15", "r16", "r17", \
+ "r18", "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26", \
+ "r27", "r28", "r29", "r30", "r31", \
+ "p6", "p7", "p8", "p9", "p10", "p11", "p12", "p13", "p14", "p15", \
+ "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
+ "b6", "b7", \
+ "out0", "out1", "out2", "out3", "out4", "out5", "out6", "out7"
+
+#define TLS_LD(x) \
+ ({ void *__l; \
+ register long __gp __asm__ ("gp"); \
+ __asm__ (";;\n\t" \
+ "mov loc0=gp\n\t" \
+ "addl r16=@ltoff(@dtpmod(" #x ")),gp\n\t" \
+ "addl out1=@dtprel(" #x "),r0\n\t" \
+ ";;\n\t" \
+ "ld8 out0=[r16]\n\t" \
+ "br.call.sptk.many b0=__tls_get_addr" \
+ ";;\n\t" \
+ "mov gp=loc0\n\t" \
+ "mov %0=r8\n\t" \
+ ";;\n\t" \
+ : "=r" (__l) : "r" (__gp) : "loc0", __TLS_CALL_CLOBBERS); \
+ __l; })
+
+#define TLS_GD(x) \
+ ({ void *__l; \
+ register long __gp __asm__ ("gp"); \
+ __asm__ (";;\n\t" \
+ "mov loc0=gp\n\t" \
+ "addl r16=@ltoff(@dtpmod(" #x ")),gp\n\t" \
+ "addl r17=@ltoff(@dtprel(" #x ")),gp\n\t" \
+ ";;\n\t" \
+ "ld8 out0=[r16]\n\t" \
+ "ld8 out1=[r17]\n\t" \
+ "br.call.sptk.many b0=__tls_get_addr" \
+ ";;\n\t" \
+ "mov gp=loc0\n\t" \
+ "mov %0=r8\n\t" \
+ ";;\n\t" \
+ : "=r" (__l) : "r" (__gp) : "loc0", __TLS_CALL_CLOBBERS); \
+ __l; })
+
diff --git a/test/tls/tls-macros-metag.h b/test/tls/tls-macros-metag.h
new file mode 100644
index 0000000..5533ecd
--- /dev/null
+++ b/test/tls/tls-macros-metag.h
@@ -0,0 +1,38 @@
+#define TLS_GD(x) \
+ ({ void *__result; \
+ extern void *__tls_get_addr (void *); \
+ __asm__ ("MOV %0, A1LbP\n\t" \
+ "ADD %0, %0, #(" #x "@TLSGD)" \
+ : "=d" (__result)); \
+ (int *)__tls_get_addr (__result); })
+
+#define TLS_LD(x) \
+ ({ void *__result; \
+ extern void *__tls_get_addr (void *); \
+ __asm__ ("MOV %0, A1LbP\n\t" \
+ "ADD %0, %0, #(" #x "@TLSLDM)" \
+ : "=d" (__result)); \
+ __result = __tls_get_addr (__result); \
+ __asm__ ("ADDT %0,%0,#HI(" #x "@TLSLDO)\n\t" \
+ "ADD %0,%0,#LO(" #x "@TLSLDO)" \
+ : "+d" (__result)); \
+ __result; })
+
+#define TLS_IE(x) \
+ ({ void *__result; \
+ unsigned long __rel; \
+ extern void *__metag_load_tp (void); \
+ __asm__ ("GETD %0,[A1LbP+#(" #x "@TLSIE)]" \
+ : "=d" (__rel)); \
+ __result = __metag_load_tp(); \
+ __result + __rel; })
+
+#define TLS_LE(x) \
+ ({ void *__result; \
+ extern void *__metag_load_tp (void); \
+ __result = __metag_load_tp(); \
+ __asm__ ("ADDT %0,%0,#HI(" #x "@TLSLE)\n\t" \
+ "ADD %0,%0,#LO(" #x "@TLSLE)" \
+ : "+d" (__result)); \
+ __result; })
+
diff --git a/test/tls/tls-macros-powerpc.h b/test/tls/tls-macros-powerpc.h
new file mode 100644
index 0000000..ef293bb
--- /dev/null
+++ b/test/tls/tls-macros-powerpc.h
@@ -0,0 +1,87 @@
+#define __TLS_CALL_CLOBBERS \
+ "0", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", \
+ "lr", "ctr", "cr0", "cr1", "cr5", "cr6", "cr7"
+
+/* PowerPC32 Local Exec TLS access. */
+#define TLS_LE(x) \
+ ({ int *__result; \
+ __asm__ ("addi %0,2," #x "@tprel" \
+ : "=r" (__result)); \
+ __result; })
+
+/* PowerPC32 Initial Exec TLS access. */
+#ifdef HAVE_ASM_PPC_REL16
+# define TLS_IE(x) \
+ ({ int *__result; \
+ __asm__ ("bcl 20,31,1f\n1:\t" \
+ "mflr %0\n\t" \
+ "addis %0,%0,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t" \
+ "addi %0,%0,_GLOBAL_OFFSET_TABLE_-1b@l\n\t" \
+ "lwz %0," #x "@got@tprel(%0)\n\t" \
+ "add %0,%0," #x "@tls" \
+ : "=b" (__result) : \
+ : "lr"); \
+ __result; })
+#else
+# define TLS_IE(x) \
+ ({ int *__result; \
+ __asm__ ("bl _GLOBAL_OFFSET_TABLE_@local-4\n\t" \
+ "mflr %0\n\t" \
+ "lwz %0," #x "@got@tprel(%0)\n\t" \
+ "add %0,%0," #x "@tls" \
+ : "=b" (__result) : \
+ : "lr"); \
+ __result; })
+#endif
+
+/* PowerPC32 Local Dynamic TLS access. */
+#ifdef HAVE_ASM_PPC_REL16
+# define TLS_LD(x) \
+ ({ int *__result; \
+ __asm__ ("bcl 20,31,1f\n1:\t" \
+ "mflr 3\n\t" \
+ "addis 3,3,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t" \
+ "addi 3,3,_GLOBAL_OFFSET_TABLE_-1b@l\n\t" \
+ "addi 3,3," #x "@got@tlsld\n\t" \
+ "bl __tls_get_addr@plt\n\t" \
+ "addi %0,3," #x "@dtprel" \
+ : "=r" (__result) : \
+ : __TLS_CALL_CLOBBERS); \
+ __result; })
+#else
+# define TLS_LD(x) \
+ ({ int *__result; \
+ __asm__ ("bl _GLOBAL_OFFSET_TABLE_@local-4\n\t" \
+ "mflr 3\n\t" \
+ "addi 3,3," #x "@got@tlsld\n\t" \
+ "bl __tls_get_addr@plt\n\t" \
+ "addi %0,3," #x "@dtprel" \
+ : "=r" (__result) : \
+ : __TLS_CALL_CLOBBERS); \
+ __result; })
+#endif
+
+/* PowerPC32 General Dynamic TLS access. */
+#ifdef HAVE_ASM_PPC_REL16
+# define TLS_GD(x) \
+ ({ register int *__result __asm__ ("r3"); \
+ __asm__ ("bcl 20,31,1f\n1:\t" \
+ "mflr 3\n\t" \
+ "addis 3,3,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t" \
+ "addi 3,3,_GLOBAL_OFFSET_TABLE_-1b@l\n\t" \
+ "addi 3,3," #x "@got@tlsgd\n\t" \
+ "bl __tls_get_addr@plt" \
+ : : \
+ : __TLS_CALL_CLOBBERS); \
+ __result; })
+#else
+# define TLS_GD(x) \
+ ({ register int *__result __asm__ ("r3"); \
+ __asm__ ("bl _GLOBAL_OFFSET_TABLE_@local-4\n\t" \
+ "mflr 3\n\t" \
+ "addi 3,3," #x "@got@tlsgd\n\t" \
+ "bl __tls_get_addr@plt" \
+ : : \
+ : __TLS_CALL_CLOBBERS); \
+ __result; })
+#endif
diff --git a/test/tls/tls-macros-sh.h b/test/tls/tls-macros-sh.h
new file mode 100644
index 0000000..f84399c
--- /dev/null
+++ b/test/tls/tls-macros-sh.h
@@ -0,0 +1,143 @@
+#define TLS_LE(x) \
+ ({ int *__l; void *__tp; \
+ __asm__ ("stc gbr,%1\n\t" \
+ "mov.l 1f,%0\n\t" \
+ "bra 2f\n\t" \
+ " add %1,%0\n\t" \
+ ".align 2\n\t" \
+ "1: .long " #x "@tpoff\n\t" \
+ "2:" \
+ : "=r" (__l), "=r" (__tp)); \
+ __l; })
+
+#ifdef __PIC__
+# define TLS_IE(x) \
+ ({ int *__l; void *__tp; \
+ register void *__gp __asm__("r12"); \
+ __asm__ ("mov.l 1f,r0\n\t" \
+ "stc gbr,%1\n\t" \
+ "mov.l @(r0,r12),%0\n\t" \
+ "bra 2f\n\t" \
+ " add %1,%0\n\t" \
+ ".align 2\n\t" \
+ "1: .long " #x "@gottpoff\n\t" \
+ "2:" \
+ : "=r" (__l), "=r" (__tp) : "r" (__gp) : "r0"); \
+ __l; })
+#else
+# define TLS_IE(x) \
+ ({ int *__l; void *__tp; \
+ __asm__ ("mov.l r12,@-r15\n\t" \
+ "mova 0f,r0\n\t" \
+ "mov.l 0f,r12\n\t" \
+ "add r0,r12\n\t" \
+ "mov.l 1f,r0\n\t" \
+ "stc gbr,%1\n\t" \
+ "mov.l @(r0,r12),%0\n\t" \
+ "bra 2f\n\t" \
+ " add %1,%0\n\t" \
+ ".align 2\n\t" \
+ "1: .long " #x "@gottpoff\n\t" \
+ "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \
+ "2: mov.l @r15+,r12" \
+ : "=r" (__l), "=r" (__tp) : : "r0"); \
+ __l; })
+#endif
+
+#ifdef __PIC__
+# define TLS_LD(x) \
+ ({ int *__l; \
+ register void *__gp __asm__("r12"); \
+ __asm__ ("mov.l 1f,r4\n\t" \
+ "mova 2f,r0\n\t" \
+ "mov.l 2f,r1\n\t" \
+ "add r0,r1\n\t" \
+ "jsr @r1\n\t" \
+ " add r12,r4\n\t" \
+ "bra 4f\n\t" \
+ " nop\n\t" \
+ ".align 2\n\t" \
+ "1: .long " #x "@tlsldm\n\t" \
+ "2: .long __tls_get_addr@plt\n\t" \
+ "4: mov.l 3f,%0\n\t" \
+ "bra 5f\n\t" \
+ " add r0,%0\n\t" \
+ ".align 2\n\t" \
+ "3: .long " #x "@dtpoff\n\t" \
+ "5:" \
+ : "=r" (__l) : "r" (__gp) : "r0", "r1", "r2", "r3", "r4", "r5", \
+ "r6", "r7", "pr", "t"); \
+ __l; })
+#else
+# define TLS_LD(x) \
+ ({ int *__l; \
+ __asm__ ("mov.l r12,@-r15\n\t" \
+ "mova 0f,r0\n\t" \
+ "mov.l 0f,r12\n\t" \
+ "add r0,r12\n\t" \
+ "mov.l 1f,r4\n\t" \
+ "mova 2f,r0\n\t" \
+ "mov.l 2f,r1\n\t" \
+ "add r0,r1\n\t" \
+ "jsr @r1\n\t" \
+ " add r12,r4\n\t" \
+ "bra 4f\n\t" \
+ " nop\n\t" \
+ ".align 2\n\t" \
+ "1: .long " #x "@tlsldm\n\t" \
+ "2: .long __tls_get_addr@plt\n\t" \
+ "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \
+ "4: mov.l 3f,%0\n\t" \
+ "bra 5f\n\t" \
+ " add r0,%0\n\t" \
+ ".align 2\n\t" \
+ "3: .long " #x "@dtpoff\n\t" \
+ "5: mov.l @r15+,r12" \
+ : "=r" (__l) : : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
+ "pr", "t"); \
+ __l; })
+#endif
+
+#ifdef __PIC__
+# define TLS_GD(x) \
+ ({ int *__l; \
+ register void *__gp __asm__("r12"); \
+ __asm__ ("mov.l 1f,r4\n\t" \
+ "mova 2f,r0\n\t" \
+ "mov.l 2f,r1\n\t" \
+ "add r0,r1\n\t" \
+ "jsr @r1\n\t" \
+ " add r12,r4\n\t" \
+ "bra 3f\n\t" \
+ " mov r0,%0\n\t" \
+ ".align 2\n\t" \
+ "1: .long " #x "@tlsgd\n\t" \
+ "2: .long __tls_get_addr@plt\n\t" \
+ "3:" \
+ : "=r" (__l) : "r" (__gp) : "r0", "r1", "r2", "r3", "r4", "r5", \
+ "r6", "r7", "pr", "t"); \
+ __l; })
+#else
+# define TLS_GD(x) \
+ ({ int *__l; \
+ __asm__ ("mov.l r12,@-r15\n\t" \
+ "mova 0f,r0\n\t" \
+ "mov.l 0f,r12\n\t" \
+ "add r0,r12\n\t" \
+ "mov.l 1f,r4\n\t" \
+ "mova 2f,r0\n\t" \
+ "mov.l 2f,r1\n\t" \
+ "add r0,r1\n\t" \
+ "jsr @r1\n\t" \
+ " add r12,r4\n\t" \
+ "bra 3f\n\t" \
+ " mov r0,%0\n\t" \
+ ".align 2\n\t" \
+ "1: .long " #x "@tlsgd\n\t" \
+ "2: .long __tls_get_addr@plt\n\t" \
+ "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \
+ "3: mov.l @r15+,r12" \
+ : "=r" (__l) : : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
+ "pr", "t"); \
+ __l; })
+#endif
diff --git a/test/tls/tls-macros-sparc.h b/test/tls/tls-macros-sparc.h
new file mode 100644
index 0000000..710ced1
--- /dev/null
+++ b/test/tls/tls-macros-sparc.h
@@ -0,0 +1,67 @@
+#define TLS_LE(x) \
+ ({ int *__l; \
+ __asm__ ("sethi %%tle_hix22(" #x "), %0" : "=r" (__l)); \
+ __asm__ ("xor %1, %%tle_lox10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
+ __asm__ ("add %%g7, %1, %0" : "=r" (__l) : "r" (__l)); \
+ __l; })
+
+#ifdef __PIC__
+# define TLS_LOAD_PIC \
+ ({ register long pc __asm__ ("%o7"); \
+ long got; \
+ __asm__ ("sethi %%hi(_GLOBAL_OFFSET_TABLE_-4), %1\n\t" \
+ "call .+8\n\t" \
+ "add %1, %%lo(_GLOBAL_OFFSET_TABLE_+4), %1\n\t" \
+ "add %1, %0, %1\n\t" \
+ : "=r" (pc), "=r" (got)); \
+ got; })
+#else
+# define TLS_LOAD_PIC \
+ ({ long got; \
+ __asm__ (".hidden _GLOBAL_OFFSET_TABLE_\n\t" \
+ "sethi %%hi(_GLOBAL_OFFSET_TABLE_), %0\n\t" \
+ "or %0, %%lo(_GLOBAL_OFFSET_TABLE_), %0" \
+ : "=r" (got)); \
+ got; })
+#endif
+
+#define TLS_IE(x) \
+ ({ int *__l; \
+ __asm__ ("sethi %%tie_hi22(" #x "), %0" : "=r" (__l)); \
+ __asm__ ("add %1, %%tie_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
+ __asm__ ("ld [%1 + %2], %0, %%tie_ld(" #x ")" \
+ : "=r" (__l) : "r" (TLS_LOAD_PIC), "r" (__l)); \
+ __asm__ ("add %%g7, %1, %0, %%tie_add(" #x ")" : "=r" (__l) : "r" (__l)); \
+ __l; })
+
+#define TLS_LD(x) \
+ ({ int *__l; register void *__o0 __asm__ ("%o0"); \
+ long __o; \
+ __asm__ ("sethi %%tldm_hi22(" #x "), %0" : "=r" (__l)); \
+ __asm__ ("add %1, %%tldm_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
+ __asm__ ("add %1, %2, %0, %%tldm_add(" #x ")" \
+ : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l)); \
+ __asm__ ("call __tls_get_addr, %%tgd_call(" #x ")\n\t" \
+ " nop" \
+ : "=r" (__o0) : "0" (__o0) \
+ : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4", \
+ "o5", "o7", "cc"); \
+ __asm__ ("sethi %%tldo_hix22(" #x "), %0" : "=r" (__o)); \
+ __asm__ ("xor %1, %%tldo_lox10(" #x "), %0" : "=r" (__o) : "r" (__o)); \
+ __asm__ ("add %1, %2, %0, %%tldo_add(" #x ")" : "=r" (__l) \
+ : "r" (__o0), "r" (__o)); \
+ __l; })
+
+#define TLS_GD(x) \
+ ({ int *__l; register void *__o0 __asm__ ("%o0"); \
+ __asm__ ("sethi %%tgd_hi22(" #x "), %0" : "=r" (__l)); \
+ __asm__ ("add %1, %%tgd_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
+ __asm__ ("add %1, %2, %0, %%tgd_add(" #x ")" \
+ : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l)); \
+ __asm__ ("call __tls_get_addr, %%tgd_call(" #x ")\n\t" \
+ " nop" \
+ : "=r" (__o0) : "0" (__o0) \
+ : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4", \
+ "o5", "o7", "cc"); \
+ __o0; })
+
diff --git a/test/tls/tls-macros-x86_64.h b/test/tls/tls-macros-x86_64.h
new file mode 100644
index 0000000..b8a8b71
--- /dev/null
+++ b/test/tls/tls-macros-x86_64.h
@@ -0,0 +1,40 @@
+#define TLS_LE(x) \
+ ({ int *__l; \
+ __asm__ ("mov %%fs:0,%0\n\t" \
+ "lea " #x "@tpoff(%0), %0" \
+ : "=r" (__l)); \
+ __l; })
+
+#define TLS_IE(x) \
+ ({ int *__l; \
+ __asm__ ("mov %%fs:0,%0\n\t" \
+ "add " #x "@gottpoff(%%rip),%0" \
+ : "=r" (__l)); \
+ __l; })
+
+#define TLS_LD(x) \
+ ({ int *__l, __c, __d; \
+ __asm__ ("leaq " #x "@tlsld(%%rip),%%rdi\n\t" \
+ "call __tls_get_addr@plt\n\t" \
+ "leaq " #x "@dtpoff(%%rax), %%rax" \
+ : "=a" (__l), "=&c" (__c), "=&d" (__d) \
+ : : "rdi", "rsi", "r8", "r9", "r10", "r11"); \
+ __l; })
+
+#ifdef __ILP32__
+# define TLS_GD_PREFIX
+#else
+# define TLS_GD_PREFIX ".byte 0x66\n\t"
+#endif
+
+#define TLS_GD(x) \
+ ({ int *__l, __c, __d; \
+ __asm__ (TLS_GD_PREFIX \
+ "leaq " #x "@tlsgd(%%rip),%%rdi\n\t" \
+ ".word 0x6666\n\t" \
+ "rex64\n\t" \
+ "call __tls_get_addr@plt" \
+ : "=a" (__l), "=&c" (__c), "=&d" (__d) \
+ : : "rdi", "rsi", "r8", "r9", "r10", "r11"); \
+ __l; })
+
diff --git a/test/tls/tls-macros-xtensa.h b/test/tls/tls-macros-xtensa.h
new file mode 100644
index 0000000..179dc5e
--- /dev/null
+++ b/test/tls/tls-macros-xtensa.h
@@ -0,0 +1,61 @@
+#if defined(__XTENSA_WINDOWED_ABI__)
+#define TLS_GD(x) \
+ ({ int *__l; \
+ __asm__ ("movi a8, " #x "@TLSFUNC\n\t" \
+ "movi a10, " #x "@TLSARG\n\t" \
+ "callx8.tls a8, " #x "@TLSCALL\n\t" \
+ "mov %0, a10\n\t" \
+ : "=r" (__l) \
+ : \
+ : "a8", "a9", "a10", "a11", "a12", "a13", "a14", "a15"); \
+ __l; })
+
+#define TLS_LD(x) \
+ ({ int *__l; \
+ __asm__ ("movi a8, _TLS_MODULE_BASE_@TLSFUNC\n\t" \
+ "movi a10, _TLS_MODULE_BASE_@TLSARG\n\t" \
+ "callx8.tls a8, _TLS_MODULE_BASE_@TLSCALL\n\t" \
+ "movi %0, " #x "@TPOFF\n\t" \
+ "add %0, %0, a10\n\t" \
+ : "=r" (__l) \
+ : \
+ : "a8", "a9", "a10", "a11", "a12", "a13", "a14", "a15"); \
+ __l; })
+#elif defined(__XTENSA_CALL0_ABI__)
+#define TLS_GD(x) \
+ ({ int *__l; \
+ __asm__ ("movi a0, " #x "@TLSFUNC\n\t" \
+ "movi a2, " #x "@TLSARG\n\t" \
+ "callx0.tls a0, " #x "@TLSCALL\n\t" \
+ "mov %0, a2\n\t" \
+ : "=r" (__l) \
+ : \
+ : "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10", "a11");\
+ __l; })
+
+#define TLS_LD(x) \
+ ({ int *__l; \
+ __asm__ ("movi a0, _TLS_MODULE_BASE_@TLSFUNC\n\t" \
+ "movi a2, _TLS_MODULE_BASE_@TLSARG\n\t" \
+ "callx0.tls a0, _TLS_MODULE_BASE_@TLSCALL\n\t" \
+ "movi %0, " #x "@TPOFF\n\t" \
+ "add %0, %0, a2\n\t" \
+ : "=r" (__l) \
+ : \
+ : "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10", "a11");\
+ __l; })
+#else
+#error Unsupported Xtensa ABI
+#endif
+
+#define TLS_IE(x) TLS_LE(x)
+
+#define TLS_LE(x) \
+ ({ int *__l; \
+ int __t; \
+ __asm__ ("rur %0, threadptr\n\t" \
+ "movi %1, " #x "@TPOFF\n\t" \
+ "add %0, %0, %1\n\t" \
+ : "=r" (__l), "=r" (__t) ); \
+ __l; }); \
+
diff --git a/test/tls/tls-macros.h b/test/tls/tls-macros.h
index e4d87f2..0300dba 100644
--- a/test/tls/tls-macros.h
+++ b/test/tls/tls-macros.h
@@ -16,8 +16,12 @@
/* XXX Until we get compiler support we don't need declarations. */
#define VAR_INT_DECL(x)
-#ifdef __mips__
-#include <tls-macros-mips.h>
+#ifdef __alpha__
+#include <tls-macros-alpha.h>
+#endif
+
+#ifdef __arc__
+#include <tls-macros-arc.h>
#endif
#ifdef __arm__
@@ -28,973 +32,43 @@
#endif
#endif
- /* XXX Each architecture must have its own asm for now. */
#ifdef __i386__
-# define TLS_LE(x) \
- ({ int *__l; \
- __asm__ ("movl %%gs:0,%0\n\t" \
- "subl $" #x "@tpoff,%0" \
- : "=r" (__l)); \
- __l; })
-
-# ifdef __PIC__
-# define TLS_IE(x) \
- ({ int *__l; \
- __asm__ ("movl %%gs:0,%0\n\t" \
- "subl " #x "@gottpoff(%%ebx),%0" \
- : "=r" (__l)); \
- __l; })
-# else
-# define TLS_IE(x) \
- ({ int *__l; \
- __asm__ ("call 1f\n\t" \
- ".subsection 1\n" \
- "1:\tmovl (%%esp), %%ebx\n\t" \
- "ret\n\t" \
- ".previous\n\t" \
- "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n\t" \
- "movl %%gs:0,%0\n\t" \
- "subl " #x "@gottpoff(%%ebx),%0" \
- : "=r" (__l)); \
- __l; })
-# endif
-
-# ifdef __PIC__
-# define TLS_LD(x) \
- ({ int *__l, __c, __d; \
- __asm__ ("leal " #x "@tlsldm(%%ebx),%%eax\n\t" \
- "call ___tls_get_addr@plt\n\t" \
- "leal " #x "@dtpoff(%%eax), %%eax" \
- : "=a" (__l), "=&c" (__c), "=&d" (__d)); \
- __l; })
-# else
-# define TLS_LD(x) \
- ({ int *__l, __b, __c, __d; \
- __asm__ ("call 1f\n\t" \
- ".subsection 1\n" \
- "1:\tmovl (%%esp), %%ebx\n\t" \
- "ret\n\t" \
- ".previous\n\t" \
- "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n\t" \
- "leal " #x "@tlsldm(%%ebx),%%eax\n\t" \
- "call ___tls_get_addr@plt\n\t" \
- "leal " #x "@dtpoff(%%eax), %%eax" \
- : "=a" (__l), "=&b" (__b), "=&c" (__c), "=&d" (__d)); \
- __l; })
-# endif
-
-# ifdef __PIC__
-# define TLS_GD(x) \
- ({ int *__l, __c, __d; \
- __asm__ ("leal " #x "@tlsgd(%%ebx),%%eax\n\t" \
- "call ___tls_get_addr@plt\n\t" \
- "nop" \
- : "=a" (__l), "=&c" (__c), "=&d" (__d)); \
- __l; })
-# else
-# define TLS_GD(x) \
- ({ int *__l, __c, __d; \
- __asm__ ("call 1f\n\t" \
- ".subsection 1\n" \
- "1:\tmovl (%%esp), %%ebx\n\t" \
- "ret\n\t" \
- ".previous\n\t" \
- "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n\t" \
- "leal " #x "@tlsgd(%%ebx),%%eax\n\t" \
- "call ___tls_get_addr@plt\n\t" \
- "nop" \
- : "=a" (__l), "=&c" (__c), "=&d" (__d)); \
- __l; })
-# endif
-
-#elif defined __x86_64__
-
-# define TLS_LE(x) \
- ({ int *__l; \
- __asm__ ("mov %%fs:0,%0\n\t" \
- "lea " #x "@tpoff(%0), %0" \
- : "=r" (__l)); \
- __l; })
-
-# define TLS_IE(x) \
- ({ int *__l; \
- __asm__ ("mov %%fs:0,%0\n\t" \
- "add " #x "@gottpoff(%%rip),%0" \
- : "=r" (__l)); \
- __l; })
-
-# define TLS_LD(x) \
- ({ int *__l, __c, __d; \
- __asm__ ("leaq " #x "@tlsld(%%rip),%%rdi\n\t" \
- "call __tls_get_addr@plt\n\t" \
- "leaq " #x "@dtpoff(%%rax), %%rax" \
- : "=a" (__l), "=&c" (__c), "=&d" (__d) \
- : : "rdi", "rsi", "r8", "r9", "r10", "r11"); \
- __l; })
-
-# ifdef __ILP32__
-# define TLS_GD_PREFIX
-# else
-# define TLS_GD_PREFIX ".byte 0x66\n\t"
-# endif
-
-# define TLS_GD(x) \
- ({ int *__l, __c, __d; \
- __asm__ (TLS_GD_PREFIX \
- "leaq " #x "@tlsgd(%%rip),%%rdi\n\t" \
- ".word 0x6666\n\t" \
- "rex64\n\t" \
- "call __tls_get_addr@plt" \
- : "=a" (__l), "=&c" (__c), "=&d" (__d) \
- : : "rdi", "rsi", "r8", "r9", "r10", "r11"); \
- __l; })
-
-#elif defined __sh__
-
-# define TLS_LE(x) \
- ({ int *__l; void *__tp; \
- __asm__ ("stc gbr,%1\n\t" \
- "mov.l 1f,%0\n\t" \
- "bra 2f\n\t" \
- " add %1,%0\n\t" \
- ".align 2\n\t" \
- "1: .long " #x "@tpoff\n\t" \
- "2:" \
- : "=r" (__l), "=r" (__tp)); \
- __l; })
-
-# ifdef __PIC__
-# define TLS_IE(x) \
- ({ int *__l; void *__tp; \
- register void *__gp __asm__("r12"); \
- __asm__ ("mov.l 1f,r0\n\t" \
- "stc gbr,%1\n\t" \
- "mov.l @(r0,r12),%0\n\t" \
- "bra 2f\n\t" \
- " add %1,%0\n\t" \
- ".align 2\n\t" \
- "1: .long " #x "@gottpoff\n\t" \
- "2:" \
- : "=r" (__l), "=r" (__tp) : "r" (__gp) : "r0"); \
- __l; })
-# else
-# define TLS_IE(x) \
- ({ int *__l; void *__tp; \
- __asm__ ("mov.l r12,@-r15\n\t" \
- "mova 0f,r0\n\t" \
- "mov.l 0f,r12\n\t" \
- "add r0,r12\n\t" \
- "mov.l 1f,r0\n\t" \
- "stc gbr,%1\n\t" \
- "mov.l @(r0,r12),%0\n\t" \
- "bra 2f\n\t" \
- " add %1,%0\n\t" \
- ".align 2\n\t" \
- "1: .long " #x "@gottpoff\n\t" \
- "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \
- "2: mov.l @r15+,r12" \
- : "=r" (__l), "=r" (__tp) : : "r0"); \
- __l; })
+#include <tls-macros-i386.h>
#endif
-# ifdef __PIC__
-# define TLS_LD(x) \
- ({ int *__l; \
- register void *__gp __asm__("r12"); \
- __asm__ ("mov.l 1f,r4\n\t" \
- "mova 2f,r0\n\t" \
- "mov.l 2f,r1\n\t" \
- "add r0,r1\n\t" \
- "jsr @r1\n\t" \
- " add r12,r4\n\t" \
- "bra 4f\n\t" \
- " nop\n\t" \
- ".align 2\n\t" \
- "1: .long " #x "@tlsldm\n\t" \
- "2: .long __tls_get_addr@plt\n\t" \
- "4: mov.l 3f,%0\n\t" \
- "bra 5f\n\t" \
- " add r0,%0\n\t" \
- ".align 2\n\t" \
- "3: .long " #x "@dtpoff\n\t" \
- "5:" \
- : "=r" (__l) : "r" (__gp) : "r0", "r1", "r2", "r3", "r4", "r5", \
- "r6", "r7", "pr", "t"); \
- __l; })
-# else
-# define TLS_LD(x) \
- ({ int *__l; \
- __asm__ ("mov.l r12,@-r15\n\t" \
- "mova 0f,r0\n\t" \
- "mov.l 0f,r12\n\t" \
- "add r0,r12\n\t" \
- "mov.l 1f,r4\n\t" \
- "mova 2f,r0\n\t" \
- "mov.l 2f,r1\n\t" \
- "add r0,r1\n\t" \
- "jsr @r1\n\t" \
- " add r12,r4\n\t" \
- "bra 4f\n\t" \
- " nop\n\t" \
- ".align 2\n\t" \
- "1: .long " #x "@tlsldm\n\t" \
- "2: .long __tls_get_addr@plt\n\t" \
- "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \
- "4: mov.l 3f,%0\n\t" \
- "bra 5f\n\t" \
- " add r0,%0\n\t" \
- ".align 2\n\t" \
- "3: .long " #x "@dtpoff\n\t" \
- "5: mov.l @r15+,r12" \
- : "=r" (__l) : : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
- "pr", "t"); \
- __l; })
+#ifdef __ia64__
+#include <tls-macros-ia64.h>
#endif
-# ifdef __PIC__
-# define TLS_GD(x) \
- ({ int *__l; \
- register void *__gp __asm__("r12"); \
- __asm__ ("mov.l 1f,r4\n\t" \
- "mova 2f,r0\n\t" \
- "mov.l 2f,r1\n\t" \
- "add r0,r1\n\t" \
- "jsr @r1\n\t" \
- " add r12,r4\n\t" \
- "bra 3f\n\t" \
- " mov r0,%0\n\t" \
- ".align 2\n\t" \
- "1: .long " #x "@tlsgd\n\t" \
- "2: .long __tls_get_addr@plt\n\t" \
- "3:" \
- : "=r" (__l) : "r" (__gp) : "r0", "r1", "r2", "r3", "r4", "r5", \
- "r6", "r7", "pr", "t"); \
- __l; })
-# else
-# define TLS_GD(x) \
- ({ int *__l; \
- __asm__ ("mov.l r12,@-r15\n\t" \
- "mova 0f,r0\n\t" \
- "mov.l 0f,r12\n\t" \
- "add r0,r12\n\t" \
- "mov.l 1f,r4\n\t" \
- "mova 2f,r0\n\t" \
- "mov.l 2f,r1\n\t" \
- "add r0,r1\n\t" \
- "jsr @r1\n\t" \
- " add r12,r4\n\t" \
- "bra 3f\n\t" \
- " mov r0,%0\n\t" \
- ".align 2\n\t" \
- "1: .long " #x "@tlsgd\n\t" \
- "2: .long __tls_get_addr@plt\n\t" \
- "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \
- "3: mov.l @r15+,r12" \
- : "=r" (__l) : : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
- "pr", "t"); \
- __l; })
+#ifdef __metag__
+#include <tls-macros-metag.h>
#endif
-#elif defined __alpha__
-
-register void *__gp __asm__("$29");
-
-# define TLS_LE(x) \
- ({ int *__l; \
- __asm__ ("call_pal 158\n\tlda $0," #x "($0)\t\t!tprel" : "=v"(__l)); \
- __l; })
-
-# define TLS_IE(x) \
- ({ char *__tp; unsigned long __o; \
- __asm__ ("call_pal 158\n\tldq %1," #x "($gp)\t\t!gottprel" \
- : "=v"(__tp), "=r"(__o) : "r"(__gp)); \
- (int *)(__tp + __o); })
-
-# define TLS_LD(x) \
- ({ extern void *__tls_get_addr(void *); int *__l; void *__i; \
- __asm__ ("lda %0," #x "($gp)\t\t!tlsldm" : "=r" (__i) : "r"(__gp)); \
- __i = __tls_get_addr(__i); \
- __asm__ ("lda %0, " #x "(%1)\t\t!dtprel" : "=r"(__l) : "r"(__i)); \
- __l; })
-
-# define TLS_GD(x) \
- ({ extern void *__tls_get_addr(void *); void *__i; \
- __asm__ ("lda %0," #x "($gp)\t\t!tlsgd" : "=r" (__i) : "r"(__gp)); \
- (int *) __tls_get_addr(__i); })
-
-
-#elif defined __ia64__
-
-# define TLS_LE(x) \
- ({ void *__l; \
- __asm__ ("mov r2=r13\n\t" \
- ";;\n\t" \
- "addl %0=@tprel(" #x "),r2\n\t" \
- : "=r" (__l) : : "r2" ); __l; })
-
-# define TLS_IE(x) \
- ({ void *__l; \
- register long __gp __asm__ ("gp"); \
- __asm__ (";;\n\t" \
- "addl r16=@ltoff(@tprel(" #x ")),gp\n\t" \
- ";;\n\t" \
- "ld8 r17=[r16]\n\t" \
- ";;\n\t" \
- "add %0=r13,r17\n\t" \
- ";;\n\t" \
- : "=r" (__l) : "r" (__gp) : "r16", "r17" ); __l; })
-
-# define __TLS_CALL_CLOBBERS \
- "r2", "r3", "r8", "r9", "r10", "r11", "r14", "r15", "r16", "r17", \
- "r18", "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26", \
- "r27", "r28", "r29", "r30", "r31", \
- "p6", "p7", "p8", "p9", "p10", "p11", "p12", "p13", "p14", "p15", \
- "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
- "b6", "b7", \
- "out0", "out1", "out2", "out3", "out4", "out5", "out6", "out7"
-
-# define TLS_LD(x) \
- ({ void *__l; \
- register long __gp __asm__ ("gp"); \
- __asm__ (";;\n\t" \
- "mov loc0=gp\n\t" \
- "addl r16=@ltoff(@dtpmod(" #x ")),gp\n\t" \
- "addl out1=@dtprel(" #x "),r0\n\t" \
- ";;\n\t" \
- "ld8 out0=[r16]\n\t" \
- "br.call.sptk.many b0=__tls_get_addr" \
- ";;\n\t" \
- "mov gp=loc0\n\t" \
- "mov %0=r8\n\t" \
- ";;\n\t" \
- : "=r" (__l) : "r" (__gp) : "loc0", __TLS_CALL_CLOBBERS); \
- __l; })
-
-# define TLS_GD(x) \
- ({ void *__l; \
- register long __gp __asm__ ("gp"); \
- __asm__ (";;\n\t" \
- "mov loc0=gp\n\t" \
- "addl r16=@ltoff(@dtpmod(" #x ")),gp\n\t" \
- "addl r17=@ltoff(@dtprel(" #x ")),gp\n\t" \
- ";;\n\t" \
- "ld8 out0=[r16]\n\t" \
- "ld8 out1=[r17]\n\t" \
- "br.call.sptk.many b0=__tls_get_addr" \
- ";;\n\t" \
- "mov gp=loc0\n\t" \
- "mov %0=r8\n\t" \
- ";;\n\t" \
- : "=r" (__l) : "r" (__gp) : "loc0", __TLS_CALL_CLOBBERS); \
- __l; })
-
-#elif defined __sparc__ && !defined __arch64__
-
-# define TLS_LE(x) \
- ({ int *__l; \
- __asm__ ("sethi %%tle_hix22(" #x "), %0" : "=r" (__l)); \
- __asm__ ("xor %1, %%tle_lox10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
- __asm__ ("add %%g7, %1, %0" : "=r" (__l) : "r" (__l)); \
- __l; })
-
-# ifdef __PIC__
-# define TLS_LOAD_PIC \
- ({ register long pc __asm__ ("%o7"); \
- long got; \
- __asm__ ("sethi %%hi(_GLOBAL_OFFSET_TABLE_-4), %1\n\t" \
- "call .+8\n\t" \
- "add %1, %%lo(_GLOBAL_OFFSET_TABLE_+4), %1\n\t" \
- "add %1, %0, %1\n\t" \
- : "=r" (pc), "=r" (got)); \
- got; })
-# else
-# define TLS_LOAD_PIC \
- ({ long got; \
- __asm__ (".hidden _GLOBAL_OFFSET_TABLE_\n\t" \
- "sethi %%hi(_GLOBAL_OFFSET_TABLE_), %0\n\t" \
- "or %0, %%lo(_GLOBAL_OFFSET_TABLE_), %0" \
- : "=r" (got)); \
- got; })
-# endif
-
-# define TLS_IE(x) \
- ({ int *__l; \
- __asm__ ("sethi %%tie_hi22(" #x "), %0" : "=r" (__l)); \
- __asm__ ("add %1, %%tie_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
- __asm__ ("ld [%1 + %2], %0, %%tie_ld(" #x ")" \
- : "=r" (__l) : "r" (TLS_LOAD_PIC), "r" (__l)); \
- __asm__ ("add %%g7, %1, %0, %%tie_add(" #x ")" : "=r" (__l) : "r" (__l)); \
- __l; })
-
-# define TLS_LD(x) \
- ({ int *__l; register void *__o0 __asm__ ("%o0"); \
- long __o; \
- __asm__ ("sethi %%tldm_hi22(" #x "), %0" : "=r" (__l)); \
- __asm__ ("add %1, %%tldm_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
- __asm__ ("add %1, %2, %0, %%tldm_add(" #x ")" \
- : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l)); \
- __asm__ ("call __tls_get_addr, %%tgd_call(" #x ")\n\t" \
- " nop" \
- : "=r" (__o0) : "0" (__o0) \
- : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4", \
- "o5", "o7", "cc"); \
- __asm__ ("sethi %%tldo_hix22(" #x "), %0" : "=r" (__o)); \
- __asm__ ("xor %1, %%tldo_lox10(" #x "), %0" : "=r" (__o) : "r" (__o)); \
- __asm__ ("add %1, %2, %0, %%tldo_add(" #x ")" : "=r" (__l) \
- : "r" (__o0), "r" (__o)); \
- __l; })
-
-# define TLS_GD(x) \
- ({ int *__l; register void *__o0 __asm__ ("%o0"); \
- __asm__ ("sethi %%tgd_hi22(" #x "), %0" : "=r" (__l)); \
- __asm__ ("add %1, %%tgd_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
- __asm__ ("add %1, %2, %0, %%tgd_add(" #x ")" \
- : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l)); \
- __asm__ ("call __tls_get_addr, %%tgd_call(" #x ")\n\t" \
- " nop" \
- : "=r" (__o0) : "0" (__o0) \
- : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4", \
- "o5", "o7", "cc"); \
- __o0; })
-
-#elif defined __sparc__ && defined __arch64__
-
-# define TLS_LE(x) \
- ({ int *__l; \
- __asm__ ("sethi %%tle_hix22(" #x "), %0" : "=r" (__l)); \
- __asm__ ("xor %1, %%tle_lox10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
- __asm__ ("add %%g7, %1, %0" : "=r" (__l) : "r" (__l)); \
- __l; })
-
-# ifdef __PIC__
-# define TLS_LOAD_PIC \
- ({ long pc, got; \
- __asm__ ("sethi %%hi(_GLOBAL_OFFSET_TABLE_-4), %1\n\t" \
- "rd %%pc, %0\n\t" \
- "add %1, %%lo(_GLOBAL_OFFSET_TABLE_+4), %1\n\t" \
- "add %1, %0, %1\n\t" \
- : "=r" (pc), "=r" (got)); \
- got; })
-# else
-# define TLS_LOAD_PIC \
- ({ long got; \
- __asm__ (".hidden _GLOBAL_OFFSET_TABLE_\n\t" \
- "sethi %%hi(_GLOBAL_OFFSET_TABLE_), %0\n\t" \
- "or %0, %%lo(_GLOBAL_OFFSET_TABLE_), %0" \
- : "=r" (got)); \
- got; })
-# endif
-
-# define TLS_IE(x) \
- ({ int *__l; \
- __asm__ ("sethi %%tie_hi22(" #x "), %0" : "=r" (__l)); \
- __asm__ ("add %1, %%tie_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
- __asm__ ("ldx [%1 + %2], %0, %%tie_ldx(" #x ")" \
- : "=r" (__l) : "r" (TLS_LOAD_PIC), "r" (__l)); \
- __asm__ ("add %%g7, %1, %0, %%tie_add(" #x ")" : "=r" (__l) : "r" (__l)); \
- __l; })
-
-# define TLS_LD(x) \
- ({ int *__l; register void *__o0 __asm__ ("%o0"); \
- long __o; \
- __asm__ ("sethi %%tldm_hi22(" #x "), %0" : "=r" (__l)); \
- __asm__ ("add %1, %%tldm_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
- __asm__ ("add %1, %2, %0, %%tldm_add(" #x ")" \
- : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l)); \
- __asm__ ("call __tls_get_addr, %%tgd_call(" #x ")\n\t" \
- " nop" \
- : "=r" (__o0) : "0" (__o0) \
- : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4", \
- "o5", "o7", "cc"); \
- __asm__ ("sethi %%tldo_hix22(" #x "), %0" : "=r" (__o)); \
- __asm__ ("xor %1, %%tldo_lox10(" #x "), %0" : "=r" (__o) : "r" (__o)); \
- __asm__ ("add %1, %2, %0, %%tldo_add(" #x ")" : "=r" (__l) \
- : "r" (__o0), "r" (__o)); \
- __l; })
-
-# define TLS_GD(x) \
- ({ int *__l; register void *__o0 __asm__ ("%o0"); \
- __asm__ ("sethi %%tgd_hi22(" #x "), %0" : "=r" (__l)); \
- __asm__ ("add %1, %%tgd_lo10(" #x "), %0" : "=r" (__l) : "r" (__l)); \
- __asm__ ("add %1, %2, %0, %%tgd_add(" #x ")" \
- : "=r" (__o0) : "r" (TLS_LOAD_PIC), "r" (__l)); \
- __asm__ ("call __tls_get_addr, %%tgd_call(" #x ")\n\t" \
- " nop" \
- : "=r" (__o0) : "0" (__o0) \
- : "g1", "g2", "g3", "g4", "g5", "g6", "o1", "o2", "o3", "o4", \
- "o5", "o7", "cc"); \
- __o0; })
-
-#elif defined __s390x__
-
-# define TLS_LE(x) \
- ({ unsigned long __offset; \
- __asm__ ("bras %0,1f\n" \
- "0:\t.quad " #x "@ntpoff\n" \
- "1:\tlg %0,0(%0)" \
- : "=a" (__offset) : : "cc" ); \
- (int *) (__builtin_thread_pointer() + __offset); })
-
-# ifdef __PIC__
-# define TLS_IE(x) \
- ({ unsigned long __offset; \
- __asm__ ("bras %0,1f\n" \
- "0:\t.quad " #x "@gotntpoff\n" \
- "1:\tlg %0,0(%0)\n\t" \
- "lg %0,0(%0,%%r12):tls_load:" #x \
- : "=&a" (__offset) : : "cc" ); \
- (int *) (__builtin_thread_pointer() + __offset); })
-# else
-# define TLS_IE(x) \
- ({ unsigned long __offset; \
- __asm__ ("bras %0,1f\n" \
- "0:\t.quad " #x "@indntpoff\n" \
- "1:\t lg %0,0(%0)\n\t" \
- "lg %0,0(%0):tls_load:" #x \
- : "=&a" (__offset) : : "cc" ); \
- (int *) (__builtin_thread_pointer() + __offset); })
-# endif
-
-# ifdef __PIC__
-# define TLS_LD(x) \
- ({ unsigned long __offset, __save12; \
- __asm__ ("bras %0,1f\n" \
- "0:\t.quad " #x "@tlsldm\n\t" \
- ".quad " #x "@dtpoff\n" \
- "1:\tlgr %1,%%r12\n\t" \
- "larl %%r12,_GLOBAL_OFFSET_TABLE_\n\t" \
- "lg %%r2,0(%0)\n\t" \
- "brasl %%r14,__tls_get_offset@plt:tls_ldcall:" #x "\n\t" \
- "lg %0,8(%0)\n\t" \
- "algr %0,%%r2\n\t" \
- "lgr %%r12,%1" \
- : "=&a" (__offset), "=&a" (__save12) \
- : : "cc", "0", "1", "2", "3", "4", "5", "14" ); \
- (int *) (__builtin_thread_pointer() + __offset); })
-# else
-# define TLS_LD(x) \
- ({ unsigned long __offset; \
- __asm__ ("bras %0,1f\n" \
- "0:\t.quad " #x "@tlsldm\n\t" \
- ".quad " #x "@dtpoff\n" \
- "1:\tlarl %%r12,_GLOBAL_OFFSET_TABLE_\n\t" \
- "lg %%r2,0(%0)\n\t" \
- "brasl %%r14,__tls_get_offset@plt:tls_ldcall:" #x "\n\t" \
- "lg %0,8(%0)\n\t" \
- "algr %0,%%r2" \
- : "=&a" (__offset) \
- : : "cc", "0", "1", "2", "3", "4", "5", "12", "14" ); \
- (int *) (__builtin_thread_pointer() + __offset); })
-# endif
-
-# ifdef __PIC__
-# define TLS_GD(x) \
- ({ unsigned long __offset, __save12; \
- __asm__ ("bras %0,1f\n" \
- "0:\t.quad " #x "@tlsgd\n" \
- "1:\tlgr %1,%%r12\n\t" \
- "larl %%r12,_GLOBAL_OFFSET_TABLE_\n\t" \
- "lg %%r2,0(%0)\n\t" \
- "brasl %%r14,__tls_get_offset@plt:tls_gdcall:" #x "\n\t" \
- "lgr %0,%%r2\n\t" \
- "lgr %%r12,%1" \
- : "=&a" (__offset), "=&a" (__save12) \
- : : "cc", "0", "1", "2", "3", "4", "5", "14" ); \
- (int *) (__builtin_thread_pointer() + __offset); })
-# else
-# define TLS_GD(x) \
- ({ unsigned long __offset; \
- __asm__ ("bras %0,1f\n" \
- "0:\t.quad " #x "@tlsgd\n" \
- "1:\tlarl %%r12,_GLOBAL_OFFSET_TABLE_\n\t" \
- "lg %%r2,0(%0)\n\t" \
- "brasl %%r14,__tls_get_offset@plt:tls_gdcall:" #x "\n\t" \
- "lgr %0,%%r2" \
- : "=&a" (__offset) \
- : : "cc", "0", "1", "2", "3", "4", "5", "12", "14" ); \
- (int *) (__builtin_thread_pointer() + __offset); })
-# endif
-
-#elif defined __s390__
-
-# define TLS_LE(x) \
- ({ unsigned long __offset; \
- __asm__ ("bras %0,1f\n" \
- "0:\t.long " #x "@ntpoff\n" \
- "1:\tl %0,0(%0)" \
- : "=a" (__offset) : : "cc" ); \
- (int *) (__builtin_thread_pointer() + __offset); })
-
-# ifdef __PIC__
-# define TLS_IE(x) \
- ({ unsigned long __offset; \
- __asm__ ("bras %0,1f\n" \
- "0:\t.long " #x "@gotntpoff\n" \
- "1:\tl %0,0(%0)\n\t" \
- "l %0,0(%0,%%r12):tls_load:" #x \
- : "=&a" (__offset) : : "cc" ); \
- (int *) (__builtin_thread_pointer() + __offset); })
-# else
-# define TLS_IE(x) \
- ({ unsigned long __offset; \
- __asm__ ("bras %0,1f\n" \
- "0:\t.long " #x "@indntpoff\n" \
- "1:\t l %0,0(%0)\n\t" \
- "l %0,0(%0):tls_load:" #x \
- : "=&a" (__offset) : : "cc" ); \
- (int *) (__builtin_thread_pointer() + __offset); })
-# endif
-
-# ifdef __PIC__
-# define TLS_LD(x) \
- ({ unsigned long __offset, __save12; \
- __asm__ ("bras %0,1f\n" \
- "0:\t.long _GLOBAL_OFFSET_TABLE_-0b\n\t" \
- ".long __tls_get_offset@plt-0b\n\t" \
- ".long " #x "@tlsldm\n\t" \
- ".long " #x "@dtpoff\n" \
- "1:\tlr %1,%%r12\n\t" \
- "l %%r12,0(%0)\n\t" \
- "la %%r12,0(%%r12,%0)\n\t" \
- "l %%r1,4(%0)\n\t" \
- "l %%r2,8(%0)\n\t" \
- "bas %%r14,0(%%r1,%0):tls_ldcall:" #x "\n\t" \
- "l %0,12(%0)\n\t" \
- "alr %0,%%r2\n\t" \
- "lr %%r12,%1" \
- : "=&a" (__offset), "=&a" (__save12) \
- : : "cc", "0", "1", "2", "3", "4", "5" ); \
- (int *) (__builtin_thread_pointer() + __offset); })
-# else
-# define TLS_LD(x) \
- ({ unsigned long __offset; \
- __asm__ ("bras %0,1f\n" \
- "0:\t.long _GLOBAL_OFFSET_TABLE_\n\t" \
- ".long __tls_get_offset@plt\n\t" \
- ".long " #x "@tlsldm\n\t" \
- ".long " #x "@dtpoff\n" \
- "1:\tl %%r12,0(%0)\n\t" \
- "l %%r1,4(%0)\n\t" \
- "l %%r2,8(%0)\n\t" \
- "bas %%r14,0(%%r1):tls_ldcall:" #x "\n\t" \
- "l %0,12(%0)\n\t" \
- "alr %0,%%r2" \
- : "=&a" (__offset) : : "cc", "0", "1", "2", "3", "4", "5", "12" ); \
- (int *) (__builtin_thread_pointer() + __offset); })
-# endif
-
-# ifdef __PIC__
-# define TLS_GD(x) \
- ({ unsigned long __offset, __save12; \
- __asm__ ("bras %0,1f\n" \
- "0:\t.long _GLOBAL_OFFSET_TABLE_-0b\n\t" \
- ".long __tls_get_offset@plt-0b\n\t" \
- ".long " #x "@tlsgd\n" \
- "1:\tlr %1,%%r12\n\t" \
- "l %%r12,0(%0)\n\t" \
- "la %%r12,0(%%r12,%0)\n\t" \
- "l %%r1,4(%0)\n\t" \
- "l %%r2,8(%0)\n\t" \
- "bas %%r14,0(%%r1,%0):tls_gdcall:" #x "\n\t" \
- "lr %0,%%r2\n\t" \
- "lr %%r12,%1" \
- : "=&a" (__offset), "=&a" (__save12) \
- : : "cc", "0", "1", "2", "3", "4", "5" ); \
- (int *) (__builtin_thread_pointer() + __offset); })
-# else
-# define TLS_GD(x) \
- ({ unsigned long __offset; \
- __asm__ ("bras %0,1f\n" \
- "0:\t.long _GLOBAL_OFFSET_TABLE_\n\t" \
- ".long __tls_get_offset@plt\n\t" \
- ".long " #x "@tlsgd\n" \
- "1:\tl %%r12,0(%0)\n\t" \
- "l %%r1,4(%0)\n\t" \
- "l %%r2,8(%0)\n\t" \
- "bas %%r14,0(%%r1):tls_gdcall:" #x "\n\t" \
- "lr %0,%%r2" \
- : "=&a" (__offset) : : "cc", "0", "1", "2", "3", "4", "5", "12" ); \
- (int *) (__builtin_thread_pointer() + __offset); })
-# endif
-
-#elif defined __powerpc__ && !defined __powerpc64__
-
-/*#include "config.h"*/
-
-# define __TLS_CALL_CLOBBERS \
- "0", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", \
- "lr", "ctr", "cr0", "cr1", "cr5", "cr6", "cr7"
-
-/* PowerPC32 Local Exec TLS access. */
-# define TLS_LE(x) \
- ({ int *__result; \
- __asm__ ("addi %0,2," #x "@tprel" \
- : "=r" (__result)); \
- __result; })
-
-/* PowerPC32 Initial Exec TLS access. */
-# ifdef HAVE_ASM_PPC_REL16
-# define TLS_IE(x) \
- ({ int *__result; \
- __asm__ ("bcl 20,31,1f\n1:\t" \
- "mflr %0\n\t" \
- "addis %0,%0,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t" \
- "addi %0,%0,_GLOBAL_OFFSET_TABLE_-1b@l\n\t" \
- "lwz %0," #x "@got@tprel(%0)\n\t" \
- "add %0,%0," #x "@tls" \
- : "=b" (__result) : \
- : "lr"); \
- __result; })
-# else
-# define TLS_IE(x) \
- ({ int *__result; \
- __asm__ ("bl _GLOBAL_OFFSET_TABLE_@local-4\n\t" \
- "mflr %0\n\t" \
- "lwz %0," #x "@got@tprel(%0)\n\t" \
- "add %0,%0," #x "@tls" \
- : "=b" (__result) : \
- : "lr"); \
- __result; })
-# endif
-
-/* PowerPC32 Local Dynamic TLS access. */
-# ifdef HAVE_ASM_PPC_REL16
-# define TLS_LD(x) \
- ({ int *__result; \
- __asm__ ("bcl 20,31,1f\n1:\t" \
- "mflr 3\n\t" \
- "addis 3,3,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t" \
- "addi 3,3,_GLOBAL_OFFSET_TABLE_-1b@l\n\t" \
- "addi 3,3," #x "@got@tlsld\n\t" \
- "bl __tls_get_addr@plt\n\t" \
- "addi %0,3," #x "@dtprel" \
- : "=r" (__result) : \
- : __TLS_CALL_CLOBBERS); \
- __result; })
-# else
-# define TLS_LD(x) \
- ({ int *__result; \
- __asm__ ("bl _GLOBAL_OFFSET_TABLE_@local-4\n\t" \
- "mflr 3\n\t" \
- "addi 3,3," #x "@got@tlsld\n\t" \
- "bl __tls_get_addr@plt\n\t" \
- "addi %0,3," #x "@dtprel" \
- : "=r" (__result) : \
- : __TLS_CALL_CLOBBERS); \
- __result; })
-# endif
-
-/* PowerPC32 General Dynamic TLS access. */
-# ifdef HAVE_ASM_PPC_REL16
-# define TLS_GD(x) \
- ({ register int *__result __asm__ ("r3"); \
- __asm__ ("bcl 20,31,1f\n1:\t" \
- "mflr 3\n\t" \
- "addis 3,3,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t" \
- "addi 3,3,_GLOBAL_OFFSET_TABLE_-1b@l\n\t" \
- "addi 3,3," #x "@got@tlsgd\n\t" \
- "bl __tls_get_addr@plt" \
- : : \
- : __TLS_CALL_CLOBBERS); \
- __result; })
-# else
-# define TLS_GD(x) \
- ({ register int *__result __asm__ ("r3"); \
- __asm__ ("bl _GLOBAL_OFFSET_TABLE_@local-4\n\t" \
- "mflr 3\n\t" \
- "addi 3,3," #x "@got@tlsgd\n\t" \
- "bl __tls_get_addr@plt" \
- : : \
- : __TLS_CALL_CLOBBERS); \
- __result; })
-# endif
-
-#elif defined __powerpc__ && defined __powerpc64__
-
-/* PowerPC64 Local Exec TLS access. */
-# define TLS_LE(x) \
- ({ int * __result; \
- __asm__ ( \
- " addis %0,13," #x "@tprel@ha\n" \
- " addi %0,%0," #x "@tprel@l\n" \
- : "=b" (__result) ); \
- __result; \
- })
-/* PowerPC64 Initial Exec TLS access. */
-# define TLS_IE(x) \
- ({ int * __result; \
- __asm__ ( \
- " ld %0," #x "@got@tprel(2)\n" \
- " add %0,%0," #x "@tls\n" \
- : "=b" (__result) ); \
- __result; \
- })
-/* PowerPC64 Local Dynamic TLS access. */
-# define TLS_LD(x) \
- ({ int * __result; \
- __asm__ ( \
- " addi 3,2," #x "@got@tlsld\n" \
- " bl .__tls_get_addr\n" \
- " nop \n" \
- " addis %0,3," #x "@dtprel@ha\n" \
- " addi %0,%0," #x "@dtprel@l\n" \
- : "=b" (__result) : \
- : "0", "3", "4", "5", "6", "7", \
- "8", "9", "10", "11", "12", \
- "lr", "ctr", \
- "cr0", "cr1", "cr5", "cr6", "cr7"); \
- __result; \
- })
-/* PowerPC64 General Dynamic TLS access. */
-# define TLS_GD(x) \
- ({ int * __result; \
- __asm__ ( \
- " addi 3,2," #x "@got@tlsgd\n" \
- " bl .__tls_get_addr\n" \
- " nop \n" \
- " mr %0,3\n" \
- : "=b" (__result) : \
- : "0", "3", "4", "5", "6", "7", \
- "8", "9", "10", "11", "12", \
- "lr", "ctr", \
- "cr0", "cr1", "cr5", "cr6", "cr7"); \
- __result; \
- })
-
-#elif defined __arc__
-
-/* For now */
-#define TLS_LD(x) TLS_IE(x)
-
-#define TLS_GD(x) \
- ({ int *__result; \
- __asm__ ("add r0, pcl, @" #x "@tlsgd \n" \
- ".tls_gd_ld " #x "`bl __tls_get_addr@plt \n" \
- "mov %0, r0 \n" \
- : "=&r" (__result) \
- ::"r0","r1","r2","r3","r4","r5","r6","r7", \
- "r8","r9","r10","r11","r12"); \
- __result; })
-
-#define TLS_LE(x) \
- ({ int *__result; \
- void *tp = __builtin_thread_pointer(); \
- __asm__ ("add %0, %1, @" #x "@tpoff \n" \
- : "=r" (__result) : "r"(tp)); \
- __result; })
-
-#define TLS_IE(x) \
- ({ int *__result; \
- void *tp = __builtin_thread_pointer(); \
- __asm__ ("ld %0, [pcl, @" #x "@tlsie] \n" \
- "add %0, %1, %0 \n" \
- : "=&r" (__result) : "r" (tp)); \
- __result; })
-
-#elif defined __xtensa__
-
-#if defined(__XTENSA_WINDOWED_ABI__)
-#define TLS_GD(x) \
- ({ int *__l; \
- __asm__ ("movi a8, " #x "@TLSFUNC\n\t" \
- "movi a10, " #x "@TLSARG\n\t" \
- "callx8.tls a8, " #x "@TLSCALL\n\t" \
- "mov %0, a10\n\t" \
- : "=r" (__l) \
- : \
- : "a8", "a9", "a10", "a11", "a12", "a13", "a14", "a15"); \
- __l; })
-
-#define TLS_LD(x) \
- ({ int *__l; \
- __asm__ ("movi a8, _TLS_MODULE_BASE_@TLSFUNC\n\t" \
- "movi a10, _TLS_MODULE_BASE_@TLSARG\n\t" \
- "callx8.tls a8, _TLS_MODULE_BASE_@TLSCALL\n\t" \
- "movi %0, " #x "@TPOFF\n\t" \
- "add %0, %0, a10\n\t" \
- : "=r" (__l) \
- : \
- : "a8", "a9", "a10", "a11", "a12", "a13", "a14", "a15"); \
- __l; })
-#elif defined(__XTENSA_CALL0_ABI__)
-#define TLS_GD(x) \
- ({ int *__l; \
- __asm__ ("movi a0, " #x "@TLSFUNC\n\t" \
- "movi a2, " #x "@TLSARG\n\t" \
- "callx0.tls a0, " #x "@TLSCALL\n\t" \
- "mov %0, a2\n\t" \
- : "=r" (__l) \
- : \
- : "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10", "a11");\
- __l; })
-
-#define TLS_LD(x) \
- ({ int *__l; \
- __asm__ ("movi a0, _TLS_MODULE_BASE_@TLSFUNC\n\t" \
- "movi a2, _TLS_MODULE_BASE_@TLSARG\n\t" \
- "callx0.tls a0, _TLS_MODULE_BASE_@TLSCALL\n\t" \
- "movi %0, " #x "@TPOFF\n\t" \
- "add %0, %0, a2\n\t" \
- : "=r" (__l) \
- : \
- : "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10", "a11");\
- __l; })
-#else
-#error Unsupported Xtensa ABI
+#ifdef __mips__
+#include <tls-macros-mips.h>
#endif
-#define TLS_IE(x) TLS_LE(x)
-
-#define TLS_LE(x) \
- ({ int *__l; \
- int __t; \
- __asm__ ("rur %0, threadptr\n\t" \
- "movi %1, " #x "@TPOFF\n\t" \
- "add %0, %0, %1\n\t" \
- : "=r" (__l), "=r" (__t) ); \
- __l; }); \
-
-#elif defined __metag__
+#ifdef __powerpc__
+#include <tls-macros-powerpc.h>
+#endif
-# define TLS_GD(x) \
- ({ void *__result; \
- extern void *__tls_get_addr (void *); \
- __asm__ ("MOV %0, A1LbP\n\t" \
- "ADD %0, %0, #(" #x "@TLSGD)" \
- : "=d" (__result)); \
- (int *)__tls_get_addr (__result); })
+#ifdef __sh__
+#include <tls-macros-sh.h>
+#endif
-# define TLS_LD(x) \
- ({ void *__result; \
- extern void *__tls_get_addr (void *); \
- __asm__ ("MOV %0, A1LbP\n\t" \
- "ADD %0, %0, #(" #x "@TLSLDM)" \
- : "=d" (__result)); \
- __result = __tls_get_addr (__result); \
- __asm__ ("ADDT %0,%0,#HI(" #x "@TLSLDO)\n\t" \
- "ADD %0,%0,#LO(" #x "@TLSLDO)" \
- : "+d" (__result)); \
- __result; })
+#ifdef __sparc__
+#include <tls-macros-sparc.h>
+#endif
-# define TLS_IE(x) \
- ({ void *__result; \
- unsigned long __rel; \
- extern void *__metag_load_tp (void); \
- __asm__ ("GETD %0,[A1LbP+#(" #x "@TLSIE)]" \
- : "=d" (__rel)); \
- __result = __metag_load_tp(); \
- __result + __rel; })
+#ifdef __x86_64__
+#include <tls-macros-x86_64.h>
+#endif
-# define TLS_LE(x) \
- ({ void *__result; \
- extern void *__metag_load_tp (void); \
- __result = __metag_load_tp(); \
- __asm__ ("ADDT %0,%0,#HI(" #x "@TLSLE)\n\t" \
- "ADD %0,%0,#LO(" #x "@TLSLE)" \
- : "+d" (__result)); \
- __result; })
+#ifdef __xtensa__
+#include <tls-macros-xtensa.h>
+#endif
-#elif !defined TLS_LE || !defined TLS_IE \
+#if !defined TLS_LE || !defined TLS_IE \
|| !defined TLS_LD || !defined TLS_GD
# error "No support for this architecture so far."
#endif
--
1.7.10.4
2
1
There are two copies of jmpbuf-unwind.h in the tree,
the NPTL one isn't really used. No regressions found
by embedded-test run.
Signed-off-by: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
---
libc/sysdeps/linux/alpha/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/arc/jmpbuf-unwind.h | 6 ----
libc/sysdeps/linux/arm/jmpbuf-unwind.h | 7 +----
libc/sysdeps/linux/avr32/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/bfin/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/c6x/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/cris/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/hppa/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/ia64/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/m68k/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/metag/bits/setjmp.h | 10 -------
libc/sysdeps/linux/metag/jmpbuf-offsets.h | 7 +++++
libc/sysdeps/linux/metag/jmpbuf-unwind.h | 8 ++++--
libc/sysdeps/linux/microblaze/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/mips/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/nios2/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/powerpc/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/sh/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/sparc/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/x86_64/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/xtensa/jmpbuf-unwind.h | 1 +
libpthread/nptl/sysdeps/alpha/jmpbuf-unwind.h | 27 -----------------
libpthread/nptl/sysdeps/arc/jmpbuf-unwind.h | 32 ---------------------
libpthread/nptl/sysdeps/arm/jmpbuf-unwind.h | 32 ---------------------
libpthread/nptl/sysdeps/i386/jmpbuf-unwind.h | 27 -----------------
libpthread/nptl/sysdeps/metag/jmpbuf-unwind.h | 35 -----------------------
libpthread/nptl/sysdeps/mips/jmpbuf-unwind.h | 26 -----------------
libpthread/nptl/sysdeps/powerpc/jmpbuf-unwind.h | 27 -----------------
libpthread/nptl/sysdeps/sh/jmpbuf-unwind.h | 27 -----------------
libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h | 27 -----------------
libpthread/nptl/sysdeps/x86_64/jmpbuf-unwind.h | 27 -----------------
libpthread/nptl/sysdeps/xtensa/jmpbuf-unwind.h | 32 ---------------------
32 files changed, 29 insertions(+), 344 deletions(-)
create mode 100644 libc/sysdeps/linux/metag/jmpbuf-offsets.h
delete mode 100644 libpthread/nptl/sysdeps/alpha/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/arc/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/arm/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/i386/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/metag/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/mips/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/powerpc/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/sh/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/x86_64/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/xtensa/jmpbuf-unwind.h
diff --git a/libc/sysdeps/linux/alpha/jmpbuf-unwind.h b/libc/sysdeps/linux/alpha/jmpbuf-unwind.h
index 80fe8b3..b14837e 100644
--- a/libc/sysdeps/linux/alpha/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/alpha/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
#include <jmpbuf-offsets.h>
diff --git a/libc/sysdeps/linux/arc/jmpbuf-unwind.h b/libc/sysdeps/linux/arc/jmpbuf-unwind.h
index 8c41816..d16506a 100644
--- a/libc/sysdeps/linux/arc/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/arc/jmpbuf-unwind.h
@@ -16,12 +16,6 @@
#include <stdint.h>
#include <unwind.h>
-/* Test if longjmp to JMPBUF would unwind the frame
- containing a local variable at ADDRESS. */
-#undef _JMPBUF_UNWINDS
-#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
- ((void *) (address) < (void *) demangle (jmpbuf[__JMP_BUF_SP]))
-
#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
_JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
diff --git a/libc/sysdeps/linux/arm/jmpbuf-unwind.h b/libc/sysdeps/linux/arm/jmpbuf-unwind.h
index d7b49e2..44f9a1b 100644
--- a/libc/sysdeps/linux/arm/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/arm/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
#include <jmpbuf-offsets.h>
@@ -15,12 +16,6 @@
#include <stdint.h>
#include <unwind.h>
-/* Test if longjmp to JMPBUF would unwind the frame
- containing a local variable at ADDRESS. */
-#undef _JMPBUF_UNWINDS
-#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
- ((void *) (address) < (void *) demangle (jmpbuf[__JMP_BUF_SP]))
-
#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
_JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
diff --git a/libc/sysdeps/linux/avr32/jmpbuf-unwind.h b/libc/sysdeps/linux/avr32/jmpbuf-unwind.h
index 5caa2ee..f19f491 100644
--- a/libc/sysdeps/linux/avr32/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/avr32/jmpbuf-unwind.h
@@ -5,6 +5,7 @@
* Public License. See the file "COPYING.LIB" in the main directory of this
* archive for more details.
*/
+
#include <setjmp.h>
#include <jmpbuf-offsets.h>
diff --git a/libc/sysdeps/linux/bfin/jmpbuf-unwind.h b/libc/sysdeps/linux/bfin/jmpbuf-unwind.h
index bb7a374..26b56db 100644
--- a/libc/sysdeps/linux/bfin/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/bfin/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
/* Test if longjmp to JMPBUF would unwind the frame
diff --git a/libc/sysdeps/linux/c6x/jmpbuf-unwind.h b/libc/sysdeps/linux/c6x/jmpbuf-unwind.h
index ad2ab59..58eb18a 100644
--- a/libc/sysdeps/linux/c6x/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/c6x/jmpbuf-unwind.h
@@ -17,6 +17,7 @@
* along with this program; see the file COPYING.LIB. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#include <setjmp.h>
#include <jmpbuf-offsets.h>
diff --git a/libc/sysdeps/linux/cris/jmpbuf-unwind.h b/libc/sysdeps/linux/cris/jmpbuf-unwind.h
index 8b75dce..b5950ad 100644
--- a/libc/sysdeps/linux/cris/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/cris/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
#include <jmpbuf-offsets.h>
diff --git a/libc/sysdeps/linux/hppa/jmpbuf-unwind.h b/libc/sysdeps/linux/hppa/jmpbuf-unwind.h
index 0590754..efed134 100644
--- a/libc/sysdeps/linux/hppa/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/hppa/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
#include <jmpbuf-offsets.h>
diff --git a/libc/sysdeps/linux/ia64/jmpbuf-unwind.h b/libc/sysdeps/linux/ia64/jmpbuf-unwind.h
index 91e2df8..4eb0eea 100644
--- a/libc/sysdeps/linux/ia64/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/ia64/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
/* Test if longjmp to JMPBUF would unwind the frame containing a local
diff --git a/libc/sysdeps/linux/m68k/jmpbuf-unwind.h b/libc/sysdeps/linux/m68k/jmpbuf-unwind.h
index d87ace3..c5a8886 100644
--- a/libc/sysdeps/linux/m68k/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/m68k/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
/* Test if longjmp to JMPBUF would unwind the frame
diff --git a/libc/sysdeps/linux/metag/bits/setjmp.h b/libc/sysdeps/linux/metag/bits/setjmp.h
index 8ad4b12..d80a355 100644
--- a/libc/sysdeps/linux/metag/bits/setjmp.h
+++ b/libc/sysdeps/linux/metag/bits/setjmp.h
@@ -28,17 +28,7 @@
*/
#define _JBLEN 24
-#if defined (__USE_MISC) || defined (_ASM)
-#define JB_SP 0
-#endif
-#ifndef _ASM
typedef int __jmp_buf[_JBLEN] __attribute__((aligned (8)));
-#endif
-
-/* Test if longjmp to JMPBUF would unwind the frame
- containing a local variable at ADDRESS. */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
- ((void *) (address) > (void *) (jmpbuf)[JB_SP])
#endif /* bits/setjmp.h */
diff --git a/libc/sysdeps/linux/metag/jmpbuf-offsets.h b/libc/sysdeps/linux/metag/jmpbuf-offsets.h
new file mode 100644
index 0000000..e4faf42
--- /dev/null
+++ b/libc/sysdeps/linux/metag/jmpbuf-offsets.h
@@ -0,0 +1,7 @@
+/*
+ * Copyright (C) 2013, Imagination Technologies Ltd.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define JB_SP 0
diff --git a/libc/sysdeps/linux/metag/jmpbuf-unwind.h b/libc/sysdeps/linux/metag/jmpbuf-unwind.h
index 175cd7a..bf79141 100644
--- a/libc/sysdeps/linux/metag/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/metag/jmpbuf-unwind.h
@@ -1,14 +1,16 @@
/*
+ * Copyright (C) 2013, Imagination Technologies Ltd.
+ *
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <setjmp.h>
+#include <jmpbuf-offsets.h>
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
-#undef _JMPBUF_UNWINDS
-#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
- ((void *) (address) > (void *) demangle (jmpbuf[JB_SP]))
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+ ((void *) (address) > (void *) jmpbuf[JB_SP])
#ifdef __UCLIBC_HAS_THREADS_NATIVE__
#include <stdint.h>
diff --git a/libc/sysdeps/linux/microblaze/jmpbuf-unwind.h b/libc/sysdeps/linux/microblaze/jmpbuf-unwind.h
index a24cd12..2c1c079 100644
--- a/libc/sysdeps/linux/microblaze/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/microblaze/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
/* Test if longjmp to JMPBUF would unwind the frame
diff --git a/libc/sysdeps/linux/mips/jmpbuf-unwind.h b/libc/sysdeps/linux/mips/jmpbuf-unwind.h
index 2c0df95..3242eae 100644
--- a/libc/sysdeps/linux/mips/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/mips/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
/* Test if longjmp to JMPBUF would unwind the frame
diff --git a/libc/sysdeps/linux/nios2/jmpbuf-unwind.h b/libc/sysdeps/linux/nios2/jmpbuf-unwind.h
index 64cd55f..c22ab24 100644
--- a/libc/sysdeps/linux/nios2/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/nios2/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
/* Test if longjmp to JMPBUF would unwind the frame
diff --git a/libc/sysdeps/linux/powerpc/jmpbuf-unwind.h b/libc/sysdeps/linux/powerpc/jmpbuf-unwind.h
index 54322b8..d650b32 100644
--- a/libc/sysdeps/linux/powerpc/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/powerpc/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
#include <jmpbuf-offsets.h>
diff --git a/libc/sysdeps/linux/sh/jmpbuf-unwind.h b/libc/sysdeps/linux/sh/jmpbuf-unwind.h
index 8875cc1..34977df 100644
--- a/libc/sysdeps/linux/sh/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/sh/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
/* Test if longjmp to JMPBUF would unwind the frame
diff --git a/libc/sysdeps/linux/sparc/jmpbuf-unwind.h b/libc/sysdeps/linux/sparc/jmpbuf-unwind.h
index 90efb77..31449d8 100644
--- a/libc/sysdeps/linux/sparc/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/sparc/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
#include <jmpbuf-offsets.h>
diff --git a/libc/sysdeps/linux/x86_64/jmpbuf-unwind.h b/libc/sysdeps/linux/x86_64/jmpbuf-unwind.h
index 1525872..b3f39b5 100644
--- a/libc/sysdeps/linux/x86_64/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/x86_64/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
#include <jmpbuf-offsets.h>
diff --git a/libc/sysdeps/linux/xtensa/jmpbuf-unwind.h b/libc/sysdeps/linux/xtensa/jmpbuf-unwind.h
index 4516d93..13161e9 100644
--- a/libc/sysdeps/linux/xtensa/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/xtensa/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
#include <jmpbuf-offsets.h>
diff --git a/libpthread/nptl/sysdeps/alpha/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/alpha/jmpbuf-unwind.h
deleted file mode 100644
index 2f64e7d..0000000
--- a/libpthread/nptl/sysdeps/alpha/jmpbuf-unwind.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)redhat.com>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
diff --git a/libpthread/nptl/sysdeps/arc/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/arc/jmpbuf-unwind.h
deleted file mode 100644
index 11a043b..0000000
--- a/libpthread/nptl/sysdeps/arc/jmpbuf-unwind.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 2005,2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-/* Test if longjmp to JMPBUF would unwind the frame
- containing a local variable at ADDRESS. */
-#undef _JMPBUF_UNWINDS
-#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
- ((void *) (address) < (void *) demangle (jmpbuf[__JMP_BUF_SP]))
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[__JMP_BUF_SP] - (_adj))
diff --git a/libpthread/nptl/sysdeps/arm/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/arm/jmpbuf-unwind.h
deleted file mode 100644
index 11a043b..0000000
--- a/libpthread/nptl/sysdeps/arm/jmpbuf-unwind.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 2005,2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-/* Test if longjmp to JMPBUF would unwind the frame
- containing a local variable at ADDRESS. */
-#undef _JMPBUF_UNWINDS
-#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
- ((void *) (address) < (void *) demangle (jmpbuf[__JMP_BUF_SP]))
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[__JMP_BUF_SP] - (_adj))
diff --git a/libpthread/nptl/sysdeps/i386/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/i386/jmpbuf-unwind.h
deleted file mode 100644
index 2f64e7d..0000000
--- a/libpthread/nptl/sysdeps/i386/jmpbuf-unwind.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)redhat.com>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
diff --git a/libpthread/nptl/sysdeps/metag/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/metag/jmpbuf-unwind.h
deleted file mode 100644
index b3da6bd..0000000
--- a/libpthread/nptl/sysdeps/metag/jmpbuf-unwind.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)redhat.com>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-/* Test if longjmp to JMPBUF would unwind the frame
- containing a local variable at ADDRESS. */
-#undef _JMPBUF_UNWINDS
-#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
- ((void *) (address) > (void *) demangle (jmpbuf[JB_SP]))
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) > (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
-
-#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
diff --git a/libpthread/nptl/sysdeps/mips/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/mips/jmpbuf-unwind.h
deleted file mode 100644
index 9739efd..0000000
--- a/libpthread/nptl/sysdeps/mips/jmpbuf-unwind.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Copyright (C) 2003, 2005 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[0].__sp - (_adj))
diff --git a/libpthread/nptl/sysdeps/powerpc/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/powerpc/jmpbuf-unwind.h
deleted file mode 100644
index 4a88b04..0000000
--- a/libpthread/nptl/sysdeps/powerpc/jmpbuf-unwind.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)redhat.com>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_GPR1] - (_adj))
diff --git a/libpthread/nptl/sysdeps/sh/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sh/jmpbuf-unwind.h
deleted file mode 100644
index 2f7f852..0000000
--- a/libpthread/nptl/sysdeps/sh/jmpbuf-unwind.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)redhat.com>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(jmpbuf, address, adj) \
- ((uintptr_t) (address) - (adj) < (uintptr_t) (jmpbuf)[0].__regs[7] - (adj))
diff --git a/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
deleted file mode 100644
index 2f64e7d..0000000
--- a/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)redhat.com>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
diff --git a/libpthread/nptl/sysdeps/x86_64/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/x86_64/jmpbuf-unwind.h
deleted file mode 100644
index 304bf85..0000000
--- a/libpthread/nptl/sysdeps/x86_64/jmpbuf-unwind.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)redhat.com>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_RSP] - (_adj))
diff --git a/libpthread/nptl/sysdeps/xtensa/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/xtensa/jmpbuf-unwind.h
deleted file mode 100644
index bda498b..0000000
--- a/libpthread/nptl/sysdeps/xtensa/jmpbuf-unwind.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 2005,2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-/* Test if longjmp to JMPBUF would unwind the frame
- containing a local variable at ADDRESS. */
-#undef _JMPBUF_UNWINDS
-#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
- ((void *) (address) < (void *) demangle (jmpbuf[JB_SP]))
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
--
1.7.10.4
2
1
Hi Maintainers,
How would you like to handle global reorganization patches touching
arch specific parts. Do you would like to be in Cc?
How long should I wait for a comment or veto?
I sent out two patches recently, one today only to the mailinglist.
Thanks for your opinion.
best regards
Waldemar
3
2
This is a slightly odd series of 2 patches. The two patches are
actually alternative solutions to the same problem. I'm keen to see
one of these merged, but I don't know which method would be preferred.
This commit aims to address an issue that was introduced / mentioned
in commit 20554a78a9bba278c6b9cbbb4cfc5bde3772c56d (ARC:
Conditionalise certain relocations as provided by TLS tools only).
The problem is that not all historic versions of binutils have
supported the @pcl relocation type. This problem is compounded by the
fact that the arithmetic construct that was previously used to
synthesise an @pcl like behaviour, does not work on recent versions of
binutils.
In the commit 20554a78a code was added that selects between the new
style @pcl relocations, and the old style arithmetic construct,
however, this selection is done based on whether the uClibc user has
configured with native threads or not.
Of course, a uClibc user could choose to use a modern version of
binutils AND configure without native thread support, in which case
uClibc will not compile.
I have two proposed solutions. In patch 1/2 I simply drop support for
the older versions of binutils in favour of the new @pcl relocation
type. This feels the cleanest solution, but I don't know how strongly
the uClibc(-ng) community feels about maintaining compatibility for
older versions of the tools.
Given that I anticipated push back against the first patch I took a
look at how I might maintain compatibility. It turns out to be pretty
easy, and that is patch 2/2. In this patch I drew inspiration from
similar examples in the Rules.mak file to check if the toolchain
supports @pcl relocations or not. With this done we have a new define
based on the specific toolchain feature being supported or not, which
can then be used to conditionalise the code.
Would you consider merging one of these patches?
Thanks,
Andrew
3
4
uClibc-ng - small C library for embedded systems branch master updated. v1.0.16-9-g345181f
by wbx@helium.openadk.org 17 Jul '16
by wbx@helium.openadk.org 17 Jul '16
17 Jul '16
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via 345181fb9a36ad18c0a40ccb74bff9ee4d03819b (commit)
via a072066753e15c3a82bc32f89c1eef277af0b31e (commit)
via 4458cc330e6e5b7369151ebe172c00faceb43ade (commit)
from ff58e44fc38474b1898c59caf9a5e75d0d8c6c57 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 345181fb9a36ad18c0a40ccb74bff9ee4d03819b
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Mon Jul 11 16:59:22 2016 +0200
cleanup CALL_MCOUNT / PROF
As this is only implemented for a few architecture and not well
tested, just remove it.
commit a072066753e15c3a82bc32f89c1eef277af0b31e
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Sun Jul 17 02:41:43 2016 +0200
x86_64: remove dead code, SHARED is not defined when compiling
commit 4458cc330e6e5b7369151ebe172c00faceb43ade
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Fri Jul 8 16:01:41 2016 +0200
cleanup PTR_MANGLE/PTR_DEMANGLE support
As this is only implemented for a few architecture and not well
tested, just remove it.
Reviewed-by: Max Filippov <jcmvbkbc(a)gmail.com>
-----------------------------------------------------------------------
Summary of changes:
libc/sysdeps/linux/arc/sysdep.h | 5 --
libc/sysdeps/linux/arm/sysdep.h | 18 +------
libc/sysdeps/linux/i386/sysdep.h | 45 +---------------
libc/sysdeps/linux/ia64/sysdep.h | 8 +--
libc/sysdeps/linux/metag/sysdep.h | 4 --
libc/sysdeps/linux/mips/sysdep.h | 6 ---
libc/sysdeps/linux/powerpc/bits/syscalls.h | 26 ----------
libc/sysdeps/linux/sh/sysdep.h | 43 +---------------
libc/sysdeps/linux/sparc/sysdep.h | 5 --
libc/sysdeps/linux/x86_64/sched_getcpu.S | 20 +++-----
libc/sysdeps/linux/x86_64/sysdep.h | 60 +---------------------
libc/sysdeps/linux/xtensa/sysdep.h | 13 +----
.../nptl/sysdeps/pthread/pthread-functions.h | 8 ---
.../nptl/sysdeps/pthread/unwind-forcedunwind.c | 8 ---
14 files changed, 15 insertions(+), 254 deletions(-)
diff --git a/libc/sysdeps/linux/arc/sysdep.h b/libc/sysdeps/linux/arc/sysdep.h
index d75d891..5fcc63d 100644
--- a/libc/sysdeps/linux/arc/sysdep.h
+++ b/libc/sysdeps/linux/arc/sysdep.h
@@ -18,9 +18,4 @@ nm:
#endif /* __ASSEMBLER __*/
#include <common/sysdep.h>
-
-/* Pointer mangling is not yet supported */
-#define PTR_MANGLE(var) (void) (var)
-#define PTR_DEMANGLE(var) (void) (var)
-
#endif
diff --git a/libc/sysdeps/linux/arm/sysdep.h b/libc/sysdeps/linux/arm/sysdep.h
index cdc276c..f8f2f8a 100644
--- a/libc/sysdeps/linux/arm/sysdep.h
+++ b/libc/sysdeps/linux/arm/sysdep.h
@@ -67,23 +67,12 @@
.globl C_SYMBOL_NAME(name); \
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function) \
.align ALIGNARG(4); \
- name##: \
- CALL_MCOUNT
+ name##:
#undef END
#define END(name) \
ASM_SIZE_DIRECTIVE(name)
-/* If compiled for profiling, call `mcount' at the start of each function. */
-#ifdef PROF
-#define CALL_MCOUNT \
- str lr,[sp, #-4]! ; \
- bl PLTJMP(mcount) ; \
- ldr lr, [sp], #4 ;
-#else
-#define CALL_MCOUNT /* Do nothing. */
-#endif
-
#ifdef NO_UNDERSCORES
/* Since C identifiers are not normally prefixed with an underscore
on this system, the asm identifier `syscall_error' intrudes on the
@@ -277,9 +266,4 @@ __local_syscall_error: \
#define UNDOARGS_7 ldmfd sp!, {r4, r5, r6};
#endif /* __ASSEMBLER__ */
-
-/* Pointer mangling is not yet supported for ARM. */
-#define PTR_MANGLE(var) (void) (var)
-#define PTR_DEMANGLE(var) (void) (var)
-
#endif /* linux/arm/sysdep.h */
diff --git a/libc/sysdeps/linux/i386/sysdep.h b/libc/sysdeps/linux/i386/sysdep.h
index c92a106..79e53a1 100644
--- a/libc/sysdeps/linux/i386/sysdep.h
+++ b/libc/sysdeps/linux/i386/sysdep.h
@@ -47,26 +47,13 @@
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
.align ALIGNARG(4); \
C_LABEL(name) \
- cfi_startproc; \
- CALL_MCOUNT
+ cfi_startproc;
#undef END
#define END(name) \
cfi_endproc; \
ASM_SIZE_DIRECTIVE(name) \
-/* If compiled for profiling, call `mcount' at the start of each function. */
-#ifdef PROF
-/* The mcount code relies on a normal frame pointer being on the stack
- to locate our caller, so push one just for its benefit. */
-#define CALL_MCOUNT \
- pushl %ebp; cfi_adjust_cfa_offset (4); movl %esp, %ebp; \
- cfi_def_cfa_register (ebp); call JUMPTARGET(mcount); \
- popl %ebp; cfi_def_cfa (esp, 4);
-#else
-#define CALL_MCOUNT /* Do nothing. */
-#endif
-
#ifdef NO_UNDERSCORES
/* Since C identifiers are not normally prefixed with an underscore
on this system, the asm identifier `syscall_error' intrudes on the
@@ -396,34 +383,4 @@ __x86.get_pc_thunk.reg: \
cfi_restore (ebp); L(POPBP1):
#endif /* __ASSEMBLER__ */
-
-
-/* Pointer mangling support. */
-#if defined NOT_IN_libc && defined IS_IN_rtld
-/* We cannot use the thread descriptor because in ld.so we use setjmp
- earlier than the descriptor is initialized. Using a global variable
- is too complicated here since we have no PC-relative addressing mode. */
-#else
-# ifdef __ASSEMBLER__
-# define PTR_MANGLE(reg) xorl %gs:POINTER_GUARD, reg; \
- roll $9, reg
-# define PTR_DEMANGLE(reg) rorl $9, reg; \
- xorl %gs:POINTER_GUARD, reg
-# else
-# include <stddef.h>
-# define PTR_MANGLE(var) __asm__ ("xorl %%gs:%c2, %0\n" \
- "roll $9, %0" \
- : "=r" (var) \
- : "0" (var), \
- "i" (offsetof (tcbhead_t, \
- pointer_guard)))
-# define PTR_DEMANGLE(var) __asm__ ("rorl $9, %0\n" \
- "xorl %%gs:%c2, %0" \
- : "=r" (var) \
- : "0" (var), \
- "i" (offsetof (tcbhead_t, \
- pointer_guard)))
-# endif
-#endif
-
#endif /* linux/i386/sysdep.h */
diff --git a/libc/sysdeps/linux/ia64/sysdep.h b/libc/sysdeps/linux/ia64/sysdep.h
index 3e7e467..3662114 100644
--- a/libc/sysdeps/linux/ia64/sysdep.h
+++ b/libc/sysdeps/linux/ia64/sysdep.h
@@ -39,15 +39,12 @@
#define C_LABEL(name) name/**/:
#endif
-#define CALL_MCOUNT
-
#define ENTRY(name) \
.text; \
.align 32; \
.proc C_SYMBOL_NAME(name); \
.global C_SYMBOL_NAME(name); \
- C_LABEL(name) \
- CALL_MCOUNT
+ C_LABEL(name)
#define HIDDEN_ENTRY(name) \
.text; \
@@ -55,8 +52,7 @@
.proc C_SYMBOL_NAME(name); \
.global C_SYMBOL_NAME(name); \
.hidden C_SYMBOL_NAME(name); \
- C_LABEL(name) \
- CALL_MCOUNT
+ C_LABEL(name)
#define LEAF(name) \
.text; \
diff --git a/libc/sysdeps/linux/metag/sysdep.h b/libc/sysdeps/linux/metag/sysdep.h
index a12f393..8750641 100644
--- a/libc/sysdeps/linux/metag/sysdep.h
+++ b/libc/sysdeps/linux/metag/sysdep.h
@@ -53,7 +53,3 @@ __local_syscall_error: \
#endif
#endif /* __ASSEMBLER __*/
-
-/* Pointer mangling is not yet supported for META. */
-#define PTR_MANGLE(var) (void) (var)
-#define PTR_DEMANGLE(var) (void) (var)
diff --git a/libc/sysdeps/linux/mips/sysdep.h b/libc/sysdeps/linux/mips/sysdep.h
index 86873ac..e0c5c94 100644
--- a/libc/sysdeps/linux/mips/sysdep.h
+++ b/libc/sysdeps/linux/mips/sysdep.h
@@ -128,11 +128,5 @@ L(syse1):
# define SYSCALL_ERROR_LABEL 99b
#endif
-#else /* ! __ASSEMBLER__ */
-
-/* Pointer mangling is not yet supported for MIPS. */
-#define PTR_MANGLE(var) (void) (var)
-#define PTR_DEMANGLE(var) (void) (var)
-
#endif /* __ASSEMBLER__ */
#endif /* _LINUX_MIPS_SYSDEP_H */
diff --git a/libc/sysdeps/linux/powerpc/bits/syscalls.h b/libc/sysdeps/linux/powerpc/bits/syscalls.h
index c52d5dd..d0f78c3 100644
--- a/libc/sysdeps/linux/powerpc/bits/syscalls.h
+++ b/libc/sysdeps/linux/powerpc/bits/syscalls.h
@@ -226,30 +226,4 @@ extern void __illegally_sized_syscall_arg6(void);
# define ASM_INPUT_6 ASM_INPUT_5, "6" (r8)
#endif /* __ASSEMBLER__ */
-
-
-/* Pointer mangling support. */
-#if defined NOT_IN_libc && defined IS_IN_rtld
-/* We cannot use the thread descriptor because in ld.so we use setjmp
- earlier than the descriptor is initialized. */
-#else
-# ifdef __ASSEMBLER__
-# define PTR_MANGLE(reg, tmpreg) \
- lwz tmpreg,POINTER_GUARD(r2); \
- xor reg,tmpreg,reg
-# define PTR_MANGLE2(reg, tmpreg) \
- xor reg,tmpreg,reg
-# define PTR_MANGLE3(destreg, reg, tmpreg) \
- lwz tmpreg,POINTER_GUARD(r2); \
- xor destreg,tmpreg,reg
-# define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg)
-# define PTR_DEMANGLE2(reg, tmpreg) PTR_MANGLE2 (reg, tmpreg)
-# define PTR_DEMANGLE3(destreg, reg, tmpreg) PTR_MANGLE3 (destreg, reg, tmpreg)
-# else
-# define PTR_MANGLE(var) \
- (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ())
-# define PTR_DEMANGLE(var) PTR_MANGLE (var)
-# endif
-#endif
-
#endif /* _BITS_SYSCALLS_H */
diff --git a/libc/sysdeps/linux/sh/sysdep.h b/libc/sysdeps/linux/sh/sysdep.h
index b9b0009..137dd1d 100644
--- a/libc/sysdeps/linux/sh/sysdep.h
+++ b/libc/sysdeps/linux/sh/sysdep.h
@@ -42,34 +42,13 @@
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function) \
.align ALIGNARG(5); \
C_LABEL(name) \
- cfi_startproc; \
- CALL_MCOUNT
+ cfi_startproc;
#undef END
#define END(name) \
cfi_endproc; \
ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(name))
-/* If compiled for profiling, call `mcount' at the start of each function. */
-#ifdef PROF
-#define CALL_MCOUNT \
- mov.l 1f,r1; \
- sts.l pr,@-r15; \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (pr, 0); \
- mova 2f,r0; \
- jmp @r1; \
- lds r0,pr; \
- .align 2; \
-1: .long mcount; \
-2: lds.l @r15+,pr; \
- cfi_adjust_cfa_offset (-4); \
- cfi_restore (pr)
-
-#else
-#define CALL_MCOUNT /* Do nothing. */
-#endif
-
#ifdef __UCLIBC_UNDERSCORES__
/* Since C identifiers are not normally prefixed with an underscore
on this system, the asm identifier `syscall_error' intrudes on the
@@ -271,23 +250,3 @@
1: .long SYS_ify (syscall_name); \
2:
#endif /* __ASSEMBLER__ */
-
-/* Pointer mangling support. */
-#if defined NOT_IN_libc && defined IS_IN_rtld
-/* We cannot use the thread descriptor because in ld.so we use setjmp
- earlier than the descriptor is initialized. Using a global variable
- is too complicated here since we have no PC-relative addressing mode. */
-#else
-# ifdef __ASSEMBLER__
-# define PTR_MANGLE(reg, tmp) \
- stc gbr,tmp; mov.l @(POINTER_GUARD,tmp),tmp; xor tmp,reg
-# define PTR_MANGLE2(reg, tmp) xor tmp,reg
-# define PTR_DEMANGLE(reg, tmp) PTR_MANGLE (reg, tmp)
-# define PTR_DEMANGLE2(reg, tmp) PTR_MANGLE2 (reg, tmp)
-# else
-# define PTR_MANGLE(var) \
- (var) = (void *) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ())
-# define PTR_DEMANGLE(var) PTR_MANGLE (var)
-# endif
-#endif
-
diff --git a/libc/sysdeps/linux/sparc/sysdep.h b/libc/sysdeps/linux/sparc/sysdep.h
index cf3e3af..c3897ec 100644
--- a/libc/sysdeps/linux/sparc/sysdep.h
+++ b/libc/sysdeps/linux/sparc/sysdep.h
@@ -61,9 +61,4 @@ ENTRY(name); \
#endif /* __ASSEMBLER__ */
-
-/* Pointer mangling is not yet supported for SPARC. */
-#define PTR_MANGLE(var) (void) (var)
-#define PTR_DEMANGLE(var) (void) (var)
-
#endif
diff --git a/libc/sysdeps/linux/x86_64/sched_getcpu.S b/libc/sysdeps/linux/x86_64/sched_getcpu.S
index f8c09c0..3964bf1 100644
--- a/libc/sysdeps/linux/x86_64/sched_getcpu.S
+++ b/libc/sysdeps/linux/x86_64/sched_getcpu.S
@@ -35,27 +35,21 @@ ENTRY (sched_getcpu)
movl $VGETCPU_CACHE_OFFSET, %edx
addq %fs:0, %rdx
-#ifdef SHARED
- movq __vdso_getcpu(%rip), %rax
- PTR_DEMANGLE (%rax)
- callq *%rax
-#else
-# ifdef __NR_getcpu
+#ifdef __NR_getcpu
movl $__NR_getcpu, %eax
syscall
-# ifndef __ASSUME_GETCPU_SYSCALL
+# ifndef __ASSUME_GETCPU_SYSCALL
cmpq $-ENOSYS, %rax
jne 1f
-# endif
# endif
-# ifndef __ASSUME_GETCPU_SYSCALL
+#endif
+#ifndef __ASSUME_GETCPU_SYSCALL
movq $VSYSCALL_ADDR_vgetcpu, %rax
callq *%rax
1:
-# else
-# ifndef __NR_getcpu
-# error "cannot happen"
-# endif
+#else
+# ifndef __NR_getcpu
+# error "cannot happen"
# endif
#endif
diff --git a/libc/sysdeps/linux/x86_64/sysdep.h b/libc/sysdeps/linux/x86_64/sysdep.h
index 3bfeaca..a5971d7 100644
--- a/libc/sysdeps/linux/x86_64/sysdep.h
+++ b/libc/sysdeps/linux/x86_64/sysdep.h
@@ -42,30 +42,13 @@
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
.align ALIGNARG(4); \
C_LABEL(name) \
- cfi_startproc; \
- CALL_MCOUNT
+ cfi_startproc;
#undef END
#define END(name) \
cfi_endproc; \
ASM_SIZE_DIRECTIVE(name)
-/* If compiled for profiling, call `mcount' at the start of each function. */
-#ifdef PROF
-/* The mcount code relies on a normal frame pointer being on the stack
- to locate our caller, so push one just for its benefit. */
-#define CALL_MCOUNT \
- pushq %rbp; \
- cfi_adjust_cfa_offset(8); \
- movq %rsp, %rbp; \
- cfi_def_cfa_register(%rbp); \
- call JUMPTARGET(mcount); \
- popq %rbp; \
- cfi_def_cfa(rsp,8);
-#else
-#define CALL_MCOUNT /* Do nothing. */
-#endif
-
#ifdef NO_UNDERSCORES
/* Since C identifiers are not normally prefixed with an underscore
on this system, the asm identifier `syscall_error' intrudes on the
@@ -286,45 +269,4 @@ lose: \
# define DOARGS_6 DOARGS_5
#endif /* __ASSEMBLER__ */
-
-
-/* Pointer mangling support. */
-#if defined NOT_IN_libc && defined IS_IN_rtld
-/* We cannot use the thread descriptor because in ld.so we use setjmp
- earlier than the descriptor is initialized. */
-# ifdef __ASSEMBLER__
-# define PTR_MANGLE(reg) xorq __pointer_chk_guard_local(%rip), reg; \
- rolq $17, reg
-# define PTR_DEMANGLE(reg) rorq $17, reg; \
- xorq __pointer_chk_guard_local(%rip), reg
-# else
-# define PTR_MANGLE(reg) __asm__ ("xorq __pointer_chk_guard_local(%%rip), %0\n" \
- "rolq $17, %0" \
- : "=r" (reg) : "0" (reg))
-# define PTR_DEMANGLE(reg) __asm__ ("rorq $17, %0\n" \
- "xorq __pointer_chk_guard_local(%%rip), %0" \
- : "=r" (reg) : "0" (reg))
-# endif
-#else
-# ifdef __ASSEMBLER__
-# define PTR_MANGLE(reg) xorq %fs:POINTER_GUARD, reg; \
- rolq $17, reg
-# define PTR_DEMANGLE(reg) rorq $17, reg; \
- xorq %fs:POINTER_GUARD, reg
-# else
-# define PTR_MANGLE(var) __asm__ ("xorq %%fs:%c2, %0\n" \
- "rolq $17, %0" \
- : "=r" (var) \
- : "0" (var), \
- "i" (offsetof (tcbhead_t, \
- pointer_guard)))
-# define PTR_DEMANGLE(var) __asm__ ("rorq $17, %0\n" \
- "xorq %%fs:%c2, %0" \
- : "=r" (var) \
- : "0" (var), \
- "i" (offsetof (tcbhead_t, \
- pointer_guard)))
-# endif
-#endif
-
#endif /* linux/x86_64/sysdep.h */
diff --git a/libc/sysdeps/linux/xtensa/sysdep.h b/libc/sysdeps/linux/xtensa/sysdep.h
index f5a40eb..8d1bfcf 100644
--- a/libc/sysdeps/linux/xtensa/sysdep.h
+++ b/libc/sysdeps/linux/xtensa/sysdep.h
@@ -45,8 +45,7 @@
.align ALIGNARG(2); \
LITERAL_POSITION; \
C_LABEL(name) \
- abi_entry(sp, FRAMESIZE); \
- CALL_MCOUNT
+ abi_entry(sp, FRAMESIZE);
#define HIDDEN_ENTRY(name) \
.globl C_SYMBOL_NAME(name); \
@@ -55,8 +54,7 @@
.align ALIGNARG(2); \
LITERAL_POSITION; \
C_LABEL(name) \
- abi_entry(sp, FRAMESIZE); \
- CALL_MCOUNT
+ abi_entry(sp, FRAMESIZE);
#undef END
#define END(name) ASM_SIZE_DIRECTIVE(name)
@@ -92,8 +90,6 @@
#error Unsupported Xtensa ABI
#endif
#endif
-#define CALL_MCOUNT /* Do nothing. */
-
/* Linux uses a negative return value to indicate syscall errors,
unlike most Unices, which use the condition codes' carry flag.
@@ -207,9 +203,4 @@
#endif /* _LIBC_REENTRANT */
#endif /* __ASSEMBLER__ */
-
-/* Pointer mangling is not yet supported for Xtensa. */
-#define PTR_MANGLE(var) (void) (var)
-#define PTR_DEMANGLE(var) (void) (var)
-
#endif /* _LINUX_XTENSA_SYSDEP_H */
diff --git a/libpthread/nptl/sysdeps/pthread/pthread-functions.h b/libpthread/nptl/sysdeps/pthread/pthread-functions.h
index 119fe6b..9c78180 100644
--- a/libpthread/nptl/sysdeps/pthread/pthread-functions.h
+++ b/libpthread/nptl/sysdeps/pthread/pthread-functions.h
@@ -102,15 +102,7 @@ struct pthread_functions
extern struct pthread_functions __libc_pthread_functions attribute_hidden;
extern int __libc_pthread_functions_init attribute_hidden;
-#if 0 /* def PTR_DEMANGLE */ /* we did not mangle, so do not demangle */
-# define PTHFCT_CALL(fct, params) \
- ({ __typeof (__libc_pthread_functions.fct) __p; \
- __p = __libc_pthread_functions.fct; \
- PTR_DEMANGLE (__p); \
- __p params; })
-#else
# define PTHFCT_CALL(fct, params) \
__libc_pthread_functions.fct params
-#endif
#endif /* pthread-functions.h */
diff --git a/libpthread/nptl/sysdeps/pthread/unwind-forcedunwind.c b/libpthread/nptl/sysdeps/pthread/unwind-forcedunwind.c
index 6936a89..6b6ad6f 100644
--- a/libpthread/nptl/sysdeps/pthread/unwind-forcedunwind.c
+++ b/libpthread/nptl/sysdeps/pthread/unwind-forcedunwind.c
@@ -70,13 +70,9 @@ pthread_cancel_init (void)
abort();
}
- PTR_MANGLE (resume);
libgcc_s_resume = resume;
- PTR_MANGLE (personality);
libgcc_s_personality = personality;
- PTR_MANGLE (forcedunwind);
libgcc_s_forcedunwind = forcedunwind;
- PTR_MANGLE (getcfa);
libgcc_s_getcfa = getcfa;
/* Make sure libgcc_s_handle is written last. Otherwise,
pthread_cancel_init might return early even when the pointer the
@@ -104,7 +100,6 @@ _Unwind_Resume (struct _Unwind_Exception *exc)
pthread_cancel_init ();
void (*resume) (struct _Unwind_Exception *exc) = libgcc_s_resume;
- PTR_DEMANGLE (resume);
resume (exc);
}
@@ -125,7 +120,6 @@ __gcc_personality_v0 (int version, _Unwind_Action actions,
_Unwind_Reason_Code (*personality)
(int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *,
struct _Unwind_Context *) = libgcc_s_personality;
- PTR_DEMANGLE (personality);
return personality (version, actions, exception_class, ue_header, context);
}
@@ -139,7 +133,6 @@ _Unwind_ForcedUnwind (struct _Unwind_Exception *exc, _Unwind_Stop_Fn stop,
_Unwind_Reason_Code (*forcedunwind)
(struct _Unwind_Exception *, _Unwind_Stop_Fn, void *)
= libgcc_s_forcedunwind;
- PTR_DEMANGLE (forcedunwind);
return forcedunwind (exc, stop, stop_argument);
}
@@ -150,6 +143,5 @@ _Unwind_GetCFA (struct _Unwind_Context *context)
pthread_cancel_init ();
_Unwind_Word (*getcfa) (struct _Unwind_Context *) = libgcc_s_getcfa;
- PTR_DEMANGLE (getcfa);
return getcfa (context);
}
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
1
0
uClibc-ng - small C library for embedded systems branch master updated. v1.0.16-6-gff58e44
by wbx@helium.openadk.org 17 Jul '16
by wbx@helium.openadk.org 17 Jul '16
17 Jul '16
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via ff58e44fc38474b1898c59caf9a5e75d0d8c6c57 (commit)
from 084e597e9f8e630e9b3fc7044d544699ad5d2886 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit ff58e44fc38474b1898c59caf9a5e75d0d8c6c57
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Sun Jul 17 02:23:24 2016 +0200
mips: add regdef.h glibc compatibility header
-----------------------------------------------------------------------
Summary of changes:
libc/sysdeps/linux/mips/Makefile.arch | 3 +--
{libpthread/nptl/sysdeps => libc/sysdeps/linux}/mips/regdef.h | 4 ++--
2 files changed, 3 insertions(+), 4 deletions(-)
copy {libpthread/nptl/sysdeps => libc/sysdeps/linux}/mips/regdef.h (86%)
diff --git a/libc/sysdeps/linux/mips/Makefile.arch b/libc/sysdeps/linux/mips/Makefile.arch
index 2c2e66f..844bc2b 100644
--- a/libc/sysdeps/linux/mips/Makefile.arch
+++ b/libc/sysdeps/linux/mips/Makefile.arch
@@ -20,5 +20,4 @@ SSRC-$(UCLIBC_HAS_CONTEXT_FUNCS) += makecontext.S setcontext.S getcontext.S \
ASFLAGS-syscall_error.S += -D_LIBC_REENTRANT
-ARCH_HEADERS := sgidefs.h
-# regdef.h
+ARCH_HEADERS := sgidefs.h regdef.h
diff --git a/libpthread/nptl/sysdeps/mips/regdef.h b/libc/sysdeps/linux/mips/regdef.h
similarity index 86%
copy from libpthread/nptl/sysdeps/mips/regdef.h
copy to libc/sysdeps/linux/mips/regdef.h
index e4ebd9a..64cffbf 100644
--- a/libpthread/nptl/sysdeps/mips/regdef.h
+++ b/libc/sysdeps/linux/mips/regdef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ralf Baechle <ralf(a)gnu.org>.
@@ -13,7 +13,7 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
+ License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
#ifndef _REGDEF_H
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
1
0
Hi,
I am extending my test coverage and doing some tests with
static/debug/nothreads/ssp builds.
ARCv1 le is failing when threads are disabled:
/home/wbx/openadk/toolchain_nsim-arcv1_uclibc-ng_arc700/usr/bin/arc-openadk-linux-uclibc-gcc
-c libc/sysdeps/linux/common/nanosleep.c -o
libc/sysdeps/linux/common/nanosleep.os -Wall -Wstrict-prototypes
-Wstrict-aliasing -funsigned-char -fno-builtin -fno-asm
-fmerge-all-constants -std=gnu99 -mlock -mswape -mA7
-fno-stack-protector -nostdinc -I./include -I./include -include
libc-symbols.h -I./libc/sysdeps/linux/arc -I./libc/sysdeps/linux
-I./ldso/ldso/arc -I./ldso/include -I. -Os -fstrict-aliasing -fwrapv
-fno-ident -mcpu=arc700 -Os -pipe -fomit-frame-pointer
-fno-unwind-tables -fno-asynchronous-unwind-tables
-I./libc/sysdeps/linux/common -isystem
/home/wbx/openadk/toolchain_nsim-arcv1_uclibc-ng_arc700/usr/lib/gcc/arc-openadk-linux-uclibc/4.8.5/include-fixed
-isystem
/home/wbx/openadk/toolchain_nsim-arcv1_uclibc-ng_arc700/usr/lib/gcc/arc-openadk-linux-uclibc/4.8.5/include
-I/home/wbx/openadk/target_nsim-arcv1_uclibc-ng_arc700/usr/include/
-DNDEBUG -DIN_LIB=libc -fPIC -MT
libc/sysdeps/linux/common/nanosleep.os -MD -MP -MF
libc/sysdeps/linux/common/.nanosleep.os.dep
{standard input}: Assembler messages:
{standard input}:15: Error: invalid operands (.bss and .text
sections) for `-'
{standard input}:15: Error: invalid operands (.text and *ABS*
sections) for `&'
{standard input}:17: Error: invalid operands (.text.exit and .text
sections) for `-'
{standard input}:17: Error: invalid operands (.text and *ABS*
sections) for `&'
./ldso/ldso/arc/dl-sysdep.h:156: Error: invalid operands (.text and
*ABS* sections) for `&'
make[6]: *** [ldso/ldso/ldso.oS] Error 1
make[6]: *** Waiting for unfinished jobs....
Any idea?
uClibc-ng 1.0.16, ARC toolchain 2016.03.
best regards
Waldemar
3
3
As this is only implemented for a few architecture and not well
tested, just remove it.
Signed-off-by: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
---
Another cleanup patch for sysdep.h. Any comments?
---
libc/sysdeps/linux/arm/sysdep.h | 13 +------------
libc/sysdeps/linux/i386/sysdep.h | 15 +--------------
libc/sysdeps/linux/ia64/sysdep.h | 8 ++------
libc/sysdeps/linux/sh/sysdep.h | 23 +----------------------
libc/sysdeps/linux/x86_64/sysdep.h | 19 +------------------
libc/sysdeps/linux/xtensa/sysdep.h | 8 ++------
6 files changed, 8 insertions(+), 78 deletions(-)
diff --git a/libc/sysdeps/linux/arm/sysdep.h b/libc/sysdeps/linux/arm/sysdep.h
index 208521f..f8f2f8a 100644
--- a/libc/sysdeps/linux/arm/sysdep.h
+++ b/libc/sysdeps/linux/arm/sysdep.h
@@ -67,23 +67,12 @@
.globl C_SYMBOL_NAME(name); \
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function) \
.align ALIGNARG(4); \
- name##: \
- CALL_MCOUNT
+ name##:
#undef END
#define END(name) \
ASM_SIZE_DIRECTIVE(name)
-/* If compiled for profiling, call `mcount' at the start of each function. */
-#ifdef PROF
-#define CALL_MCOUNT \
- str lr,[sp, #-4]! ; \
- bl PLTJMP(mcount) ; \
- ldr lr, [sp], #4 ;
-#else
-#define CALL_MCOUNT /* Do nothing. */
-#endif
-
#ifdef NO_UNDERSCORES
/* Since C identifiers are not normally prefixed with an underscore
on this system, the asm identifier `syscall_error' intrudes on the
diff --git a/libc/sysdeps/linux/i386/sysdep.h b/libc/sysdeps/linux/i386/sysdep.h
index 4fa47fc..79e53a1 100644
--- a/libc/sysdeps/linux/i386/sysdep.h
+++ b/libc/sysdeps/linux/i386/sysdep.h
@@ -47,26 +47,13 @@
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
.align ALIGNARG(4); \
C_LABEL(name) \
- cfi_startproc; \
- CALL_MCOUNT
+ cfi_startproc;
#undef END
#define END(name) \
cfi_endproc; \
ASM_SIZE_DIRECTIVE(name) \
-/* If compiled for profiling, call `mcount' at the start of each function. */
-#ifdef PROF
-/* The mcount code relies on a normal frame pointer being on the stack
- to locate our caller, so push one just for its benefit. */
-#define CALL_MCOUNT \
- pushl %ebp; cfi_adjust_cfa_offset (4); movl %esp, %ebp; \
- cfi_def_cfa_register (ebp); call JUMPTARGET(mcount); \
- popl %ebp; cfi_def_cfa (esp, 4);
-#else
-#define CALL_MCOUNT /* Do nothing. */
-#endif
-
#ifdef NO_UNDERSCORES
/* Since C identifiers are not normally prefixed with an underscore
on this system, the asm identifier `syscall_error' intrudes on the
diff --git a/libc/sysdeps/linux/ia64/sysdep.h b/libc/sysdeps/linux/ia64/sysdep.h
index 3e7e467..3662114 100644
--- a/libc/sysdeps/linux/ia64/sysdep.h
+++ b/libc/sysdeps/linux/ia64/sysdep.h
@@ -39,15 +39,12 @@
#define C_LABEL(name) name/**/:
#endif
-#define CALL_MCOUNT
-
#define ENTRY(name) \
.text; \
.align 32; \
.proc C_SYMBOL_NAME(name); \
.global C_SYMBOL_NAME(name); \
- C_LABEL(name) \
- CALL_MCOUNT
+ C_LABEL(name)
#define HIDDEN_ENTRY(name) \
.text; \
@@ -55,8 +52,7 @@
.proc C_SYMBOL_NAME(name); \
.global C_SYMBOL_NAME(name); \
.hidden C_SYMBOL_NAME(name); \
- C_LABEL(name) \
- CALL_MCOUNT
+ C_LABEL(name)
#define LEAF(name) \
.text; \
diff --git a/libc/sysdeps/linux/sh/sysdep.h b/libc/sysdeps/linux/sh/sysdep.h
index 281c415..137dd1d 100644
--- a/libc/sysdeps/linux/sh/sysdep.h
+++ b/libc/sysdeps/linux/sh/sysdep.h
@@ -42,34 +42,13 @@
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function) \
.align ALIGNARG(5); \
C_LABEL(name) \
- cfi_startproc; \
- CALL_MCOUNT
+ cfi_startproc;
#undef END
#define END(name) \
cfi_endproc; \
ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(name))
-/* If compiled for profiling, call `mcount' at the start of each function. */
-#ifdef PROF
-#define CALL_MCOUNT \
- mov.l 1f,r1; \
- sts.l pr,@-r15; \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (pr, 0); \
- mova 2f,r0; \
- jmp @r1; \
- lds r0,pr; \
- .align 2; \
-1: .long mcount; \
-2: lds.l @r15+,pr; \
- cfi_adjust_cfa_offset (-4); \
- cfi_restore (pr)
-
-#else
-#define CALL_MCOUNT /* Do nothing. */
-#endif
-
#ifdef __UCLIBC_UNDERSCORES__
/* Since C identifiers are not normally prefixed with an underscore
on this system, the asm identifier `syscall_error' intrudes on the
diff --git a/libc/sysdeps/linux/x86_64/sysdep.h b/libc/sysdeps/linux/x86_64/sysdep.h
index 0e51001..a5971d7 100644
--- a/libc/sysdeps/linux/x86_64/sysdep.h
+++ b/libc/sysdeps/linux/x86_64/sysdep.h
@@ -42,30 +42,13 @@
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
.align ALIGNARG(4); \
C_LABEL(name) \
- cfi_startproc; \
- CALL_MCOUNT
+ cfi_startproc;
#undef END
#define END(name) \
cfi_endproc; \
ASM_SIZE_DIRECTIVE(name)
-/* If compiled for profiling, call `mcount' at the start of each function. */
-#ifdef PROF
-/* The mcount code relies on a normal frame pointer being on the stack
- to locate our caller, so push one just for its benefit. */
-#define CALL_MCOUNT \
- pushq %rbp; \
- cfi_adjust_cfa_offset(8); \
- movq %rsp, %rbp; \
- cfi_def_cfa_register(%rbp); \
- call JUMPTARGET(mcount); \
- popq %rbp; \
- cfi_def_cfa(rsp,8);
-#else
-#define CALL_MCOUNT /* Do nothing. */
-#endif
-
#ifdef NO_UNDERSCORES
/* Since C identifiers are not normally prefixed with an underscore
on this system, the asm identifier `syscall_error' intrudes on the
diff --git a/libc/sysdeps/linux/xtensa/sysdep.h b/libc/sysdeps/linux/xtensa/sysdep.h
index 060b9b9..8d1bfcf 100644
--- a/libc/sysdeps/linux/xtensa/sysdep.h
+++ b/libc/sysdeps/linux/xtensa/sysdep.h
@@ -45,8 +45,7 @@
.align ALIGNARG(2); \
LITERAL_POSITION; \
C_LABEL(name) \
- abi_entry(sp, FRAMESIZE); \
- CALL_MCOUNT
+ abi_entry(sp, FRAMESIZE);
#define HIDDEN_ENTRY(name) \
.globl C_SYMBOL_NAME(name); \
@@ -55,8 +54,7 @@
.align ALIGNARG(2); \
LITERAL_POSITION; \
C_LABEL(name) \
- abi_entry(sp, FRAMESIZE); \
- CALL_MCOUNT
+ abi_entry(sp, FRAMESIZE);
#undef END
#define END(name) ASM_SIZE_DIRECTIVE(name)
@@ -92,8 +90,6 @@
#error Unsupported Xtensa ABI
#endif
#endif
-#define CALL_MCOUNT /* Do nothing. */
-
/* Linux uses a negative return value to indicate syscall errors,
unlike most Unices, which use the condition codes' carry flag.
--
1.7.10.4
1
0
Hi,
I want to add following cleanup patch.
No regressions found.
Okay? Comments?
best regards
Waldemar
2
4
When building using BuildRoot, I get the below errors.
I have not dived into determine what the problem is yet,
but was asking first in case anyone else has experienced
this problem.
Thanks,
Andy
MKDIR lib
CC libm/acosf.os
CC libm/acoshf.os
In file included from ./libpthread/nptl/../nptl_db/thread_db.h:28:0,
from ./libpthread/nptl/descr.h:31,
from ./libpthread/nptl/pthreadP.h:26,
from <stdin>:2:
./include/sys/procfs.h:55:34: error: conflicting types for 'elf_vrreg_t'
} __attribute__ ((aligned (16))) elf_vrreg_t;
^
In file included from ./libpthread/nptl/../nptl_db/thread_db.h:28:0,
from ./libpthread/nptl/descr.h:31,
from ./libpthread/nptl/pthreadP.h:26,
from <stdin>:1:
./include/sys/procfs.h:55:34: error: conflicting types for 'elf_vrreg_t'
} __attribute__ ((aligned (16))) elf_vrreg_t;
^
In file included from /home/akennedy/base_layer/build/rfs/t1010/buildroot-2016.02/output/build/linux-headers-3.12.55/usr/include/asm/sigcontext.h:13:0,
from ./include/bits/sigcontext.h:30,
from ./include/signal.h:420,
from ./include/sys/procfs.h:26,
from ./libpthread/nptl/../nptl_db/thread_db.h:28,
from ./libpthread/nptl/descr.h:31,
from ./libpthread/nptl/pthreadP.h:26,
from <stdin>:2:
/home/akennedy/base_layer/build/rfs/t1010/buildroot-2016.02/output/build/linux-headers-3.12.55/usr/include/asm/elf.h:153:21: note: previous declaration of 'elf_vrreg_t' was here
typedef __vector128 elf_vrreg_t;
^
In file included from /home/akennedy/base_layer/build/rfs/t1010/buildroot-2016.02/output/build/linux-headers-3.12.55/usr/include/asm/sigcontext.h:13:0,
from ./include/bits/sigcontext.h:30,
from ./include/signal.h:420,
from ./include/sys/procfs.h:26,
from ./libpthread/nptl/../nptl_db/thread_db.h:28,
from ./libpthread/nptl/descr.h:31,
from ./libpthread/nptl/pthreadP.h:26,
from <stdin>:1:
/home/akennedy/base_layer/build/rfs/t1010/buildroot-2016.02/output/build/linux-headers-3.12.55/usr/include/asm/elf.h:153:21: note: previous declaration of 'elf_vrreg_t' was here
typedef __vector128 elf_vrreg_t;
^
In file included from ./libpthread/nptl/../nptl_db/thread_db.h:28:0,
from ./libpthread/nptl/descr.h:31,
from ./libpthread/nptl/pthreadP.h:26,
from <stdin>:2:
./include/sys/procfs.h:56:21: error: conflicting types for 'elf_vrregset_t'
typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
^
In file included from ./libpthread/nptl/../nptl_db/thread_db.h:28:0,
from ./libpthread/nptl/descr.h:31,
from ./libpthread/nptl/pthreadP.h:26,
from <stdin>:1:
./include/sys/procfs.h:56:21: error: conflicting types for 'elf_vrregset_t'
typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
^
In file included from /home/akennedy/base_layer/build/rfs/t1010/buildroot-2016.02/output/build/linux-headers-3.12.55/usr/include/asm/sigcontext.h:13:0,
from ./include/bits/sigcontext.h:30,
from ./include/signal.h:420,
from ./include/sys/procfs.h:26,
from ./libpthread/nptl/../nptl_db/thread_db.h:28,
from ./libpthread/nptl/descr.h:31,
from ./libpthread/nptl/pthreadP.h:26,
from <stdin>:2:
/home/akennedy/base_layer/build/rfs/t1010/buildroot-2016.02/output/build/linux-headers-3.12.55/usr/include/asm/elf.h:154:21: note: previous declaration of 'elf_vrregset_t' was here
typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
^
In file included from /home/akennedy/base_layer/build/rfs/t1010/buildroot-2016.02/output/build/linux-headers-3.12.55/usr/include/asm/sigcontext.h:13:0,
from ./include/bits/sigcontext.h:30,
from ./include/signal.h:420,
from ./include/sys/procfs.h:26,
from ./libpthread/nptl/../nptl_db/thread_db.h:28,
from ./libpthread/nptl/descr.h:31,
from ./libpthread/nptl/pthreadP.h:26,
from <stdin>:1:
/home/akennedy/base_layer/build/rfs/t1010/buildroot-2016.02/output/build/linux-headers-3.12.55/usr/include/asm/elf.h:154:21: note: previous declaration of 'elf_vrregset_t' was here
typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
^
In file included from ./libpthread/nptl/sysdeps/powerpc/../../../nptl_db/thread_db.h:28:0,
from ./libpthread/nptl/sysdeps/powerpc/../../descr.h:31,
from ./libpthread/nptl/sysdeps/powerpc/tls.h:70,
from ./include/tls.h:6,
from ./include/bits/libc-lock.h:36,
from ./include/bits/stdio-lock.h:22,
from ./include/bits/uClibc_mutex.h:73,
from ./include/bits/uClibc_stdio.h:83,
from ./include/stdio.h:71,
from <stdin>:2:
./include/sys/procfs.h:55:34: error: conflicting types for 'elf_vrreg_t'
} __attribute__ ((aligned (16))) elf_vrreg_t;
^
In file included from /home/akennedy/base_layer/build/rfs/t1010/buildroot-2016.02/output/build/linux-headers-3.12.55/usr/include/asm/sigcontext.h:13:0,
from ./include/bits/sigcontext.h:30,
from ./include/signal.h:420,
from ./include/sys/procfs.h:26,
from ./libpthread/nptl/sysdeps/powerpc/../../../nptl_db/thread_db.h:28,
from ./libpthread/nptl/sysdeps/powerpc/../../descr.h:31,
from ./libpthread/nptl/sysdeps/powerpc/tls.h:70,
from ./include/tls.h:6,
from ./include/bits/libc-lock.h:36,
from ./include/bits/stdio-lock.h:22,
from ./include/bits/uClibc_mutex.h:73,
from ./include/bits/uClibc_stdio.h:83,
from ./include/stdio.h:71,
from <stdin>:2:
/home/akennedy/base_layer/build/rfs/t1010/buildroot-2016.02/output/build/linux-headers-3.12.55/usr/include/asm/elf.h:153:21: note: previous declaration of 'elf_vrreg_t' was here
typedef __vector128 elf_vrreg_t;
^
In file included from ./libpthread/nptl/sysdeps/powerpc/../../../nptl_db/thread_db.h:28:0,
from ./libpthread/nptl/sysdeps/powerpc/../../descr.h:31,
from ./libpthread/nptl/sysdeps/powerpc/tls.h:70,
from ./include/tls.h:6,
from ./include/bits/libc-lock.h:36,
from ./include/bits/stdio-lock.h:22,
from ./include/bits/uClibc_mutex.h:73,
from ./include/bits/uClibc_stdio.h:83,
from ./include/stdio.h:71,
from <stdin>:2:
./include/sys/procfs.h:56:21: error: conflicting types for 'elf_vrregset_t'
typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
^
In file included from /home/akennedy/base_layer/build/rfs/t1010/buildroot-2016.02/output/build/linux-headers-3.12.55/usr/include/asm/sigcontext.h:13:0,
from ./include/bits/sigcontext.h:30,
from ./include/signal.h:420,
from ./include/sys/procfs.h:26,
from ./libpthread/nptl/sysdeps/powerpc/../../../nptl_db/thread_db.h:28,
from ./libpthread/nptl/sysdeps/powerpc/../../descr.h:31,
from ./libpthread/nptl/sysdeps/powerpc/tls.h:70,
from ./include/tls.h:6,
from ./include/bits/libc-lock.h:36,
from ./include/bits/stdio-lock.h:22,
from ./include/bits/uClibc_mutex.h:73,
from ./include/bits/uClibc_stdio.h:83,
from ./include/stdio.h:71,
from <stdin>:2:
/home/akennedy/base_layer/build/rfs/t1010/buildroot-2016.02/output/build/linux-headers-3.12.55/usr/include/asm/elf.h:154:21: note: previous declaration of 'elf_vrregset_t' was here
typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
^
CC libm/asinf.os
CC libm/asinhf.os
CC libm/atan2f.os
make[1]: *** [libpthread/nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.h] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [libpthread/nptl/sysdeps/unix/sysv/linux/pthread-pi-defines.h] Error 1
make[1]: *** [libpthread/nptl/sysdeps/unix/sysv/linux/lowlevelrwlock.h] Error 1
In file included from ./libpthread/nptl/sysdeps/powerpc/../../../nptl_db/thread_db.h:28:0,
from ./libpthread/nptl/sysdeps/powerpc/../../descr.h:31,
from ./libpthread/nptl/sysdeps/powerpc/tls.h:70,
from ./include/tls.h:6,
from <stdin>:2:
./include/sys/procfs.h:55:34: error: conflicting types for 'elf_vrreg_t'
} __attribute__ ((aligned (16))) elf_vrreg_t;
^
In file included from /home/akennedy/base_layer/build/rfs/t1010/buildroot-2016.02/output/build/linux-headers-3.12.55/usr/include/asm/sigcontext.h:13:0,
from ./include/bits/sigcontext.h:30,
from ./include/signal.h:420,
from ./include/sys/procfs.h:26,
from ./libpthread/nptl/sysdeps/powerpc/../../../nptl_db/thread_db.h:28,
from ./libpthread/nptl/sysdeps/powerpc/../../descr.h:31,
from ./libpthread/nptl/sysdeps/powerpc/tls.h:70,
from ./include/tls.h:6,
from <stdin>:2:
/home/akennedy/base_layer/build/rfs/t1010/buildroot-2016.02/output/build/linux-headers-3.12.55/usr/include/asm/elf.h:153:21: note: previous declaration of 'elf_vrreg_t' was here
typedef __vector128 elf_vrreg_t;
^
In file included from ./libpthread/nptl/sysdeps/powerpc/../../../nptl_db/thread_db.h:28:0,
from ./libpthread/nptl/sysdeps/powerpc/../../descr.h:31,
from ./libpthread/nptl/sysdeps/powerpc/tls.h:70,
from ./include/tls.h:6,
from <stdin>:2:
./include/sys/procfs.h:56:21: error: conflicting types for 'elf_vrregset_t'
typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
^
In file included from /home/akennedy/base_layer/build/rfs/t1010/buildroot-2016.02/output/build/linux-headers-3.12.55/usr/include/asm/sigcontext.h:13:0,
from ./include/bits/sigcontext.h:30,
from ./include/signal.h:420,
from ./include/sys/procfs.h:26,
from ./libpthread/nptl/sysdeps/powerpc/../../../nptl_db/thread_db.h:28,
from ./libpthread/nptl/sysdeps/powerpc/../../descr.h:31,
from ./libpthread/nptl/sysdeps/powerpc/tls.h:70,
from ./include/tls.h:6,
from <stdin>:2:
/home/akennedy/base_layer/build/rfs/t1010/buildroot-2016.02/output/build/linux-headers-3.12.55/usr/include/asm/elf.h:154:21: note: previous declaration of 'elf_vrregset_t' was here
typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
^
make[1]: *** [libpthread/nptl/sysdeps/powerpc/tcb-offsets.h] Error 1
make[1]: Leaving directory `/home/akennedy/base_layer/build/rfs/t1010/buildroot-2016.02/output/build/uclibc-1.0.12'
make: *** [/home/akennedy/base_layer/build/rfs/t1010/buildroot-2016.02/output/build/uclibc-1.0.12/.stamp_built] Error 2
3
2