Hi Dmitry, > Thank you for suggestion, but map did not reveal anything. The only part > (section?) with non zero size is .text of size 0xd (=13). This is > correct, raw instructions are really 13 bytes (according to `objdump -d').
> By the way, `readelf --sections' reports, that there is no sections in > fasm-generated binary. I do not know, how does fasm do it, but probably > is saves on section headers or something like this. Is is possible to > make `ld' do the same? Ah ha - maybe that is it. Maybe fasm is generating a binary with just program segments but no sections, whereas ld is generating a binary with both sections and segments[1]. Unfortunately I do not know of a way to tell ld to stop generating the sections. Unfortunately it also appears that the objcopy tool does not have an option for removing the sections either. (Actually it does, but removing the sections would remove the code as well, whereas what we want to do is to remove the section header table but leave in the program header table). I am sorry, but I think that I going to be unable to help you. :-( Cheers Nick [1]. You could check this theory by running "readelf --section-headers --program-headers" on the two binaries. Both should have program headers but, if the theory is right, only the ld generated binary will have section headers. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils