kbuild: Fixup the IBT kbuild changes

Masahiro-san deemed my kbuild changes to support whole module objtool
runs too terrible to live and gracefully provided an alternative.

Suggested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/CAK7LNAQ2mYMnOKMQheVi+6byUFE3KEkjm1zcndNUfe0tORGvug@mail.gmail.com
This commit is contained in:
Peter Zijlstra
2022-03-18 12:19:27 +01:00
parent 9cea0d46f5
commit d31ed5d767
3 changed files with 27 additions and 55 deletions

View File

@@ -1989,9 +1989,9 @@ static char *remove_dot(char *s)
if (m && (s[n + m] == '.' || s[n + m] == 0))
s[n] = 0;
/* strip trailing .lto */
if (strends(s, ".lto"))
s[strlen(s) - 4] = '\0';
/* strip trailing .prelink */
if (strends(s, ".prelink"))
s[strlen(s) - 8] = '\0';
}
return s;
}
@@ -2015,9 +2015,9 @@ static void read_symbols(const char *modname)
/* strip trailing .o */
tmp = NOFAIL(strdup(modname));
tmp[strlen(tmp) - 2] = '\0';
/* strip trailing .lto */
if (strends(tmp, ".lto"))
tmp[strlen(tmp) - 4] = '\0';
/* strip trailing .prelink */
if (strends(tmp, ".prelink"))
tmp[strlen(tmp) - 8] = '\0';
mod = new_module(tmp);
free(tmp);
}