Re: How create small binaries with GNU binutils.

2019-02-15 Thread Dmitry Bogatov
[2019-02-13 13:17] Nick Clifton > [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. Checked. Confirmed. >

Re: How create small binaries with GNU binutils.

2019-02-13 Thread Nick Clifton
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 secti

Re: How create small binaries with GNU binutils.

2019-02-13 Thread Dmitry Bogatov
[2019-02-07 15:43] Nick Clifton > > part text/plain 498 > Hi Dmitry, > > >>> Still, even this way, 400 bytes is more then twice as big, compared to > >>> fasm. Any suggestions, how to shrink binary futher? > > > Thank you for suggestion. Tried both options; no difference --

Re: How create small binaries with GNU binutils.

2019-02-07 Thread Nick Clifton
Hi Dmitry, >>> Still, even this way, 400 bytes is more then twice as big, compared to >>> fasm. Any suggestions, how to shrink binary futher? > Thank you for suggestion. Tried both options; no difference -- 400 > bytes. Ho Hum. In which case, do you know what is in the extra bytes ? If you lin

Re: How create small binaries with GNU binutils.

2019-02-05 Thread Dmitry Bogatov
[2019-02-04 09:50] Nick Clifton > > Still, even this way, 400 bytes is more then twice as big, compared to > > fasm. Any suggestions, how to shrink binary futher? > > This might be because the linker defaults to page aligning the binaries. > Have you tried linking with the --nmagic option ? (Or

Re: How create small binaries with GNU binutils.

2019-02-04 Thread Nick Clifton
Hi Dmitry, > Still, even this way, 400 bytes is more then twice as big, compared to > fasm. Any suggestions, how to shrink binary futher? This might be because the linker defaults to page aligning the binaries. Have you tried linking with the --nmagic option ? (Or alternatively the --omagic opti

Re: How create small binaries with GNU binutils.

2019-02-03 Thread Dmitry Bogatov
[2019-02-01 17:49] Andreas Schwab > On Feb 01 2019, Dmitry Bogatov wrote: > > > results in huge binary: > > > > $ du -hb a.out > > 4744a.out > > $ strip -s a.out > > $ du -hb a.out > > 4408a.out > > $ file a.out > > a.out: ELF 64-bit LSB executable, x86-64, v

Re: How create small binaries with GNU binutils.

2019-02-01 Thread Andreas Schwab
On Feb 01 2019, Dmitry Bogatov wrote: > results in huge binary: > > $ du -hb a.out > 4744a.out > $ strip -s a.out > $ du -hb a.out > 4408a.out > $ file a.out > a.out: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically > linked, strip

How create small binaries with GNU binutils.

2019-02-01 Thread Dmitry Bogatov
[ Not a but, strictly speaking, but just do not know, where else to ask. ] Hello! I like AT&T syntax of amd64 assembler, so I am using GNU As. Unfortunately, it creates binries much bigger then one would expect from source code. For compraison, trivial program, that just exits with value 1 (ess