diff options
Diffstat (limited to 'arch/microblaze/kernel/module.c')
-rw-r--r-- | arch/microblaze/kernel/module.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/arch/microblaze/kernel/module.c b/arch/microblaze/kernel/module.c index 51414171326f..5a45b1adfef1 100644 --- a/arch/microblaze/kernel/module.c +++ b/arch/microblaze/kernel/module.c | |||
@@ -57,7 +57,6 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab, | |||
57 | Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr; | 57 | Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr; |
58 | Elf32_Sym *sym; | 58 | Elf32_Sym *sym; |
59 | unsigned long int *location; | 59 | unsigned long int *location; |
60 | unsigned long int locoffs; | ||
61 | unsigned long int value; | 60 | unsigned long int value; |
62 | #if __GNUC__ < 4 | 61 | #if __GNUC__ < 4 |
63 | unsigned long int old_value; | 62 | unsigned long int old_value; |
@@ -113,10 +112,12 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab, | |||
113 | break; | 112 | break; |
114 | 113 | ||
115 | case R_MICROBLAZE_64_PCREL: | 114 | case R_MICROBLAZE_64_PCREL: |
116 | locoffs = (location[0] & 0xFFFF) << 16 | | 115 | #if __GNUC__ < 4 |
116 | old_value = (location[0] & 0xFFFF) << 16 | | ||
117 | (location[1] & 0xFFFF); | 117 | (location[1] & 0xFFFF); |
118 | value -= (unsigned long int)(location) + 4 + | 118 | value -= old_value; |
119 | locoffs; | 119 | #endif |
120 | value -= (unsigned long int)(location) + 4; | ||
120 | location[0] = (location[0] & 0xFFFF0000) | | 121 | location[0] = (location[0] & 0xFFFF0000) | |
121 | (value >> 16); | 122 | (value >> 16); |
122 | location[1] = (location[1] & 0xFFFF0000) | | 123 | location[1] = (location[1] & 0xFFFF0000) | |
@@ -125,6 +126,14 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab, | |||
125 | value); | 126 | value); |
126 | break; | 127 | break; |
127 | 128 | ||
129 | case R_MICROBLAZE_32_PCREL_LO: | ||
130 | pr_debug("R_MICROBLAZE_32_PCREL_LO\n"); | ||
131 | break; | ||
132 | |||
133 | case R_MICROBLAZE_64_NONE: | ||
134 | pr_debug("R_MICROBLAZE_NONE\n"); | ||
135 | break; | ||
136 | |||
128 | case R_MICROBLAZE_NONE: | 137 | case R_MICROBLAZE_NONE: |
129 | pr_debug("R_MICROBLAZE_NONE\n"); | 138 | pr_debug("R_MICROBLAZE_NONE\n"); |
130 | break; | 139 | break; |
@@ -133,7 +142,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab, | |||
133 | printk(KERN_ERR "module %s: " | 142 | printk(KERN_ERR "module %s: " |
134 | "Unknown relocation: %u\n", | 143 | "Unknown relocation: %u\n", |
135 | module->name, | 144 | module->name, |
136 | ELF32_R_TYPE(rela->r_info)); | 145 | ELF32_R_TYPE(rela[i].r_info)); |
137 | return -ENOEXEC; | 146 | return -ENOEXEC; |
138 | } | 147 | } |
139 | } | 148 | } |