__udivdi3 undefined — how to find the code that uses it?

后端 未结 3 1485
再見小時候
再見小時候 2020-12-15 19:22

Compiling a kernel module on 32-Bit Linux kernel results in

\"__udivdi3\" [mymodule.ko] undefined!
\"__umoddi3\" [mymodule.ko] undefined!

E

3条回答
  •  天命终不由人
    2020-12-15 20:10

    Actually, 64-bit integer divison and modulo are supported within a 32-bit Linux kernel; however, you must use the correct macros to do so (which ones depend on your kernel version, since recently new better ones were created IIRC). The macros will do the correct thing in the most efficient way for whichever architecture you are compiling for.

    The easiest way to find where they are being used is (as mentioned in @shodanex's answer) to generate the assembly code; IIRC, the way to do so is something like make directory/module.s (together with whatever parameters you already have to pass to make). The next easiest way is to disassemble the .o file (with something like objdump --disassemble). Both ways will give you the functions where the calls are being generated (and, if you know how to read assembly, a general idea of where within the function the division is taking place).

提交回复
热议问题