Commit 32d43270 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'objtool_urgent_for_v5.11_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull objtool fixes from Borislav Petkov:

 - Adjust objtool to handle a recent binutils change to not generate
   unused symbols anymore.

 - Revert the fail-the-build-on-fatal-errors objtool strategy for now
   due to the ever-increasing matrix of supported toolchains/plugins and
   them causing too many such fatal errors currently.

 - Do not add empty symbols to objdump's rbtree to accommodate clang
   removing section symbols.

* tag 'objtool_urgent_for_v5.11_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  objtool: Don't fail on missing symbol table
  objtool: Don't fail the kernel build on fatal errors
  objtool: Don't add empty symbols to the rbtree
parents 24c56ee0 1d489151
...@@ -2928,14 +2928,10 @@ int check(struct objtool_file *file) ...@@ -2928,14 +2928,10 @@ int check(struct objtool_file *file)
warnings += ret; warnings += ret;
out: out:
if (ret < 0) {
/* /*
* Fatal error. The binary is corrupt or otherwise broken in * For now, don't fail the kernel build on fatal warnings. These
* some way, or objtool itself is broken. Fail the kernel * errors are still fairly common due to the growing matrix of
* build. * supported toolchains and their recent pace of change.
*/ */
return ret;
}
return 0; return 0;
} }
...@@ -380,8 +380,11 @@ static int read_symbols(struct elf *elf) ...@@ -380,8 +380,11 @@ static int read_symbols(struct elf *elf)
symtab = find_section_by_name(elf, ".symtab"); symtab = find_section_by_name(elf, ".symtab");
if (!symtab) { if (!symtab) {
WARN("missing symbol table"); /*
return -1; * A missing symbol table is actually possible if it's an empty
* .o file. This can happen for thunk_64.o.
*/
return 0;
} }
symtab_shndx = find_section_by_name(elf, ".symtab_shndx"); symtab_shndx = find_section_by_name(elf, ".symtab_shndx");
...@@ -448,6 +451,13 @@ static int read_symbols(struct elf *elf) ...@@ -448,6 +451,13 @@ static int read_symbols(struct elf *elf)
list_add(&sym->list, entry); list_add(&sym->list, entry);
elf_hash_add(elf->symbol_hash, &sym->hash, sym->idx); elf_hash_add(elf->symbol_hash, &sym->hash, sym->idx);
elf_hash_add(elf->symbol_name_hash, &sym->name_hash, str_hash(sym->name)); elf_hash_add(elf->symbol_name_hash, &sym->name_hash, str_hash(sym->name));
/*
* Don't store empty STT_NOTYPE symbols in the rbtree. They
* can exist within a function, confusing the sorting.
*/
if (!sym->len)
rb_erase(&sym->node, &sym->sec->symbol_tree);
} }
if (stats) if (stats)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment