| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* Kernel module help for Alpha. |
|---|
| 2 | 3 | Copyright (C) 2002 Richard Henderson. |
|---|
| 3 | 4 | |
|---|
| 4 | | - This program is free software; you can redistribute it and/or modify |
|---|
| 5 | | - it under the terms of the GNU General Public License as published by |
|---|
| 6 | | - the Free Software Foundation; either version 2 of the License, or |
|---|
| 7 | | - (at your option) any later version. |
|---|
| 8 | | - |
|---|
| 9 | | - This program is distributed in the hope that it will be useful, |
|---|
| 10 | | - but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 | | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 | | - GNU General Public License for more details. |
|---|
| 13 | | - |
|---|
| 14 | | - You should have received a copy of the GNU General Public License |
|---|
| 15 | | - along with this program; if not, write to the Free Software |
|---|
| 16 | | - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 17 | 5 | */ |
|---|
| 18 | 6 | #include <linux/moduleloader.h> |
|---|
| 19 | 7 | #include <linux/elf.h> |
|---|
| .. | .. |
|---|
| 158 | 146 | base = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr; |
|---|
| 159 | 147 | symtab = (Elf64_Sym *)sechdrs[symindex].sh_addr; |
|---|
| 160 | 148 | |
|---|
| 161 | | - /* The small sections were sorted to the end of the segment. |
|---|
| 162 | | - The following should definitely cover them. */ |
|---|
| 163 | | - gp = (u64)me->core_layout.base + me->core_layout.size - 0x8000; |
|---|
| 164 | 149 | got = sechdrs[me->arch.gotsecindex].sh_addr; |
|---|
| 150 | + gp = got + 0x8000; |
|---|
| 165 | 151 | |
|---|
| 166 | 152 | for (i = 0; i < n; i++) { |
|---|
| 167 | 153 | unsigned long r_sym = ELF64_R_SYM (rela[i].r_info); |
|---|
| .. | .. |
|---|
| 224 | 210 | STO_ALPHA_STD_GPLOAD) |
|---|
| 225 | 211 | /* Omit the prologue. */ |
|---|
| 226 | 212 | value += 8; |
|---|
| 227 | | - /* FALLTHRU */ |
|---|
| 213 | + fallthrough; |
|---|
| 228 | 214 | case R_ALPHA_BRADDR: |
|---|
| 229 | 215 | value -= (u64)location + 4; |
|---|
| 230 | 216 | if (value & 3) |
|---|