From: Quentin Casasnovas Date: Thu, 16 Apr 2015 03:46:41 +0000 (+0930) Subject: modpost: do not try to match the SHT_NUL section. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c5c3439af0f9c08e253d2a703a7eb3deba7d8591;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git modpost: do not try to match the SHT_NUL section. Trying to match the SHT_NUL section isn't useful and causes build failures on parisc and mn10300 since the addition of section strict white-listing and __ex_table sanitizing. Signed-off-by: Quentin Casasnovas Reported-by: Guenter Roeck Fixes: 050e57fd5936 ("modpost: add strict white-listing when referencing....") Fixes: 52dc0595d540 ("modpost: handle relocations mismatch in __ex_table.") Tested-by: Guenter Roeck Signed-off-by: Rusty Russell --- diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index fd949770da0c..45e4027d3193 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1064,6 +1064,15 @@ static const struct sectioncheck *section_mismatch( int elems = sizeof(sectioncheck) / sizeof(struct sectioncheck); const struct sectioncheck *check = §ioncheck[0]; + /* + * The target section could be the SHT_NUL section when we're + * handling relocations to un-resolved symbols, trying to match it + * doesn't make much sense and causes build failures on parisc and + * mn10300 architectures. + */ + if (*tosec == '\0') + return NULL; + for (i = 0; i < elems; i++) { if (match(fromsec, check->fromsec)) { if (check->bad_tosec[0] && match(tosec, check->bad_tosec))