| Age | Commit message (Collapse) | Author |
|
Introduces __module_get for places where we know we already hold
a reference and ignoring the fact that the module is being "rmmod --wait"ed
is simpler.
|
|
Restores .modinfo section, and uses it to store license and vermagic.
|
|
This comment seems to want to include SET_MODULE_OWNER as one of the
deprecated facilities.
|
|
This patch fixes two issues:
o The CONFIG_MODVERSIONING=y case broke at compile time since some
functions were not updated with the latest module changes
o Exporting symbols from modules stopped working due to confusion of
mod->num_syms and mod->num_ksyms. Rename mod->num_ksyms to mod->num_syms,
which is more logical since the associated array is called ->syms, and
for the kallsyms member use "num_symtab", since the associated array is
->symtab.
|
|
This implements a simple notifier so oprofile can notice removed and
added modules properly
|
|
This removes the extable list, and the struct exception_table, in
favour of just iterating through the modules. Now all iteration is
within kernel/module.c, this is a fairly trivial cleanup.
|
|
This removes the symbol list, and the concept of kernel symbol groups,
in favour of just iterating through the modules. Now all iteration is
within kernel/module.c, this is a fairly trivial cleanup.
|
|
By making module_text_address return the module it found, we
simplify symbol_put_addr significantly.
|
|
As the netfilter folks don't seem to have any interest in 2.5 currently
I decided to fix their last uses of those old module interfaces myself.
The implementation (get a reference first and release it again when
not actually needed) might be slightly suboptimial but the netfilter
team should just fix it if/when they get any interest in Linux 2.5/2.6.
Also fix the MOD_INC_USE_COUNT/MOD_DEC_USE_COUNT to give more accurate
deprecation warnings.
|
|
|
|
By Rusty Russell.
o generate output in a form feasible as linker script instead of
munging it with sed during the build
o remove checksum version 1 support
o remove prefix support
|
|
it's a noop in 2.5 now that the behvaiour of implicitly exporting
all symbols is gone.
|
|
Introduces "MODULE_ALIAS" which modules can use to embed their own
aliases for modprobe to use. Also adds a "finishing" step to modules to
supplement their aliases based on MODULE_TABLE declarations, eg.
'usb:v0506p4601dl*dh*dc*dsc*dp*ic*isc*ip*' for drivers/usb/net/pegasus.o
|
|
|
|
CONFIG_MODVERSIONING was a temporary name introduced to distinguish
between the old and new module version implementation. Since the
traces of the old implementation are now gone from the build system,
we rename the config option back in order to not confuse users more
than necessary in 2.6.
Also, remove some historic modversions cruft throughout the tree.
|
|
Patch from Rusty Russell <rusty@rustcorp.com.au>
Make symbol_get() use undefined weak symbols if !CONFIG_MODULE.
Many thanks to RTH for introducing undef weak symbols to me.
|
|
When building linux-2.5.59 with gcc-3.3 (on s390, if that matters),
I get a warning like "warning: `__ksymtab___foo' defined but
not used" each time that EXPORT_SYMBOL is used.
by Arnd Bergmann
|
|
In the case of CONFIG_MODVERSIONING, the build step will only
generate preliminary <module>.o objects, and an additional
postprocessing step is necessary to record the versions of the unresolved
symbols and add them into the final <module>.ko
The version information for unresolved symbols is again recorded into
a special section, "__versions", which contains an array of symbol
name strings and checksum (struct modversion_info). Size is here not
an issue, since this section will not be stored permanently in kernel
memory.
Makefile.modver takes care of the following steps:
o Collect the version information for all exported symbols from vmlinux
and all modules which export symbols.
o For each module, generate a C file which contains the modversion
information for all unresolved symbols in that module.
o For each module, compile that C file to an object file
o Finally, link the <module>.ko using the preliminary <module.o> + the
version information above.
The first two steps are currently done by not very efficient scripting,
so there's room for performance improvement using some helper C code.
|
|
Store the information on the checksum alongside the rest of the
information on exported symbols. To actually use them, we need
something to check them against first, though ;)
Also, fix some conditional debug code to actually compile.
|
|
Up to now, we had a way to store the checksums associated with the
exported symbols, but they were not filled in yet. This is done
with this patch, using the linker to actually do that for us.
The comment added with this patch explains what magic exactly is going
on.
|
|
This patch adds the new config option CONFIG_MODVERSIONING which will
be the new way of checking for ABI changes between kernel and module
code.
This and the following patches are in part based on an initial
implementation by Rusty Russell and I believe some of the ideas go back
to discussions on linux-kbuild, Keith Owens and Rusty.
though I'm not sure I think credit for the basic idea of
storing version info in sections goes to Keith Owens and Rusty.
o Rename __gpl_ksymtab to __ksymtab_gpl since that looks more consistent
and appending _gpl instead of putting it into the middle simplifies
sharing code for EXPORT_SYMBOL() and EXPORT_SYMBOL_GPL()
o Add CONFIG_MODVERSIONING
o If CONFIG_MODVERSIONING is set, add a section __kcrctab{,_gpl}, which
contains the ABI checksums for the exported symbols listed in
__ksymtab{,_crc} Since we don't know the checksums yet at compilation
time, just make them an unresolved symbol which gets filled in by the
linker later.
|
|
Another left-over from ancient module code, it was supposed to return
non-zero if the module has a use count, but currently it always
evaluates to 0.
There are a few users of different types:
(1) ioctl that perform a while(MOD_IN_USE) MOD_DEC_USE_COUNT loop.
Just rip them out, we now have forced module unloading.
(2) printk's that moan if the use-count in not zero in the exitfunc.
Just rip them out, this can't happen.
(3) if(MOD_IN_USE) MOD_DEC_USE_COUNT constructs in ->close of a few
serial drivers. Just remove the conditional, we did a
MOD_INC_USE_COUNT in ->open.
(4) This one is interesting: drivers/sbus/char/display7seg.c uses
the module use count to track openers. Replace this with an
atomic_t.
In addition remove tons of stale comments in network driver that aren't
understandable for anyone who doesn't know ancient Linux module semantics.
|
|
This is a left-over from the old modules code, Rusty stubbed it out
to always return 0. Three scsi pcmcia driver check it for beeing non-NULL,
trying to work around their unload races. I've added #warnings there
and stubbed out the GET_USE_COUNT so we can remove it from the core.
|
|
The current code reserves 60 bytes for the symbol string of every
exported symbol, unnecessarily wasting kernel memory since most symbols
are much shorter. We revert to the 2.4 solution where the actual strings
are saved out of line and only the pointers are kept.
The latest module-init-tools already handle this case, people who are
using older versions need to update to make sure depmod works
properly.
Saves 80 KB in vmlinux with my .config.
|
|
This also avoids the nasty warnings that nobody seems to bother
to fix.
|
|
Add a missing inline, shows up when modules are turned off.
|
|
Various archs (i386, m68k, s390, s390x, m68k, parisc, um, x86_64)
implement kernel_text_address. Put this in kernel/extable.c, and the
module iteration inside module.c.
Other than cleanliness, this finally allows the module list and lock
to be static to kernel/module.c (you didn't think I actually cared
about those archs did you?)
It also drops the module->init_size to zero when it's discarded, so
bounds checking is simplified (and the /proc/modules size statistic
will be more accurate, too).
|
|
into home.transmeta.com:/home/torvalds/v2.5/linux
|
|
This patch combines the common exception table searching functionality
for various architectures, to avoid unneccessary (and currently buggy)
duplication, and so that the exception table list and lock can be kept
private to module.c.
The archs provide "struct exception_table" and "search_extable": the
generic infrastructure drives the rest.
|
|
This implements EXPORT_SYMBOL_GPL and MODULE_LICENSE properly (so
restrictions are enforced). Also fixes "proprietory" spelling.
|
|
modules are disabled.
|
|
completly remove the old try_inc_mod_count()
|
|
Expose declaration of __this_module outside #ifdef KBUILD_MODNAME
(which is not defined for objects included in two modules).
|
|
Rather than have the module loader the module structure and
resolve the symbols __this_module to it, make __this_module a real
structure inside the module, using the linkonce trick we used for
module names.
This saves us an allocation (saving a page per module on
archs which need the module structure close by), and means we don't
have to fill in a few module fields.
|
|
Rename the deprecated attribute to __deprecated to make it obvious
this is something special and to avoid namespace clashes.
Mark old module interfaces deprecated.
|
|
This is the backwards compatibility code for MODULE_PARM, and moves
__MODULE_STRING() down to the graveyard at the bottom of module.h.
It's complicated by the fact that many modules place MODULE_PARM()
before the declaration (some do MODULE_PARM() for non-existant
variables, too). To avoid breaking them, we have to do the name
lookups at load time, rather than just storing a pointer 8(
CONFIG_OBSOLETE_MODPARM is set to y without prompting: it's a useful
marker for deprecating in 2.7.
|
|
In some configurations, parport and bttv request a module inside their
module_init function. Drop the lock around mod->init(), change
module->live to module->state so we can detect modules which are in
init.
|
|
By Kai Germaschewski:
"Well, I have another solution, which doesn't need additional Makefile
magic or anything.
I just put the module name into each .o file where <linux/module.h> is
included. Putting it into the section .gnu.linkonce.modname has the effect
that even for multi-part modules, we only end up with one copy of the
name.
Caveat: I'm using the preprocessor macro KBUILD_MODNAME to know what to
put into .gnu.linkonce.modname. The following used to happen:
(drivers/isdn/eicon/Makefile)
divas-objs := common.o Divas_mod.o ...
eicon-objs := common.o eicon_mod.o ...
Divas_mod.o is compiled with -DKBUILD_MODNAME=divas
eicon_mod.o is compiled with -DKBUILD_MODNAME=eicon
common.o is compiled with -DKBUILD_MODNAME=divas_eicon
So in the case above, both divas.o and eicon.o would end up with
a .gnu.linkonce.modname section containing "divas_eicon"
My fix to this is to not define KBUILD_MODNAME when compiling an object
whilch will be linked into more than one module - so common.o gets no
.gnu.linkonce.modname section at all. Works fine here.
Now, doing this I remove one of the reasons why we would need modules
linked as '.ko' ;), but it seems much cleaner than generating a temporary
file, using objcopy etc."
|
|
On the v850, the elf toolchain uses a `_' prefix for all user symbols
(I'm not sure why, since most toolchains seem to have dropped this sort
of thing).
The attached patch adds the ability to deal with this, if the macro
MODULE_SYMBOL_PREFIX is defined by <asm/module.h>. This only affects
places where symbol names come from the user, e.g., EXPORT_SYMBOL, or
the explicit symbol-names used in kernel/module.c itself.
[Tweaked a little by Rusty, original by Miles Bader]
|
|
This patch allows the new depmod to generate the USB & PCI hotplug
tables. Greg Banks and I are (slowly) working on a better solution, but
allows the old-style "modules.pcimap" etc. to be generated in the short
term.
This patch adds a "__mod_XXX_table" symbol which is an alias to the
module table, rather than a pointer. This makes it relatively trivial
to extract the table. Previously, it required a pointer dereference,
which means the relocations must be applied, which is why the old depmod
needs so much of modutils (ie. it basically links the whole module in
order to find the table).
The old depmod can still be invoked using "-F System.map" to generate
the tables (there'll be lots of other warnings, and it will generate a
completely bogus modules.dep, but the tables should be OK.)
|
|
Patch from Adam Richter. I have a nicer solution based on aliases, but
it requires coordination with USB, PCI and PCMCIA maintainers, which is
taking time.
This restores the old code in the meantime: one week without this is too
long for people who need it.
|
|
was enabled, so split it up into "extable.c"
|
|
Since I believe kallsyms is important, this reimplements it sanely,
using the current module infrastructure, and not using an external
kallsyms script.
FYI, the previous interface was:
int kallsyms_symbol_to_address(
const char *name, /* Name to lookup */
unsigned long *token, /* Which module to start with */
const char **mod_name, /* Set to module name or "kernel" */
unsigned long *mod_start, /* Set to start address of module */
unsigned long *mod_end, /* Set to end address of module */
const char **sec_name, /* Set to section name */
unsigned long *sec_start, /* Set to start address of section */
unsigned long *sec_end, /* Set to end address of section */
const char **sym_name, /* Set to full symbol name */
unsigned long *sym_start, /* Set to start address of symbol */
unsigned long *sym_end /* Set to end address of symbol */
);
The new one is:
/* Lookup an address. modname is set to NULL if it's in the kernel. */
const char *kallsyms_lookup(unsigned long addr,
unsigned long *symbolsize,
unsigned long *offset,
char **modname);
|
|
Separates the module loading function prototypes (and elf.h) into
moduleloader.h. AT_GID in elf.h clashes with xfs.h, but this also
makes module.h less cluttered.
|
|
Fixes crypto so it compiles with !CONFIG_MODULES, and cleans up two
other cases which did #ifdef CONFIG_MODULES.
|
|
|
|
(Yes, they should probably use __stringify() instead).
|
|
This is an implementation of the in-kernel module loader extending
the try_inc_mod_count() primitive and making its use compulsory.
This has the benifit of simplicity, and similarity to the existing
scheme. To reduce the cost of the constant increments and
decrements, reference counters are lockless and per-cpu.
Eliminated (coming in following patches):
o Modversions
o Module parameters
o kallsyms
o EXPORT_SYMBOL_GPL and MODULE_LICENCE checks
o DEVICE_TABLE support.
New features:
o Typesafe symbol_get/symbol_put
o Single "insert this module" syscall interface allows trivial userspace.
o Raceless loading and unloading
You will need the trivial replacement module utilities from:
http://ozlabs.org/~rusty/module-init-tools-0.6.tar.gz
|
|
Changeset
willy@debian.org|ChangeSet|20021016154637|46581
in linux 2.5 changed the name of .exit.text to .text.exit.
Unfortunately, one change got missed. Fix.
|
|
with attribute unused.
|