linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* kbuild: improved Section mismatch detection
@ 2008-01-20 20:05 Sam Ravnborg
  2008-01-20 20:08 ` [PATCH] kbuild: fix so modpost can now check any .o file Sam Ravnborg
                   ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: Sam Ravnborg @ 2008-01-20 20:05 UTC (permalink / raw)
  To: linux-kbuild, LKML, linux arch

I have spent the last week (the time I can afford to
Linux stuff anyway) to improve the Section mismatch 
warnings detected by modpost.

The problem until now has been that the Section
mismatch warnings were dependent on the actual
configuration of HOTPLUG, HOTPLUG_CPU and MEMORY_HOTPLUG.
In the default configuration with HOTPLUG enbaled most
of the remaining Section mismatch warnings were not
seen and thus many of us thought that everything was great.

Adrian reminded us that KCFLAGS=-fno-inline told
another story with more than 100 Section mismatch
warnings on 64 bit x86 with an allyesconfig build.

As this was not acceptable I set out to make it
less configuration dependent. To do so I quikly
relaised that modpost had to be prepared before this
was a feasible thing to implment.

This serie of patches is:

1)      kbuild: fix so modpost can now check any .o file
2)      kbuild: try harder to find symbol names in modpost
3)      kbuild: code refactoring in modpost
4)      kbuild: introduce blacklisting in modpost
5)      kbuild: check section names consistently in modpost
6)      all archs: consolidate init and exit sections in vmlinux.lds.h
7)      compiler.h: introduce __section()
8)      Use separate sections for __dev/__cpu/__mem code/data

Patch 6) makse a set of trivial changes in all arch vmlinux.lds.S files
and the reason why I copid linux-arch on this mail.

Patch 4) is a major change in modpost where we no longer try to
find all the good guys but instead look for the bad combinations.
This should result in a lot less false warnings and for example got
rid of an irritating warning on sparc64.

Patch 2) is important - previously modpost failed to find the
correct symbol based on address lookup because it wanted an exact
match. Allowing up to 20 bytes offset we now locate almost all
symbols and the warnings are much easier to fix.

Randy and Adrian among others have done a great job fixing
many Section mismatch warnngs over the last month.
But frankly much more people should do this and I can see people
ignoring the warnings.

Therefore the plan is to turn the warnings into hard build errors
at -rc1 time.
This should force people to actually fix the warnings they introduce.

But to do so we need the warnings we have today gettign fixed and
the new improved modpost should help you here.
To further help the plans are to:
- add a config option to enable -fno-inline (or a similar option)
- make the warnings from modpost more descriptive but longer 
- maybe to spend a few hours to fix some of the obvious candidates
  Less than half an hour for each warning for the trivial cases
- Maybe start using __INIT and friends in assembler code
  xen had two bugs in this area recently for example.

It has been questions if it is worth the effort to fix these warnings.
Randy just fixed three oops candidates - do anyone need more facts?

And the cpu code looks rather fragile in the dead/removed CPU cases.
I see several references that will oops and is easy to fix.

	Sam




^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2008-01-22 21:25 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-20 20:05 kbuild: improved Section mismatch detection Sam Ravnborg
2008-01-20 20:08 ` [PATCH] kbuild: fix so modpost can now check any .o file Sam Ravnborg
2008-01-20 20:08   ` [PATCH] kbuild: try harder to find symbol names in modpost Sam Ravnborg
2008-01-20 20:08     ` [PATCH] kbuild: code refactoring " Sam Ravnborg
2008-01-20 20:08       ` [PATCH] kbuild: introduce blacklisting " Sam Ravnborg
2008-01-20 20:09         ` [PATCH] kbuild: check section names consistently " Sam Ravnborg
2008-01-20 20:09           ` [PATCH] all archs: consolidate init and exit sections in vmlinux.lds.h Sam Ravnborg
2008-01-20 20:09             ` [PATCH] compiler.h: introduce __section() Sam Ravnborg
2008-01-20 20:09               ` [PATCH] Use separate sections for __dev/__cpu/__mem code/data Sam Ravnborg
2008-01-21  7:33                 ` Paul Mundt
2008-01-21  9:57                   ` Sam Ravnborg
2008-01-21 10:29                     ` Andreas Schwab
2008-01-21 10:45                       ` Sam Ravnborg
2008-01-21 10:47                         ` Sam Ravnborg
2008-01-21 10:52                           ` Paul Mundt
2008-01-21 12:06                             ` Sam Ravnborg
2008-01-22  0:56                               ` Paul Mundt
2008-01-22  3:25                                 ` Sam Ravnborg
2008-01-22 21:17                 ` Greg KH
2008-01-22 21:25                   ` Russell King
2008-01-21  1:00         ` [PATCH] kbuild: introduce blacklisting in modpost Rusty Russell
2008-01-21  0:56   ` [PATCH] kbuild: fix so modpost can now check any .o file Rusty Russell
2008-01-21  6:11     ` Sam Ravnborg
2008-01-20 21:33 ` kbuild: improved Section mismatch detection Sam Ravnborg
2008-01-20 22:27 ` Adrian Bunk
2008-01-21  2:51   ` Sam Ravnborg
2008-01-21 20:31   ` Sam Ravnborg
2008-01-21 20:56     ` Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).