aboutsummaryrefslogtreecommitdiffstats
path: root/toolchain/uClibc/patches-0.9.33.2/612-mips64_relocation_fix.patch
blob: 7edeee17d050e7f45e2c2f61bc8368ee71c864ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
commit 052bcf13afb067cafac5e7f4fc21fbad2b34b11f
Author: Waldemar Brodkorb <wbx@openadk.org>
Date:   Wed Nov 27 09:55:51 2013 +0100

    Fix for SIGBUS error on MIPS64 with N64 ABI
    
    When accessing errno, a per thread variable, from _stdio_init
    a SIGBUS error happens. This change fixes the wrong relocation
    and debug output.
    
    Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
    Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>

--- a/ldso/ldso/mips/elfinterp.c
+++ b/ldso/ldso/mips/elfinterp.c
@@ -259,11 +259,11 @@ int _dl_parse_relocation_information(str
 					case R_MIPS_TLS_TPREL32:
 					case R_MIPS_TLS_TPREL64:
 						CHECK_STATIC_TLS((struct link_map *)tls_tpnt);
-						*(ElfW(Word) *)reloc_addr +=
+						*(ElfW(Addr) *)reloc_addr +=
 							TLS_TPREL_VALUE (tls_tpnt, symbol_addr);
 #ifdef __SUPPORT_LD_DEBUG__
 						_dl_dprintf(2, "TLS_TPREL  : %s, %x, %x\n",
-							symname, old_val, *((unsigned int *)reloc_addr));
+							symname, old_val, *((unsigned long *)reloc_addr));
 #endif
 						break;
 				}