> Nearly always. The problem is that the patch may make the module
> bigger/smaller or relocate variables whose address then changes. All
> locations that these are referenced must be modified (either direct
> address or offset). Sometimes other modules will get relocated too.
You're too young. Or I'm too old. :-)
IF your patch can be inserted into the code space available: Then good.
If not, you move the code out of the previously allocated space, and
put it somewhere else. Put a "jump" instruction in the old place.
At the university there was a lab-assignment where we had to use the
provided semaphore routines. Turns out we found a bug. The TA then
told us it was going to be hard-to-fix, as about 8192 bytes of the 8k
PROM were in use. He was wrong. The bug was one instruction too
many. We just wrote "nop" over the bad instruction. The processor had
also been correctly designed: you could overwrite any instruction in
the PROM with "nop", as the NOP instruction was 0xff. Fixed on the
spot!
Roger.
-- ** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 ** *-- BitWizard writes Linux device drivers for any device you may have! --* * There are old pilots, and there are bold pilots. * There are also old, bald pilots. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/