Skip to content

Commit

Permalink
kbuild: do not warn when unwind sections references .init/.exit sections
Browse files Browse the repository at this point in the history
Andrew Morton reported a number of false positives for ia64 - like these:
WARNING: drivers/acpi/button.o - Section mismatch: reference to .init.text: from .IA_64.unwind.init.text after '' (at offset 0x0)
WARNING: drivers/acpi/button.o - Section mismatch: reference to .exit.text: from .IA_64.unwind.exit.text after '' (at offset 0x0)
WARNING: drivers/acpi/processor.o - Section mismatch: reference to .init.text: from .IA_64.unwind after '' (at offset 0x1e8)

They are all false positives - or at least the .c code looks OK.
It is not known why sometimes a section name is appended and sometimes not.

Fix is to accept references from all sections that includes "unwind." in the name.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
  • Loading branch information
Sam Ravnborg committed Feb 22, 2006
1 parent fededcd commit 6e10133
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,13 +671,21 @@ static int init_section_ref_ok(const char *name)
".debug",
NULL
};

/* part of section name */
const char *namelist3 [] = {
".unwind", /* sample: IA_64.unwind.init.text */
NULL
};

for (s = namelist1; *s; s++)
if (strcmp(*s, name) == 0)
return 1;
for (s = namelist2; *s; s++)
if (strncmp(*s, name, strlen(*s)) == 0)
return 1;
for (s = namelist3; *s; s++)
if (strstr(*s, name) != NULL)
return 1;
return 0;
}

Expand Down Expand Up @@ -727,13 +735,21 @@ static int exit_section_ref_ok(const char *name)
".debug",
NULL
};
/* part of section name */
const char *namelist3 [] = {
".unwind", /* Sample: IA_64.unwind.exit.text */
NULL
};

for (s = namelist1; *s; s++)
if (strcmp(*s, name) == 0)
return 1;
for (s = namelist2; *s; s++)
if (strncmp(*s, name, strlen(*s)) == 0)
return 1;
for (s = namelist3; *s; s++)
if (strstr(*s, name) != NULL)
return 1;
return 0;
}

Expand Down

0 comments on commit 6e10133

Please sign in to comment.