# HG changeset patch # User "Yann E. MORIN" # Date 1315829371 -7200 # Node ID 3e81e43c0e146b3646dffde3f15e52fe981375ec # Parent d7d4c6336f8feeeac2d9bfa310b9385d665a57c1 libc/uClibc: workaround for a MIPS TLS issue Some macros declarations were missing, so we duplicate them. See the added patch description for more information. ----> THIS IS A DIRTY HACK! <---- Signed-off-by: "Yann E. MORIN" diff -r d7d4c6336f8f -r 3e81e43c0e14 patches/uClibc/0.9.32/160-fix-TLS-DTPREL-TPREL-macros.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/uClibc/0.9.32/160-fix-TLS-DTPREL-TPREL-macros.patch Mon Sep 12 14:09:31 2011 +0200 @@ -0,0 +1,40 @@ +ldso/mips: workaround for missing TLS macros in elfinterpret.c + +These macros declarations are missing, so gcc believes the code is calling +a function, so any later linking will fail. + +Work this around by copying the mcaros from: + libpthread/nptl/sysdeps/mips/dl-tls.h + +We can't include the header because of incompatible symbol declarations, +so we just copy the macros for now. + +----> THIS IS A DIRTY HACK! <---- + +Signed-off-by: "Yann E. MORIN" + +diff -durN uClibc-0.9.32.orig/ldso/ldso/mips/elfinterp.c uClibc-0.9.32/ldso/ldso/mips/elfinterp.c +--- uClibc-0.9.32.orig/ldso/ldso/mips/elfinterp.c 2011-06-08 21:35:20.000000000 +0200 ++++ uClibc-0.9.32/ldso/ldso/mips/elfinterp.c 2011-09-12 14:02:37.553628824 +0200 +@@ -34,6 +34,21 @@ + + #define OFFSET_GP_GOT 0x7ff0 + ++/* The thread pointer points 0x7000 past the first static TLS block. */ ++#define TLS_TP_OFFSET 0x7000 ++ ++/* Dynamic thread vector pointers point 0x8000 past the start of each ++ * TLS block. */ ++#define TLS_DTV_OFFSET 0x8000 ++ ++/* Compute the value for a GOTTPREL reloc. */ ++#define TLS_TPREL_VALUE(sym_map, sym_val) \ ++ ((sym_map)->l_tls_offset + sym_val - TLS_TP_OFFSET) ++ ++/* Compute the value for a DTPREL reloc. */ ++#define TLS_DTPREL_VALUE(sym_val) \ ++ (sym_val - TLS_DTV_OFFSET) ++ + unsigned long __dl_runtime_resolve(unsigned long sym_index, + unsigned long old_gpreg) + {