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'

Changed files
+26 -11
tools
objtool
+26 -11
tools/objtool/elf.c
··· 302 302 continue; 303 303 sym->pfunc = sym->cfunc = sym; 304 304 coldstr = strstr(sym->name, ".cold."); 305 - if (coldstr) { 306 - coldstr[0] = '\0'; 307 - pfunc = find_symbol_by_name(elf, sym->name); 308 - coldstr[0] = '.'; 305 + if (!coldstr) 306 + continue; 309 307 310 - if (!pfunc) { 311 - WARN("%s(): can't find parent function", 312 - sym->name); 313 - goto err; 314 - } 308 + coldstr[0] = '\0'; 309 + pfunc = find_symbol_by_name(elf, sym->name); 310 + coldstr[0] = '.'; 315 311 316 - sym->pfunc = pfunc; 317 - pfunc->cfunc = sym; 312 + if (!pfunc) { 313 + WARN("%s(): can't find parent function", 314 + sym->name); 315 + goto err; 316 + } 317 + 318 + sym->pfunc = pfunc; 319 + pfunc->cfunc = sym; 320 + 321 + /* 322 + * Unfortunately, -fnoreorder-functions puts the child 323 + * inside the parent. Remove the overlap so we can 324 + * have sane assumptions. 325 + * 326 + * Note that pfunc->len now no longer matches 327 + * pfunc->sym.st_size. 328 + */ 329 + if (sym->sec == pfunc->sec && 330 + sym->offset >= pfunc->offset && 331 + sym->offset + sym->len == pfunc->offset + pfunc->len) { 332 + pfunc->len -= sym->len; 318 333 } 319 334 } 320 335 }