What parts of the codebase are making binaries large?
Clash Royale CLAN TAG#URR8PPP
up vote
6
down vote
favorite
I have built some code for a simulator and am now trying to use TI's free toolchain to cross-compile to a target with 64kb of nvram. The compiler claims that my code is about 34kb beyond the ROM:
(...) msp430-elf/bin/ld: region `ROM' overflowed by 33716 bytes
Another line says it cannot fit the .text
field into its allotted space. I cannot believe that my additions are 34kb in total, let alone causing the binaries to overflow by this amount.
- The .o files my code has added to the project are a small fraction (200kb of the 1.9MB) of the project's total, and I have taken out a great deal of components that were in the project to begin with.
- I am already passing the compiler the
-Os -s
flags. - The new code has about 100 characters worth of string literals.
- My code uses many
math.h
functions (in fact it is the only part that does floating point arithmetic), make a call tostrtod
, and make a call tosprintf
Are there any tools or methods to breaks down what is causing the binaries to be so large?
c embedded cross-compiling microcontroller
add a comment |Â
up vote
6
down vote
favorite
I have built some code for a simulator and am now trying to use TI's free toolchain to cross-compile to a target with 64kb of nvram. The compiler claims that my code is about 34kb beyond the ROM:
(...) msp430-elf/bin/ld: region `ROM' overflowed by 33716 bytes
Another line says it cannot fit the .text
field into its allotted space. I cannot believe that my additions are 34kb in total, let alone causing the binaries to overflow by this amount.
- The .o files my code has added to the project are a small fraction (200kb of the 1.9MB) of the project's total, and I have taken out a great deal of components that were in the project to begin with.
- I am already passing the compiler the
-Os -s
flags. - The new code has about 100 characters worth of string literals.
- My code uses many
math.h
functions (in fact it is the only part that does floating point arithmetic), make a call tostrtod
, and make a call tosprintf
Are there any tools or methods to breaks down what is causing the binaries to be so large?
c embedded cross-compiling microcontroller
3
Take a look at the linker-generated map file, it should hopefully tell you everything you need.
– Some programmer dude
1 hour ago
I'd like to see your own answer on how did you actually solve this ;)
– Antti Haapala
31 mins ago
add a comment |Â
up vote
6
down vote
favorite
up vote
6
down vote
favorite
I have built some code for a simulator and am now trying to use TI's free toolchain to cross-compile to a target with 64kb of nvram. The compiler claims that my code is about 34kb beyond the ROM:
(...) msp430-elf/bin/ld: region `ROM' overflowed by 33716 bytes
Another line says it cannot fit the .text
field into its allotted space. I cannot believe that my additions are 34kb in total, let alone causing the binaries to overflow by this amount.
- The .o files my code has added to the project are a small fraction (200kb of the 1.9MB) of the project's total, and I have taken out a great deal of components that were in the project to begin with.
- I am already passing the compiler the
-Os -s
flags. - The new code has about 100 characters worth of string literals.
- My code uses many
math.h
functions (in fact it is the only part that does floating point arithmetic), make a call tostrtod
, and make a call tosprintf
Are there any tools or methods to breaks down what is causing the binaries to be so large?
c embedded cross-compiling microcontroller
I have built some code for a simulator and am now trying to use TI's free toolchain to cross-compile to a target with 64kb of nvram. The compiler claims that my code is about 34kb beyond the ROM:
(...) msp430-elf/bin/ld: region `ROM' overflowed by 33716 bytes
Another line says it cannot fit the .text
field into its allotted space. I cannot believe that my additions are 34kb in total, let alone causing the binaries to overflow by this amount.
- The .o files my code has added to the project are a small fraction (200kb of the 1.9MB) of the project's total, and I have taken out a great deal of components that were in the project to begin with.
- I am already passing the compiler the
-Os -s
flags. - The new code has about 100 characters worth of string literals.
- My code uses many
math.h
functions (in fact it is the only part that does floating point arithmetic), make a call tostrtod
, and make a call tosprintf
Are there any tools or methods to breaks down what is causing the binaries to be so large?
c embedded cross-compiling microcontroller
c embedded cross-compiling microcontroller
asked 1 hour ago
enthdegree
492620
492620
3
Take a look at the linker-generated map file, it should hopefully tell you everything you need.
– Some programmer dude
1 hour ago
I'd like to see your own answer on how did you actually solve this ;)
– Antti Haapala
31 mins ago
add a comment |Â
3
Take a look at the linker-generated map file, it should hopefully tell you everything you need.
– Some programmer dude
1 hour ago
I'd like to see your own answer on how did you actually solve this ;)
– Antti Haapala
31 mins ago
3
3
Take a look at the linker-generated map file, it should hopefully tell you everything you need.
– Some programmer dude
1 hour ago
Take a look at the linker-generated map file, it should hopefully tell you everything you need.
– Some programmer dude
1 hour ago
I'd like to see your own answer on how did you actually solve this ;)
– Antti Haapala
31 mins ago
I'd like to see your own answer on how did you actually solve this ;)
– Antti Haapala
31 mins ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
8
down vote
accepted
GNU binutils has tools to help you determine the size of each symbol or just each object file.
Have a look at size
for instance: https://manpages.debian.org/jessie/binutils/size.1.en.html
nm
is also worth a try, as it can show the size of each symbol in the object code: https://manpages.debian.org/jessie/binutils/nm.1.en.html
Know that printf
, sprintf
and many of the more complex library functions can often take up quite a few kB of extra ROM.
Floating point support using soft-floats will also bloat the code compared to using hard-float, i.e. using software emulation vs. hardware instructions to handle floating point.
Sometimes the compiler will add an astonishing amount of bloat :)
Careful inspecting the output of size
and nm
will give you intuition for what takes up much space and what doesn't.
add a comment |Â
up vote
0
down vote
I once also had memory issus with a tiny MSP430 controller.
The TI toolchain is linking large librarys into your binary if negativ values are possible or floating point is used. In my case it was about 10% - 20% of total memory usage.
TIs free Code composer Studio does provide a very powerfull memory visualization (View -> Memory Allocation)
What helped me a lot was changing the Initialization Model in the Linker settings and other optimization options. I am currently not working with an MSP430 controller so I can not tell you details anymore.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
8
down vote
accepted
GNU binutils has tools to help you determine the size of each symbol or just each object file.
Have a look at size
for instance: https://manpages.debian.org/jessie/binutils/size.1.en.html
nm
is also worth a try, as it can show the size of each symbol in the object code: https://manpages.debian.org/jessie/binutils/nm.1.en.html
Know that printf
, sprintf
and many of the more complex library functions can often take up quite a few kB of extra ROM.
Floating point support using soft-floats will also bloat the code compared to using hard-float, i.e. using software emulation vs. hardware instructions to handle floating point.
Sometimes the compiler will add an astonishing amount of bloat :)
Careful inspecting the output of size
and nm
will give you intuition for what takes up much space and what doesn't.
add a comment |Â
up vote
8
down vote
accepted
GNU binutils has tools to help you determine the size of each symbol or just each object file.
Have a look at size
for instance: https://manpages.debian.org/jessie/binutils/size.1.en.html
nm
is also worth a try, as it can show the size of each symbol in the object code: https://manpages.debian.org/jessie/binutils/nm.1.en.html
Know that printf
, sprintf
and many of the more complex library functions can often take up quite a few kB of extra ROM.
Floating point support using soft-floats will also bloat the code compared to using hard-float, i.e. using software emulation vs. hardware instructions to handle floating point.
Sometimes the compiler will add an astonishing amount of bloat :)
Careful inspecting the output of size
and nm
will give you intuition for what takes up much space and what doesn't.
add a comment |Â
up vote
8
down vote
accepted
up vote
8
down vote
accepted
GNU binutils has tools to help you determine the size of each symbol or just each object file.
Have a look at size
for instance: https://manpages.debian.org/jessie/binutils/size.1.en.html
nm
is also worth a try, as it can show the size of each symbol in the object code: https://manpages.debian.org/jessie/binutils/nm.1.en.html
Know that printf
, sprintf
and many of the more complex library functions can often take up quite a few kB of extra ROM.
Floating point support using soft-floats will also bloat the code compared to using hard-float, i.e. using software emulation vs. hardware instructions to handle floating point.
Sometimes the compiler will add an astonishing amount of bloat :)
Careful inspecting the output of size
and nm
will give you intuition for what takes up much space and what doesn't.
GNU binutils has tools to help you determine the size of each symbol or just each object file.
Have a look at size
for instance: https://manpages.debian.org/jessie/binutils/size.1.en.html
nm
is also worth a try, as it can show the size of each symbol in the object code: https://manpages.debian.org/jessie/binutils/nm.1.en.html
Know that printf
, sprintf
and many of the more complex library functions can often take up quite a few kB of extra ROM.
Floating point support using soft-floats will also bloat the code compared to using hard-float, i.e. using software emulation vs. hardware instructions to handle floating point.
Sometimes the compiler will add an astonishing amount of bloat :)
Careful inspecting the output of size
and nm
will give you intuition for what takes up much space and what doesn't.
edited 35 mins ago
answered 1 hour ago


Morten Jensen
3,20532741
3,20532741
add a comment |Â
add a comment |Â
up vote
0
down vote
I once also had memory issus with a tiny MSP430 controller.
The TI toolchain is linking large librarys into your binary if negativ values are possible or floating point is used. In my case it was about 10% - 20% of total memory usage.
TIs free Code composer Studio does provide a very powerfull memory visualization (View -> Memory Allocation)
What helped me a lot was changing the Initialization Model in the Linker settings and other optimization options. I am currently not working with an MSP430 controller so I can not tell you details anymore.
add a comment |Â
up vote
0
down vote
I once also had memory issus with a tiny MSP430 controller.
The TI toolchain is linking large librarys into your binary if negativ values are possible or floating point is used. In my case it was about 10% - 20% of total memory usage.
TIs free Code composer Studio does provide a very powerfull memory visualization (View -> Memory Allocation)
What helped me a lot was changing the Initialization Model in the Linker settings and other optimization options. I am currently not working with an MSP430 controller so I can not tell you details anymore.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
I once also had memory issus with a tiny MSP430 controller.
The TI toolchain is linking large librarys into your binary if negativ values are possible or floating point is used. In my case it was about 10% - 20% of total memory usage.
TIs free Code composer Studio does provide a very powerfull memory visualization (View -> Memory Allocation)
What helped me a lot was changing the Initialization Model in the Linker settings and other optimization options. I am currently not working with an MSP430 controller so I can not tell you details anymore.
I once also had memory issus with a tiny MSP430 controller.
The TI toolchain is linking large librarys into your binary if negativ values are possible or floating point is used. In my case it was about 10% - 20% of total memory usage.
TIs free Code composer Studio does provide a very powerfull memory visualization (View -> Memory Allocation)
What helped me a lot was changing the Initialization Model in the Linker settings and other optimization options. I am currently not working with an MSP430 controller so I can not tell you details anymore.
answered 16 mins ago
A.Rech
215
215
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52734501%2fwhat-parts-of-the-codebase-are-making-binaries-large%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
3
Take a look at the linker-generated map file, it should hopefully tell you everything you need.
– Some programmer dude
1 hour ago
I'd like to see your own answer on how did you actually solve this ;)
– Antti Haapala
31 mins ago