Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5c926b9 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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'
parents 124b99fb 08b393d0
Loading
Loading
Loading
Loading
+28 −13
Original line number Original line Diff line number Diff line
@@ -302,7 +302,9 @@ 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)
				continue;

			coldstr[0] = '\0';
			coldstr[0] = '\0';
			pfunc = find_symbol_by_name(elf, sym->name);
			pfunc = find_symbol_by_name(elf, sym->name);
			coldstr[0] = '.';
			coldstr[0] = '.';
@@ -315,6 +317,19 @@ static int read_symbols(struct elf *elf)


			sym->pfunc = pfunc;
			sym->pfunc = pfunc;
			pfunc->cfunc = sym;
			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;
			}
			}
		}
		}
	}
	}