aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod/modpost.c
diff options
context:
space:
mode:
authorLaura Abbott <labbott@redhat.com>2018-07-05 20:49:37 -0400
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-07-17 12:18:05 -0400
commit9afb719e7046c4f2462278862ab3db2961cc141c (patch)
tree1c80da67479e528cddc6db97a0ed7397e2afc1a0 /scripts/mod/modpost.c
parent934193a654c1f4d0643ddbf4b2529b508cae926e (diff)
kbuild: Add build salt to the kernel and modules
In Fedora, the debug information is packaged separately (foo-debuginfo) and can be installed separately. There's been a long standing issue where only one version of a debuginfo info package can be installed at a time. There's been an effort for Fedora for parallel debuginfo to rectify this problem. Part of the requirement to allow parallel debuginfo to work is that build ids are unique between builds. The existing upstream rpm implementation ensures this by re-calculating the build-id using the version and release as a seed. This doesn't work 100% for the kernel because of the vDSO which is its own binary and doesn't get updated when embedded. Fix this by adding some data in an ELF note for both the kernel and modules. The data is controlled via a Kconfig option so distributions can set it to an appropriate value to ensure uniqueness between builds. Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Laura Abbott <labbott@redhat.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/mod/modpost.c')
-rw-r--r--scripts/mod/modpost.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 1663fb19343a..dc6d714e4dcb 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -2125,10 +2125,13 @@ static int check_modname_len(struct module *mod)
2125 **/ 2125 **/
2126static void add_header(struct buffer *b, struct module *mod) 2126static void add_header(struct buffer *b, struct module *mod)
2127{ 2127{
2128 buf_printf(b, "#include <linux/build-salt.h>\n");
2128 buf_printf(b, "#include <linux/module.h>\n"); 2129 buf_printf(b, "#include <linux/module.h>\n");
2129 buf_printf(b, "#include <linux/vermagic.h>\n"); 2130 buf_printf(b, "#include <linux/vermagic.h>\n");
2130 buf_printf(b, "#include <linux/compiler.h>\n"); 2131 buf_printf(b, "#include <linux/compiler.h>\n");
2131 buf_printf(b, "\n"); 2132 buf_printf(b, "\n");
2133 buf_printf(b, "BUILD_SALT;\n");
2134 buf_printf(b, "\n");
2132 buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n"); 2135 buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n");
2133 buf_printf(b, "MODULE_INFO(name, KBUILD_MODNAME);\n"); 2136 buf_printf(b, "MODULE_INFO(name, KBUILD_MODNAME);\n");
2134 buf_printf(b, "\n"); 2137 buf_printf(b, "\n");