| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2014-2017 Linaro Ltd. <ard.biesheuvel@linaro.org> |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 5 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 6 | | - * published by the Free Software Foundation. |
|---|
| 7 | 4 | */ |
|---|
| 8 | 5 | |
|---|
| 9 | 6 | #include <linux/elf.h> |
|---|
| .. | .. |
|---|
| 11 | 8 | #include <linux/kernel.h> |
|---|
| 12 | 9 | #include <linux/module.h> |
|---|
| 13 | 10 | #include <linux/sort.h> |
|---|
| 11 | +#include <linux/moduleloader.h> |
|---|
| 14 | 12 | |
|---|
| 15 | 13 | #include <asm/cache.h> |
|---|
| 16 | 14 | #include <asm/opcodes.h> |
|---|
| .. | .. |
|---|
| 258 | 256 | /* sort by type and symbol index */ |
|---|
| 259 | 257 | sort(rels, numrels, sizeof(Elf32_Rel), cmp_rel, NULL); |
|---|
| 260 | 258 | |
|---|
| 261 | | - if (strncmp(secstrings + dstsec->sh_name, ".init", 5) != 0) |
|---|
| 259 | + if (!module_init_layout_section(secstrings + dstsec->sh_name)) |
|---|
| 262 | 260 | core_plts += count_plts(syms, dstsec->sh_addr, rels, |
|---|
| 263 | 261 | numrels, s->sh_info); |
|---|
| 264 | 262 | else |
|---|