Skip to content

Commit

Permalink
kbuild: add "Section mismatch" warning whitelist for powerpc
Browse files Browse the repository at this point in the history
This patch fixes the following class of "Section mismatch" warnings when
building powerpc platforms.

WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:.got2 from prom_entry (offset 0x0)
WARNING: arch/powerpc/platforms/built-in.o - Section mismatch: reference to .init.text:mpc8313_rdb_probe from .machine.desc after 'mach_mpc8313_rdb' (at offset 0x4)
....

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
  • Loading branch information
Li Yang authored and Sam Ravnborg committed May 19, 2007
1 parent f892b7d commit cd54779
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,9 +650,10 @@ static int strrcmp(const char *s, const char *sub)
* tosec = .init.text
*
* Pattern 10:
* ia64 has machvec table for each platform. It is mixture of function
* pointer of .init.text and .text.
* fromsec = .machvec
* ia64 has machvec table for each platform and
* powerpc has a machine desc table for each platform.
* It is mixture of function pointers of .init.text and .text.
* fromsec = .machvec | .machine.desc
**/
static int secref_whitelist(const char *modname, const char *tosec,
const char *fromsec, const char *atsym,
Expand Down Expand Up @@ -751,7 +752,8 @@ static int secref_whitelist(const char *modname, const char *tosec,
return 1;

/* Check for pattern 10 */
if (strcmp(fromsec, ".machvec") == 0)
if ((strcmp(fromsec, ".machvec") == 0) ||
(strcmp(fromsec, ".machine.desc") == 0))
return 1;

return 0;
Expand Down Expand Up @@ -887,6 +889,11 @@ static void warn_sec_mismatch(const char *modname, const char *fromsec,
elf->strtab + before->st_name, refsymname))
return;

/* fromsec whitelist - without a valid 'before'
* powerpc has a GOT table in .got2 section */
if (strcmp(fromsec, ".got2") == 0)
return;

if (before && after) {
warn("%s(%s+0x%llx): Section mismatch: reference to %s:%s "
"(between '%s' and '%s')\n",
Expand Down

0 comments on commit cd54779

Please sign in to comment.