FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
794 views 0 comments
by anonymous

Hello.

Months ago I generated a binary with some source files of C. The binary had a size of 48KB. Now I was going to make a change but, without modifying anything, when compiling I get a 2.9MB binary. I don't remember having changed anything, and I don't know why the binary has a different size.

Using lddtree command I get for the 48KB application

lddtree -a old_app

old_app => ./old_app (interpreter => /lib/ld-uClibc.so.0)

libm.so.0 => not found libgcc_s.so.1 => not found

libc.so.0 => not found

and for the 2.9MB application

lddtree -a new_app

new_app => ./new_app (interpreter => none)

The path that I using are:

PATH=$PATH:/RUT9XX_R_GPL/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin
export PATH

STAGING_DIR=/RUT9XX_R_GPL/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2
export STAGING_DIR
 

And I've compiling with

mips-openwrt-linux-gcc main.c -o app

1 Answer

0 votes
by anonymous

I found the solution to the problem.

If I compiled with

mips-openwrt-linux-gcc -std=gnu99 -lm main.c -o app

I got a binary with original size (48KB vs. 2.9MB)