Bug 472046 - EXPORT_SYMBOL does not export unused symbols
Summary: EXPORT_SYMBOL does not export unused symbols
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel
Version: 4.8
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Prarit Bhargava
QA Contact: Martin Jenner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-11-18 13:52 UTC by Prarit Bhargava
Modified: 2009-04-07 13:59 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-04-07 13:59:45 UTC
Target Upstream Version:
Embargoed:


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

Description Prarit Bhargava 2008-11-18 13:52:43 UTC
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 16:14:04 UTC
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 19:47:42 UTC
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 Program Management 2009-03-12 18:56:31 UTC
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 13:59:45 UTC
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.