Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull objtool fix from Thomas Gleixner: "A single fix for objtool to address a bug in handling the cold subfunction detection for aliased functions which was added recently. The bug causes objtool to enter an infinite loop" * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: objtool: Support GCC 8 '-fnoreorder-functions'
This commit is contained in:
commit
f5c926b99e
|
@ -302,19 +302,34 @@ static int read_symbols(struct elf *elf)
|
||||||
continue;
|
continue;
|
||||||
sym->pfunc = sym->cfunc = sym;
|
sym->pfunc = sym->cfunc = sym;
|
||||||
coldstr = strstr(sym->name, ".cold.");
|
coldstr = strstr(sym->name, ".cold.");
|
||||||
if (coldstr) {
|
if (!coldstr)
|
||||||
coldstr[0] = '\0';
|
continue;
|
||||||
pfunc = find_symbol_by_name(elf, sym->name);
|
|
||||||
coldstr[0] = '.';
|
|
||||||
|
|
||||||
if (!pfunc) {
|
coldstr[0] = '\0';
|
||||||
WARN("%s(): can't find parent function",
|
pfunc = find_symbol_by_name(elf, sym->name);
|
||||||
sym->name);
|
coldstr[0] = '.';
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
sym->pfunc = pfunc;
|
if (!pfunc) {
|
||||||
pfunc->cfunc = sym;
|
WARN("%s(): can't find parent function",
|
||||||
|
sym->name);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
sym->pfunc = pfunc;
|
||||||
|
pfunc->cfunc = sym;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Unfortunately, -fnoreorder-functions puts the child
|
||||||
|
* inside the parent. Remove the overlap so we can
|
||||||
|
* have sane assumptions.
|
||||||
|
*
|
||||||
|
* Note that pfunc->len now no longer matches
|
||||||
|
* pfunc->sym.st_size.
|
||||||
|
*/
|
||||||
|
if (sym->sec == pfunc->sec &&
|
||||||
|
sym->offset >= pfunc->offset &&
|
||||||
|
sym->offset + sym->len == pfunc->offset + pfunc->len) {
|
||||||
|
pfunc->len -= sym->len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue