Try this:
objcopy -j .text -O binary firmware.ko firmware.text
The file firmware.text
should then contain what you want.
UPDATE: The above should work if the firmware file is in the same format that your machine (running objcopy
) uses. If it is not the case, you'll be getting:
objcopy: Unable to recognise the format of the input file `firmware-arm.ko'
Then you'll have to specify the format yourself with -I
. Using file
will tell you what format your firmware is in, e.g.:
$ file firmware-arm.ko
firmware-arm.ko: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), BuildID[sha1]=0xec2e703615d915dd1cad09ecc12ff7d57ef186a5, not stripped
And then (for this case where you have an ELF 32 little endian) you'll need:
objcopy -j .text -O binary -I elf32-little firmware-arm.ko firmware-arm.text
http://stackoverflow.com/questions/20898354/objdump-to-extract-contents-of-text-segment-to-a-binary-format – Ciro Santilli 新疆改造中心法轮功六四事件 – 2015-09-04T13:03:03.107