Bug 472046 - EXPORT_SYMBOL does not export unused symbols
EXPORT_SYMBOL does not export unused symbols
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
4.8
All Linux
medium Severity medium
: rc
: ---
Assigned To: Prarit Bhargava
Martin Jenner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-18 08:52 EST by Prarit Bhargava
Modified: 2009-04-07 09:59 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-04-07 09:59:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
RHEL4 initial patch for this issue (11.87 KB, patch)
2008-11-18 11:14 EST, Prarit Bhargava
no flags Details | Diff

  None (edit)
Description Prarit Bhargava 2008-11-18 08:52:43 EST
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.
2. Compile
3. 
  
Actual results:

Look in the System.map for the symbol.  It is not there.

Expected results:

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).
Comment 1 Prarit Bhargava 2008-11-18 11:14:04 EST
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 ...

P.
Comment 2 Prarit Bhargava 2008-11-18 14:47:42 EST
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 ...

P.
Comment 4 RHEL Product and Program Management 2009-03-12 14:56:31 EDT
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 
blocker.
Comment 5 Prarit Bhargava 2009-04-07 09:59:45 EDT
Closing as WONTFIX.  The RHEL4.9 bug list will be very small and I don't think this issue will make the cut.

P.

Note You need to log in before you can comment on or make changes to this bug.