Skip to contentSkip to conversation

2.5.51 CRC32 undefined

DISCUSSION Arun Prasad 6 participants 8 messages Mar 6, 2003 – Mar 10, 2003 Library code

lore
Share & tools
lore
#0 lore raw

Hi All,
To install the Fault-Injection tool (fith-mini-13), did the
following steps

* The below are the seps given in the tool README

1. Apply patch kprobes-2.5.50-bk2.patch
Apply patch fi-2.5.51-bk1.patch

2. cd fith_utility
make
make install
So copied kernel 2.5.51 and applied both the patches specified
above.

* Compiled the kernel with the below in .config file

    CONFIG_MODULES=y
    CONFIG_CRC32=y
    CONFIG_PCNET32=m

* Booted the kernel with the new kernel (2.5.51), but eth0 is not up.. The ethernet driver is not loaded..
(pcnet32 is the ethernet device of the machine.... it works fine
witht he default 2.4 kernel)

* Did the insmod for the driver
bash$ insmod ./pcnet32.o
pcnet32: Unknown symbol crc32_le
Error inserting "pcnet32.o": -1 Unknown symbol in module

* Checked linux-2.5.51/lib/crc32.c and found the lines

    EXPORT_SYMBOL(crc32_le);
    EXPORT_SYMBOL(crc32_be)

* There is no /proc/ksyms in the kernel and "ksyms" command doesnt seems to work....

Can anyone help me out in this....

Thanks
-arun

#1 lore raw
Quoted 2 lines · Arun Prasad
    CONFIG_CRC32=y
    CONFIG_PCNET32=m
	<...>
Quoted 1 line

pcnet32: Unknown symbol crc32_le

The problem is that crc32.o isn't actually linked into the kernel, because no symbols from it are referenced when the linker is asked to pull in lib/lib.a

Set CONFIG_CRC32=m. We probably shouldn't allow it to be set to 'Y' in the first place., given the above.

===== lib/Kconfig 1.2 vs edited =====

lib/Kconfig +1 -0
@@ -6,6 +6,7 @@
 
 config CRC32
 	tristate "CRC32 functions"
+	depends on m
 	help
 	  This option is provided for the case where no in-kernel-tree
 	  modules require CRC32 functions, but a module built outside the
Signature · 1 line
dwmw2
#2 lore raw
Quoted 6 lines · David Woodhouse

The problem is that crc32.o isn't actually linked into the kernel, because no symbols from it are referenced when the linker is asked to pull in lib/lib.a

Set CONFIG_CRC32=m. We probably shouldn't allow it to be set to 'Y' in the first place., given the above.

I think it'd be much nicer to just make it work, which can easily be done by moving the EXPORT_SYMBOL() to kernel/ksyms.c. Or, just move the entire file into kernel/ (which unfortunately isn't a very natural place for it. The real problem is that we need a lib/dont_drop_unreferenced/)

--Kai

#3 lore raw
Quoted 7 lines · David Woodhouse
Quoted 6 lines

The problem is that crc32.o isn't actually linked into the kernel, because no symbols from it are referenced when the linker is asked to pull in lib/lib.a

Set CONFIG_CRC32=m. We probably shouldn't allow it to be set to 'Y' in the first place., given the above.

The solution is to fix the problem, not force a module.

There are weirdos like Linus that don't use modules at all, and other developers who still don't use modules due to the module loader changes...

Jeff

#6 lore raw
In reply to Linus Torvalds
Quoted 3 lines · Linus Torvalds

I don't want to have configs like this. I personally refuse to load modules into my kernel, and as such a subsystem that only works as a module is _evil_.

It works built-in and would continue to do so with this patch applied.

It's built into your kernel _automatically_ if anything built-in requires it. That's done by the makefiles. Likewise, it's built as a module automatically if anything modular in your tree requires it.

The config option is _only_ relevant if you are explicitly adding crc32 in the knowledge that you're going to build an _external_ module which requires it.

However, setting the config option to 'Y' when you have only _modular_ stuff which requires it is broken because it doesn't actually get pulled in from lib/lib.a, because nothing references it.

Signature · 1 line
dwmw2
#5 lore raw
In reply to David Woodhouse
Quoted 3 lines · David Woodhouse

Set CONFIG_CRC32=m. We probably shouldn't allow it to be set to 'Y' in the first place., given the above.

I don't want to have configs like this. I personally refuse to load modules into my kernel, and as such a subsystem that only works as a module is _evil_.

Linus

#7 lore raw
In reply to David Woodhouse
Quoted 3 lines · David Woodhouse

However, setting the config option to 'Y' when you have only _modular_ stuff which requires it is broken because it doesn't actually get pulled in from lib/lib.a, because nothing references it.

Agreed. And the fix is to allow 'Y' as expected :)

Jeff

#4 lore raw
In reply to Kai Germaschewski
Quoted 6 lines · Kai Germaschewski
Quoted 4 lines · David Woodhouse

The problem is that crc32.o isn't actually linked into the kernel, because no symbols from it are referenced when the linker is asked to pull in lib/lib.a

Quoted 7 lines
Quoted 2 lines

Set CONFIG_CRC32=m. We probably shouldn't allow it to be set to 'Y' in the first place., given the above.

I think it'd be much nicer to just make it work, which can easily be done by moving the EXPORT_SYMBOL() to kernel/ksyms.c. Or, just move the entire file into kernel/ (which unfortunately isn't a very natural place for it. The real problem is that we need a lib/dont_drop_unreferenced/)

Is it just me, or does lib/lib._a_ not make too much sense? It is nice to be speaking about the kernel library, but what are the benefits of it being a .a instead of a .o?

J�rn

Signature · 4 lines
Don't worry about people stealing your ideas. If your ideas are any good,
you'll have to ram them down people's throats.
-- Howard Aiken quoted by Ken Iverson quoted by Jim Horning quoted by
   Raph Levien, 1979