Kernel optimization: libs

How does one get this CRC algorithm? Is it one we can seriously use? According to this it's 25K smaller, and... does the same job.

...
Digging into the lib directory we can spot some low-hanging fruit:

    $ size lib/crc32.o
       text    data     bss     dec     hex filename
      25528       0       0   25528    63b8 lib/crc32.o

The CRC32 checksum implementation is not small; fortunately, a smaller alternative is available:

    $ ./scripts/config --disable CRC32_SLICEBY8
    $ ./scripts/config --enable CRC32_BI
    $ make lib/ && size lib/crc32.o
       text    data     bss     dec     hex filename
        340       0       0     340     154 lib/crc32.o

The crc32.o file my ramips compilation outputs is currently around 7K...

the ccitt version that OWRT seems to default in for my chipset is still 2.5K

Assuming it is kernel code, get the source and patch the kernel for your custom build.

If it is meaningful, submit an upstream patch, after confirming it hasn’t already been proposed and rejected.

Edit:

Remember also that the size of a specific object file is usually not the incremental change to the size of the kernel, between stripping and compression.

Re-reading the linked post, the "recipe" is there

The CRC32 checksum implementation is not small; fortunately, a smaller alternative is available:

    $ ./scripts/config --disable CRC32_SLICEBY8
    $ ./scripts/config --enable CRC32_BI
./lib/crc32defs.h:#ifdef CONFIG_CRC32_SLICEBY8
./lib/crc32defs.h:#ifdef CONFIG_CRC32_BIT

which are probably available with make kernel_menuconfig

1 Like

Thanks - I could not find a single config tool. I'm covering everything else before doing kernel_menuconfig - dragons.....

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.