Re: OFFTOPIC: binary modules, bad idea!

Theodore Y. Ts'o (tytso@MIT.EDU)
Fri, 19 Dec 1997 17:48:01 -0500


Date: Fri, 19 Dec 1997 13:41:08 -0600
From: Michael Elizabeth Chastain <mec@shout.net>

I think the existing implementation is a mess. 'genksyms'
gets run on the source files that export symbols and generates .ver
files containing lines such as '#define kmalloc kmalloc_1F43278'.
These .ver files are fed to the compiler when compiling any module.

This implementation was developed before ELF, and I think we can do a
lot better with ELF. We can use true separate compilation. When any
file exports symbols, the symbol type information should be recorded,
in a separate ELF section. When a module file imports symbols, the
symbol type information should be recorded in a separate ELF section.
Then sys_init_module and insmod could check type information.

What goals are you proposing to solve by going using more the ELF
features? The symbols are ugly, true, but is there anything else that
you want to solve by doing this?

The reason why I ask is because I can think of a number of
disadvantages:

Storing the type information in a seperate ELF section is cleaner,
granted, but way ELF stores type information for use with debugging is
(a) very large, and (b) produces incomparable information if two object
files #include a different set of system header files, or #include them
in a different order. You could store the type information in yet
another format from DWARF, but that would make the object files that
contain debugging information larger yet since the type information
would be store twice.

- Ted