diff mbox

[v2] modpost: treat undefined CRC symbols as absent

Message ID 5894537A02000078001366B3@prv-mh.provo.novell.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Beulich Feb. 3, 2017, 8:55 a.m. UTC
Apparently dependent on binutils version, undefined CRC symbols may or
may not make it into the final binary's symbol table. Treat undefined
ones as absent instead of as having value zero.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: Re-base.
---
 scripts/mod/modpost.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)




--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- 4.10-rc6/scripts/mod/modpost.c
+++ 4.10-rc6-ignore-undef-CRC/scripts/mod/modpost.c
@@ -618,7 +618,8 @@  static void handle_modversions(struct mo
 		export = export_from_sec(info, get_secindex(info, sym));
 
 	/* CRC'd symbol */
-	if (strncmp(symname, CRC_PFX, strlen(CRC_PFX)) == 0) {
+	if (sym->st_shndx != SHN_UNDEF &&
+	    strncmp(symname, CRC_PFX, strlen(CRC_PFX)) == 0) {
 		is_crc = true;
 		crc = (unsigned int) sym->st_value;
 		sym_update_crc(symname + strlen(CRC_PFX), mod, crc,