core/urgent fixes
Subsystems (3)
Linus,
Please pull the latest core-urgent-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core-urgent-for-linus
# HEAD: 5c51f4ae84df0f9df33ac08aa5be50061a8b4242 objtool: Fix another GCC jump table detection issue
A couple of sched.h splitup related build fixes, plus an objtool fix.
Thanks,
Ingo
------------------>
Guenter Roeck (3):
avr32: Fix build error caused by include file reshuffling
h8300: Fix build breakage caused by header file changes drivers/char/nwbutton: Fix build breakage caused by include file reshuffling
Josh Poimboeuf (1):
objtool: Fix another GCC jump table detection issue
arch/avr32/oprofile/backtrace.c | 2 +- arch/h8300/kernel/ptrace_h.c | 2 +- drivers/char/nwbutton.c | 2 +- tools/objtool/builtin-check.c | 15 ++++++++++++--- tools/objtool/elf.c | 12 ++++++++++++ tools/objtool/elf.h | 1 + 6 files changed, 28 insertions(+), 6 deletions(-)
arch/avr32/oprofile/backtrace.c +1 -1
@@ -14,7 +14,7 @@*/ #include <linux/oprofile.h> -#include <linux/sched.h> +#include <linux/ptrace.h> #include <linux/uaccess.h> /* The first two words of each frame on the stack look like this if we have
arch/h8300/kernel/ptrace_h.c +1 -1
@@ -9,7 +9,7 @@*/ #include <linux/linkage.h> -#include <linux/sched.h> +#include <linux/sched/signal.h> #include <asm/ptrace.h> #define BREAKINST 0x5730/* trapa #3 */
drivers/char/nwbutton.c +1 -1
@@ -6,7 +6,7 @@#include <linux/module.h> #include <linux/kernel.h> -#include <linux/sched.h> +#include <linux/sched/signal.h> #include <linux/interrupt.h> #include <linux/time.h> #include <linux/timer.h>
tools/objtool/builtin-check.c +12 -3
@@ -805,11 +805,20 @@ static struct rela *find_switch_table(struct objtool_file *file, insn->jump_dest->offset > orig_insn->offset)) break; +/* look for a relocation which references .rodata */ text_rela =find_rela_by_dest_range (insn->sec, insn->offset, insn->len); -if (text_rela && text_rela->sym == file->rodata->sym) -return find_rela_by_dest (file->rodata, - text_rela->addend); +if (!text_rela || text_rela->sym != file->rodata->sym) +continue ; + +/* +* Make sure the .rodata address isn't associated with a +* symbol. gcc jump tables are anonymous data. +*/ +if (find_symbol_containing (file->rodata, text_rela->addend)) +continue ; + +return find_rela_by_dest (file->rodata, text_rela->addend); }return NULL ;
tools/objtool/elf.c +12 -0
@@ -85,6 +85,18 @@ struct symbol *find_symbol_by_offset(struct section *sec, unsigned long offset)return NULL ; } +struct symbol *find_symbol_containing (struct section *sec,unsigned long offset) +{ +struct symbol *sym; + +list_for_each_entry (sym, &sec->symbol_list, list) +if (sym->type !=STT_SECTION && + offset >= sym->offset && offset < sym->offset + sym->len) +return sym; + +return NULL ; +} +struct rela *find_rela_by_dest_range (struct section *sec,unsigned long offset,unsigned int len) {
tools/objtool/elf.h +1 -0
@@ -79,6 +79,7 @@ struct elf {struct elf *elf_open (const char *name);struct section *find_section_by_name (struct elf *elf,const char *name);struct symbol *find_symbol_by_offset (struct section *sec,unsigned long offset); +struct symbol *find_symbol_containing (struct section *sec,unsigned long offset);struct rela *find_rela_by_dest (struct section *sec,unsigned long offset);struct rela *find_rela_by_dest_range (struct section *sec,unsigned long offset,unsigned int len);