[PATCH] modpost: treat undefined CRC symbols as absent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>
---
I've only noticed this with the recent switch to exporting symbols
defined in assembly files from their source files, as that has caused
a number of such symbols to appear.
---
 scripts/mod/modpost.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- 4.9-rc5/scripts/mod/modpost.c
+++ 4.9-rc5-ignore-undef-CRC/scripts/mod/modpost.c
@@ -617,7 +617,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) {
 		crc = (unsigned int) sym->st_value;
 		sym_update_crc(symname + strlen(CRC_PFX), mod, crc,
 				export);



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



[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux