700-mips_nptl_dl_find_hash_fix.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. From 9c343fd4030dcd7a52616f365893177dded50346 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <[email protected]>
  3. Date: Wed, 13 Jan 2010 01:51:32 +0000
  4. Subject: mips/nptl: Pass correct parameters to dl_find_hash when resolving TLS relocations.
  5. Make use of macros from sys/asm.h in crt1.S
  6. These two changes are needed for mips nptl to boot once again.
  7. Signed-off-by: Khem Raj <[email protected]>
  8. ---
  9. diff --git a/libc/sysdeps/linux/mips/crt1.S b/libc/sysdeps/linux/mips/crt1.S
  10. index e851d52..6a80412 100644
  11. --- a/libc/sysdeps/linux/mips/crt1.S
  12. +++ b/libc/sysdeps/linux/mips/crt1.S
  13. @@ -85,29 +85,10 @@
  14. __start:
  15. #ifdef __PIC__
  16. -#if _MIPS_SIM == _MIPS_SIM_ABI32
  17. - .frame sp, 24, sp
  18. - .set noreorder
  19. - move $0, $31 /* Save old ra. */
  20. - bal 10f /* Find addr of cpload. */
  21. - nop
  22. -10:
  23. - .cpload $31
  24. - move $31, $0
  25. - .set reorder
  26. - .cprestore 16
  27. -#else
  28. - move $0, $31; /* Save old ra. */
  29. - .set noreorder
  30. - bal 10f /* Find addr of .cpsetup. */
  31. - nop
  32. -10:
  33. - .set reorder
  34. - .cpsetup $31, $25, 10b
  35. - move $31, $0
  36. -#endif
  37. + SETUP_GPX($0)
  38. + SETUP_GPX64($25,$0)
  39. #else
  40. - la $28, _gp /* Setup GP correctly if we're non-PIC. */
  41. + PTR_LA $28, _gp /* Setup GP correctly if we're non-PIC. */
  42. move $31, $0
  43. #endif
  44. @@ -118,18 +99,18 @@ __start:
  45. /* Allocate space on the stack for seven arguments and
  46. * make sure the stack is aligned to double words (8 bytes) */
  47. + and $29, -2 * SZREG
  48. +
  49. #if _MIPS_SIM == _MIPS_SIM_ABI32
  50. - and $29, -2 * 4
  51. - subu $29, 32
  52. - la $7, _init /* init */
  53. - la $8, _fini
  54. - sw $8, 16($29) /* fini */
  55. - sw $2, 20($29) /* rtld_fini */
  56. - sw $29, 24($29) /* stack_end */
  57. -#else
  58. - and $29, -2 * PTRSIZE
  59. + PTR_SUBIU $29, 32
  60. +#endif
  61. PTR_LA $7, _init /* init */
  62. - PTR_LA $8, _fini /* fini */
  63. + PTR_LA $8, _fini
  64. +#if _MIPS_SIM == _MIPS_SIM_ABI32
  65. + PTR_S $8, 16($29) /* fini */
  66. + PTR_S $2, 20($29) /* rtld_fini */
  67. + PTR_S $29, 24($29) /* stack_end */
  68. +#else
  69. move $9, $2 /* rtld_fini */
  70. move $10, $29 /* stack_end */
  71. #endif
  72. @@ -148,4 +129,3 @@ __data_start:
  73. .weak data_start
  74. data_start = __data_start
  75. -
  76. --
  77. cgit v0.8.2.1