.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0+ |
---|
1 | 2 | /* Kernel module help for SH. |
---|
2 | 3 | |
---|
3 | 4 | SHcompact version by Kaz Kojima and Paul Mundt. |
---|
.. | .. |
---|
9 | 10 | |
---|
10 | 11 | Based on the sh version, and on code from the sh64-specific parts of |
---|
11 | 12 | modutils, originally written by Richard Curnow and Ben Gaster. |
---|
12 | | - |
---|
13 | | - This program is free software; you can redistribute it and/or modify |
---|
14 | | - it under the terms of the GNU General Public License as published by |
---|
15 | | - the Free Software Foundation; either version 2 of the License, or |
---|
16 | | - (at your option) any later version. |
---|
17 | | - |
---|
18 | | - This program is distributed in the hope that it will be useful, |
---|
19 | | - but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
20 | | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
21 | | - GNU General Public License for more details. |
---|
22 | | - |
---|
23 | | - You should have received a copy of the GNU General Public License |
---|
24 | | - along with this program; if not, write to the Free Software |
---|
25 | | - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
26 | 13 | */ |
---|
27 | 14 | #include <linux/moduleloader.h> |
---|
28 | 15 | #include <linux/elf.h> |
---|
.. | .. |
---|
58 | 45 | sym = (Elf32_Sym *)sechdrs[symindex].sh_addr |
---|
59 | 46 | + ELF32_R_SYM(rel[i].r_info); |
---|
60 | 47 | relocation = sym->st_value + rel[i].r_addend; |
---|
61 | | - |
---|
62 | | -#ifdef CONFIG_SUPERH64 |
---|
63 | | - /* For text addresses, bit2 of the st_other field indicates |
---|
64 | | - * whether the symbol is SHmedia (1) or SHcompact (0). If |
---|
65 | | - * SHmedia, the LSB of the symbol needs to be asserted |
---|
66 | | - * for the CPU to be in SHmedia mode when it starts executing |
---|
67 | | - * the branch target. */ |
---|
68 | | - relocation |= !!(sym->st_other & 4); |
---|
69 | | -#endif |
---|
70 | 48 | |
---|
71 | 49 | switch (ELF32_R_TYPE(rel[i].r_info)) { |
---|
72 | 50 | case R_SH_NONE: |
---|