
binz format are somehow related to the browser - scripts for installation in the browser, scripts for execution in the developer's console in the browser, even separate specially formed pages for the browser (and even specially configured browsers).

You see, all current solutions for working with the. You probably should read a good OS textbook like Operating System: Three Easy Pieces.Yes, I know about this script, thanks for the link.Ī little later (when I have enough time) I will take a look at its code, and, perhaps, I will find there something useful for my utility. Read also more about ABIs, the x86-64 ABI, the Linux Assembly HowTo, the Advanced Linux Programming book.

what is their starting point, how they are loaded and started) and you probably also use some very specific linker script, and of course that binary cannot contain any syscall to the linux kernel (in particular cannot do any kind of input or output the way a plain Linux executable does them). The main purpose of that objcopy -O binary command is to make firmware or kernel-like stand-alone (or freestanding) binaries, and then you need to exactly understand how they should look like (e.g. I don't understand why you expect the result of objcopy -O binary to be executable by Linux using execve(2). In particular you lose the entry point and the segments list given in the original ELF header.

The memory dump will start at the load address of the lowest section copied into the output file. All symbols and relocation information will be discarded. When objcopy generates a raw binary file, it will essentially produce a memory dump of the contents of the input object file. Objcopy can be used to generate a raw binary file by using an output target of `binary' (e.g., use -O binary).

When you use objcopy -O binary, you are copying only the binary data: All this meta-data is needed by the kernel for execve(2) and is lost with objcopy -O binary. Recall that ELF is quite a complex and versatile format, it specifies the starting address, the interpreter ( ld-linux(8) dynamic linker), the several segments of the program etc. Your objcopy(1) command is loosing the essential meta-data in the ELF file. To be executable by the execve(2) syscall, a file usually has to be some elf(5) file (or some script, or some old a.out format).
