Bug 12458

Summary: EXPORT_SYMBOL BUG - DEFINED AND EXPORTED IN A FILE1 ( IN DIR1) IS NOT ACCESSIBLE TO A FILE2 (IN DIR2) - DON'T WANT COMPILE TIME DEPENDENCY SOLUTIONS
Product: Other Reporter: sucheta (sucheta)
Component: ModulesAssignee: other_modules
Status: RESOLVED UNREPRODUCIBLE    
Severity: high CC: alan
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.27 Subsystem:
Regression: No Bisected commit-id:

Description sucheta 2009-01-16 03:49:22 UTC
Latest working kernel version: 2.6.27
Earliest failing kernel version: 2.6.26
Distribution: SUSE 11
Hardware Environment: 
Software Environment: Linux
Problem Description:

I am facing EXPORT_SYMBOL problem for kernel "2.6.27" kernel.
If I have defined a symbol (say "a") in file "p/dir1/file1" and exported it and try to use in "p/dir2/file2" file, symbol "a" isn't accessible to "file2".

Not acceptable solution :-
Don't want to copy Module.symvers file to "p/dir2" as it introduces a dependency of "file2" on "file1". 

Note:
Run-time dependency is perfectly ok, but don't want compile time dependency.
(as in 2.6.18 kernel, check_version didn't reqd. the symbol to be present in its version table, it will return 1 (success). find_symbol (in 2.6.18) function will help find the symbol present in any other external module, and it will be used. In 2.6.26 onwards, even if find_symbol returns success, but if the external symbol isn't present in module's version table, the symbol will just not be visible to the module. ).

Most probably a bug. If not, what is the solution? (Else insmod of external modules is no longer possible - until and unless all dependent modules are compiled together.) WEIRD???


Steps to reproduce:
(1) write a simple hello world program in file say p/dir1/file1 and export a symbol "a" from it.
(2) write just another program in file say p/dir2/file2 and try using symbol "a" of p/dir1/file1.

It fails and gives kernel panic.
Comment 1 Alan 2009-03-26 16:16:02 UTC
This is for reporting kernel bugs not asking for support with your own problems. The kernel exports module symbols happily between modules and directories