Guest User

Untitled

a guest
Aug 1st, 2012
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c
  2. index 1500c80..afbd717 100644
  3. --- a/arch/mips/kernel/module.c
  4. +++ b/arch/mips/kernel/module.c
  5. @@ -65,12 +65,14 @@ static int apply_r_mips_32_rel(struct module *me, u32 *location, Elf_Addr v)
  6. return 0;
  7. }
  8.  
  9. +#ifdef CONFIG_MODULES_USE_ELF_RELA
  10. static int apply_r_mips_32_rela(struct module *me, u32 *location, Elf_Addr v)
  11. {
  12. *location = v;
  13.  
  14. return 0;
  15. }
  16. +#endif
  17.  
  18. static int apply_r_mips_26_rel(struct module *me, u32 *location, Elf_Addr v)
  19. {
  20. @@ -93,6 +95,7 @@ static int apply_r_mips_26_rel(struct module *me, u32 *location, Elf_Addr v)
  21. return 0;
  22. }
  23.  
  24. +#ifdef CONFIG_MODULES_USE_ELF_RELA
  25. static int apply_r_mips_26_rela(struct module *me, u32 *location, Elf_Addr v)
  26. {
  27. if (v % 4) {
  28. @@ -112,6 +115,7 @@ static int apply_r_mips_26_rela(struct module *me, u32 *location, Elf_Addr v)
  29.  
  30. return 0;
  31. }
  32. +#endif
  33.  
  34. static int apply_r_mips_hi16_rel(struct module *me, u32 *location, Elf_Addr v)
  35. {
  36. @@ -134,6 +138,7 @@ static int apply_r_mips_hi16_rel(struct module *me, u32 *location, Elf_Addr v)
  37. return 0;
  38. }
  39.  
  40. +#ifdef CONFIG_MODULES_USE_ELF_RELA
  41. static int apply_r_mips_hi16_rela(struct module *me, u32 *location, Elf_Addr v)
  42. {
  43. *location = (*location & 0xffff0000) |
  44. @@ -141,6 +146,7 @@ static int apply_r_mips_hi16_rela(struct module *me, u32 *location, Elf_Addr v)
  45.  
  46. return 0;
  47. }
  48. +#endif
  49.  
  50. static int apply_r_mips_lo16_rel(struct module *me, u32 *location, Elf_Addr v)
  51. {
  52. @@ -206,6 +212,7 @@ out_danger:
  53. return -ENOEXEC;
  54. }
  55.  
  56. +#ifdef CONFIG_MODULES_USE_ELF_RELA
  57. static int apply_r_mips_lo16_rela(struct module *me, u32 *location, Elf_Addr v)
  58. {
  59. *location = (*location & 0xffff0000) | (v & 0xffff);
  60. @@ -237,6 +244,7 @@ static int apply_r_mips_highest_rela(struct module *me, u32 *location,
  61.  
  62. return 0;
  63. }
  64. +#endif
  65.  
  66. static int (*reloc_handlers_rel[]) (struct module *me, u32 *location,
  67. Elf_Addr v) = {
  68. @@ -247,6 +255,7 @@ static int (*reloc_handlers_rel[]) (struct module *me, u32 *location,
  69. [R_MIPS_LO16] = apply_r_mips_lo16_rel
  70. };
  71.  
  72. +#ifdef CONFIG_MODULES_USE_ELF_RELA
  73. static int (*reloc_handlers_rela[]) (struct module *me, u32 *location,
  74. Elf_Addr v) = {
  75. [R_MIPS_NONE] = apply_r_mips_none,
  76. @@ -258,6 +267,7 @@ static int (*reloc_handlers_rela[]) (struct module *me, u32 *location,
  77. [R_MIPS_HIGHER] = apply_r_mips_higher_rela,
  78. [R_MIPS_HIGHEST] = apply_r_mips_highest_rela
  79. };
  80. +#endif
  81.  
  82. int apply_relocate(Elf_Shdr *sechdrs, const char *strtab,
  83. unsigned int symindex, unsigned int relsec,
Advertisement
Add Comment
Please, Sign In to add comment