Commit c5c3439a authored by Quentin Casasnovas's avatar Quentin Casasnovas Committed by Rusty Russell

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: default avatarQuentin Casasnovas <quentin.casasnovas@oracle.com>
Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
Fixes: 050e57fd ("modpost: add strict white-listing when referencing....")
Fixes: 52dc0595 ("modpost: handle relocations mismatch in __ex_table.")
Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent e84048aa
...@@ -1064,6 +1064,15 @@ static const struct sectioncheck *section_mismatch( ...@@ -1064,6 +1064,15 @@ static const struct sectioncheck *section_mismatch(
int elems = sizeof(sectioncheck) / sizeof(struct sectioncheck); int elems = sizeof(sectioncheck) / sizeof(struct sectioncheck);
const struct sectioncheck *check = &sectioncheck[0]; const struct sectioncheck *check = &sectioncheck[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++) { for (i = 0; i < elems; i++) {
if (match(fromsec, check->fromsec)) { if (match(fromsec, check->fromsec)) {
if (check->bad_tosec[0] && match(tosec, check->bad_tosec)) if (check->bad_tosec[0] && match(tosec, check->bad_tosec))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment