Define boot address and entry point to split Linux kernel image

I have a complex toolchain for an embedded system (mipsel) on my x86 Linux. I know how to create a custom kernel (let it call the "vmlinux" image) for it and how to split this image with

objcopy -S -O binary vmlinux vmlinux.bin

For further processing, I also need the download address and image entry point. Before deleting, it’s not a problem to define them scripts/mksysmapvia

nm -n vmlinux | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)' > System.map

Then I can determine the download address and entry point through

awk '/A _text/ { print "0x"$1; }' < _System.map
awk '/T kernel_entry/ { print "0x"$1; }' < System.map

Now the problem is that sometimes I do not create the core of their own, but get a precompiled kernel after it has already deprived of its character through objcopy. Can someone tell me how to do this? I am not very good at building a kernel and using toolchains. Both nm and objdump do not like split image, saying

vmlinux.bin: File format not recognized
+5
source share
1 answer

On objcopy man page

objcopy (, -O ). objcopy , , , . . , .

, PowerPC:

vmlinux

bash-3.2$ file vmlinux
vmlinux: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), statically linked, not stripped

stripped vmlinux

bash-3.2$ file vmlinux.bin
vmlinux.bin: data

ELF PowerPC

bash-3.2$ powerpc-440fp-linux-objcopy -I binary vmlinux.bin -B powerpc -O elf32-powerpc vmlinux.bin.x

vmlinux ELF

bash-3.2$ file vmlinux.bin.x
vmlinux.bin.x: ELF 32-bit MSB relocatable, PowerPC or cisco 4500, version 1 (SYSV), not stripped

-I, -B -O. objcopy.

, , , , . .data secion.

+1

All Articles