how does objcopy work? and how does the linux kernel process relocation with that stripped off image?

ckim at ckim at
Fri Dec 18 04:21:36 EST 2020

I saw in a linux build log this command (how to generate from 'vmlinux' to



> -O binary -R .note -R -R .comment -S vmlinux


so the 'Image' file is generated from 'vmlinux' by objcopy command and about
the -S option, objcopy help says 

    '-S --strip-all                   Remove all symbol and relocation


I checked I can run 'Image' file on the machine and it really boots linux to
some point(I just tested it on qemu-system-aarch64, with -m virt option),
arm support person says the 'Image' file is loaded at 0x40000000 in the
'virt' machine when I passed the 'Image' with -kernel option.(I guess the
qemu knows where to load it..).  


My question is, I understand I can load the 'Image' file anywhere on the
memory (because it's position independent code using only relative offsets
for function calls and variable addresses probably,..), and at some point
the kernel itself relocates the kernel image to somewhere else. (In arm64
linux, they don't use compressed kernel, so is it not relocated later in
this case?). How does the kernel program ('Image') relocates the image and
setup the MMU table when there is no symbol or relocation table?  

Can anyone correct my understanding if I'm wrong and explain to me how
objcopy works and how kernel relocation is done in this case?(if it's done).

(I know 'vmlinux' file is ELF file so the loader knows where to load it from
where to start it, but this 'Image' files doesn't have any such

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Kernelnewbies mailing list