문제

How do we use objdump to output to a binary file?

This is definitely not the right way to do so:

objdump -s -j .text /path/firmware.ko > /content.bin

as it is only presenting text format. I only require the bytes of the text segment to be extracted and to be set in binary forms.

도움이 되었습니까?

해결책

We have to specify the file format explicitly using the -I.

objcopy -I #file type format# -j #ELF segment contents to copy# -O #data type to output, binary, etc# #input file# #output file#

eg.

 
objcopy -I elf32-little -j .text -O binary firmware.ko content.bin 

다른 팁

You can use objcopy instead

objcopy -O binary --only-section=.text /path/firmware.ko /content.bin
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top