Skip to content

Commit 4977ab6

Browse files
committed
Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull objtool relocation fixes from Ingo Molnar: "Two fixes related to the module loading regression introduced by the recent objtool changes" * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: objtool, modules: Discard objtool annotation sections for modules objtool, compiler.h: Fix __unreachable section relocation size
2 parents 8f03cf5 + e390f9a commit 4977ab6

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

arch/x86/kernel/vmlinux.lds.S

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,6 @@ SECTIONS
345345
DISCARDS
346346
/DISCARD/ : {
347347
*(.eh_frame)
348-
*(__func_stack_frame_non_standard)
349-
*(__unreachable)
350348
}
351349
}
352350

include/linux/compiler-gcc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@
200200
#ifdef CONFIG_STACK_VALIDATION
201201
#define annotate_unreachable() ({ \
202202
asm("%c0:\t\n" \
203-
".pushsection __unreachable, \"a\"\t\n" \
204-
".long %c0b\t\n" \
203+
".pushsection .discard.unreachable\t\n" \
204+
".long %c0b - .\t\n" \
205205
".popsection\t\n" : : "i" (__LINE__)); \
206206
})
207207
#else

include/linux/frame.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* For more information, see tools/objtool/Documentation/stack-validation.txt.
1212
*/
1313
#define STACK_FRAME_NON_STANDARD(func) \
14-
static void __used __section(__func_stack_frame_non_standard) \
14+
static void __used __section(.discard.func_stack_frame_non_standard) \
1515
*__func_stack_frame_non_standard_##func = func
1616

1717
#else /* !CONFIG_STACK_VALIDATION */

scripts/mod/modpost.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,7 @@ static const char *const section_white_list[] =
854854
".cmem*", /* EZchip */
855855
".fmt_slot*", /* EZchip */
856856
".gnu.lto*",
857+
".discard.*",
857858
NULL
858859
};
859860

scripts/module-common.lds

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
* combine them automatically.
55
*/
66
SECTIONS {
7-
/DISCARD/ : { *(.discard) }
7+
/DISCARD/ : {
8+
*(.discard)
9+
*(.discard.*)
10+
}
811

912
__ksymtab 0 : { *(SORT(___ksymtab+*)) }
1013
__ksymtab_gpl 0 : { *(SORT(___ksymtab_gpl+*)) }

tools/objtool/builtin-check.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,13 +339,13 @@ static int add_dead_ends(struct objtool_file *file)
339339
struct instruction *insn;
340340
bool found;
341341

342-
sec = find_section_by_name(file->elf, ".rela__unreachable");
342+
sec = find_section_by_name(file->elf, ".rela.discard.unreachable");
343343
if (!sec)
344344
return 0;
345345

346346
list_for_each_entry(rela, &sec->rela_list, list) {
347347
if (rela->sym->type != STT_SECTION) {
348-
WARN("unexpected relocation symbol type in .rela__unreachable");
348+
WARN("unexpected relocation symbol type in %s", sec->name);
349349
return -1;
350350
}
351351
insn = find_insn(file, rela->sym->sec, rela->addend);
@@ -1272,7 +1272,7 @@ int cmd_check(int argc, const char **argv)
12721272

12731273
INIT_LIST_HEAD(&file.insn_list);
12741274
hash_init(file.insn_hash);
1275-
file.whitelist = find_section_by_name(file.elf, "__func_stack_frame_non_standard");
1275+
file.whitelist = find_section_by_name(file.elf, ".discard.func_stack_frame_non_standard");
12761276
file.rodata = find_section_by_name(file.elf, ".rodata");
12771277
file.ignore_unreachables = false;
12781278
file.c_file = find_section_by_name(file.elf, ".comment");

0 commit comments

Comments
 (0)