mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
modpost: lto: strip .lto from module names
With LTO, everything is compiled into LLVM bitcode, so we have to link each module into native code before modpost. Kbuild uses the .lto.o suffix for these files, which also ends up in module information. This change strips the unnecessary .lto suffix from the module name. Suggested-by: Bill Wendling <morbo@google.com> Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20201211184633.3213045-11-samitolvanen@google.com
This commit is contained in:
@@ -391,10 +391,14 @@ void get_src_version(const char *modname, char sum[], unsigned sumlen)
|
||||
struct md4_ctx md;
|
||||
char *fname;
|
||||
char filelist[PATH_MAX + 1];
|
||||
int postfix_len = 1;
|
||||
|
||||
if (strends(modname, ".lto.o"))
|
||||
postfix_len = 5;
|
||||
|
||||
/* objects for a module are listed in the first line of *.mod file. */
|
||||
snprintf(filelist, sizeof(filelist), "%.*smod",
|
||||
(int)strlen(modname) - 1, modname);
|
||||
(int)strlen(modname) - postfix_len, modname);
|
||||
|
||||
buf = read_text_file(filelist);
|
||||
|
||||
|
Reference in New Issue
Block a user