Skip to content

Commit 8e4be11

Browse files
committed
kexec_file: Drop pr_err in weak implementations of arch_kexec_apply_relocations[_add]
kexec_load_purgatory() can fail for many reasons - there is no need to print an error when encountering unsupported relocations. This solves a build issue on powerpc with binutils v2.36 and newer [1], and likely also with the clang integrated assembler [2]. Since commit d1bcae833b32f1 ("ELF: Don't generate unused section symbols") [3], binutils started dropping section symbols that it thought were unused. This isn't an issue in general, but with kexec_file.c, gcc is placing kexec_arch_apply_relocations[_add] into a separate .text.unlikely section and the section symbol ".text.unlikely" is being dropped. Due to this, recordmcount is unable to find a non-weak symbol in .text.unlikely to generate a relocation record against. Dropping pr_err() calls results in these functions being left in .text section, enabling recordmcount to emit a proper relocation record. [1] linuxppc/issues#388 [2] ClangBuiltLinux#981 [3] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=d1bcae833b32f1 Signed-off-by: Naveen N. Rao <[email protected]>
1 parent 83d8a0d commit 8e4be11

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

kernel/kexec_file.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ int __weak
121121
arch_kexec_apply_relocations_add(struct purgatory_info *pi, Elf_Shdr *section,
122122
const Elf_Shdr *relsec, const Elf_Shdr *symtab)
123123
{
124-
pr_err("RELA relocation unsupported.\n");
125124
return -ENOEXEC;
126125
}
127126

@@ -138,7 +137,6 @@ int __weak
138137
arch_kexec_apply_relocations(struct purgatory_info *pi, Elf_Shdr *section,
139138
const Elf_Shdr *relsec, const Elf_Shdr *symtab)
140139
{
141-
pr_err("REL relocation unsupported.\n");
142140
return -ENOEXEC;
143141
}
144142

0 commit comments

Comments
 (0)