Library Size Measurement on Linux

I am developing S / W for some device that uses Linux OS. So the size of the libraries (RAM / ROM) that I use is very important.

How can I easily calculate the RAM / ROM required by my software? (including the libraries I used). I think this is too simple a question for an experienced Linux developer.

+6
source share
1 answer

Run

size <object> 

or

 size <archive> 

or

 size <shared-object> 

. (or "target-") if you use cross-compilation: arm size if you use arm-gcc)

He will give you

 text data bss dec hex filename 

where text is the size of the program, bss is the initialized globals and data is read-only data.

While this answers your question, you probably want to use a specific LdScript (when using ld as the linker), where you will place partitions in accessible memory locations manually when making the last link.

+3
source

Source: https://habr.com/ru/post/899950/


All Articles