612-mips64_relocation_fix.patch 1.0 KB

1234567891011121314151617181920212223242526272829
  1. commit 052bcf13afb067cafac5e7f4fc21fbad2b34b11f
  2. Author: Waldemar Brodkorb <wbx@openadk.org>
  3. Date: Wed Nov 27 09:55:51 2013 +0100
  4. Fix for SIGBUS error on MIPS64 with N64 ABI
  5. When accessing errno, a per thread variable, from _stdio_init
  6. a SIGBUS error happens. This change fixes the wrong relocation
  7. and debug output.
  8. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
  9. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
  10. --- a/ldso/ldso/mips/elfinterp.c
  11. +++ b/ldso/ldso/mips/elfinterp.c
  12. @@ -259,11 +259,11 @@ int _dl_parse_relocation_information(str
  13. case R_MIPS_TLS_TPREL32:
  14. case R_MIPS_TLS_TPREL64:
  15. CHECK_STATIC_TLS((struct link_map *)tls_tpnt);
  16. - *(ElfW(Word) *)reloc_addr +=
  17. + *(ElfW(Addr) *)reloc_addr +=
  18. TLS_TPREL_VALUE (tls_tpnt, symbol_addr);
  19. #ifdef __SUPPORT_LD_DEBUG__
  20. _dl_dprintf(2, "TLS_TPREL : %s, %x, %x\n",
  21. - symname, old_val, *((unsigned int *)reloc_addr));
  22. + symname, old_val, *((unsigned long *)reloc_addr));
  23. #endif
  24. break;
  25. }