Skip to content

Commit b4d5171

Browse files
committed
kbuild: ignore section mismatch warning for references from .paravirtprobe to .init.text
Added on request from: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Rusty Russell <rusty@rustcorp.com.au>
1 parent 66bd32e commit b4d5171

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎scripts/mod/modpost.c‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,13 @@ static int strrcmp(const char *s, const char *sub)
635635
* tosec = .init.data
636636
* fromsec = .text*
637637
* refsymname = logo_
638+
*
639+
* Pattern 8:
640+
* Symbols contained in .paravirtprobe may safely reference .init.text.
641+
* The pattern is:
642+
* tosec = .init.text
643+
* fromsec = .paravirtprobe
644+
*
638645
**/
639646
static int secref_whitelist(const char *modname, const char *tosec,
640647
const char *fromsec, const char *atsym,
@@ -712,6 +719,12 @@ static int secref_whitelist(const char *modname, const char *tosec,
712719
(strncmp(fromsec, ".text", strlen(".text")) == 0) &&
713720
(strncmp(refsymname, "logo_", strlen("logo_")) == 0))
714721
return 1;
722+
723+
/* Check for pattern 8 */
724+
if ((strcmp(tosec, ".init.text") == 0) &&
725+
(strcmp(fromsec, ".paravirtprobe") == 0))
726+
return 1;
727+
715728
return 0;
716729
}
717730

0 commit comments

Comments
 (0)