Red Hat Bugzilla – Bug 472046
EXPORT_SYMBOL does not export unused symbols
Last modified: 2009-04-07 09:59:45 EDT
Description of problem:
If a function is unused in the kernel and is marked EXPORT_SYMBOL, and is unused by any other function within the kernel, it is not actually exported via the System.map.
Version-Release number of selected component (if applicable): 78.EL
How reproducible: 100%
Steps to Reproduce:
1. Patch the kernel so that a function is unused by any other function and use EXPORT_SYMBOL to export it.
Look in the System.map for the symbol. It is not there.
If a symbol is exported in RHEL, it should be in the System.map.
Additional info: Found while looking at 298811.
There are a couple of options to fix this. The first is to add "_unused" to the definition of EXPORT_SYMBOL. The second is to backport _some_ of the code that implements EXPORT_SYMBOL_UNUSED in the kernel (we would have to remove the part of the code that implements the warnings).
Created attachment 323917 [details]
RHEL4 initial patch for this issue
The first option doesn't look like it will work out as we would tag every
symbol with the attribute __unused__. The second option leads to a significant
sized patch (see attachment).
I'm working on a hybrid between the two ...
Oops. Ignore the first patch. I clearly made a mistake during testing when I didn't eliminate all calls to find_next_zero_string() :/.
Looks like the backport of upstream's EXPORT_UNUSED_SYMBOL() didn't work. Seems like something is intrinsically broken ...
Since RHEL 4.8 External Beta has begun, and this bugzilla remains
unresolved, it has been rejected as it is not proposed as exception or
Closing as WONTFIX. The RHEL4.9 bug list will be very small and I don't think this issue will make the cut.