In my embedded project, I need to figure out where I start to further optimize (i.e. reduce) stuff in the .data
section. What command(s) do you use for an quick overview which symbols reserve large amounts of memory in a certain section? I use the gcc-arm-embedded tools. Currently, I use the -Xlinker -Map=file.map
flag to gcc
at compile time, but searching for large address gaps that indicate large memory blocks in use is tedious.
Asked
Active
Viewed 1,094 times
3

apriori
- 1,260
- 11
- 29
-
1Possible duplicate of [Analyzing an ELF binary to minimize its size](http://stackoverflow.com/questions/25513771/analyzing-an-elf-binary-to-minimize-its-size) – Thomas Dickey Feb 21 '16 at 19:53
-
1I don't want to know "What is being linked in that balloons the file size so much?". I know my ldscript pretty well because I wrote it. I want a list of symbols sorted by size in a specific section. – apriori Feb 21 '16 at 20:32
-
The last answer sounds like your problem, and from your response, you did not read it: `nm --print-size --size-sort` – Thomas Dickey Feb 21 '16 at 20:34
-
2That command does not exactly do what I intended (specific section[s]), but can be changed to `arm-none-eabi-nm file -rSC --size-sort |grep " [bBdDrR] "` for .bss, .data and .rodata or `arm-none-eabi-nm file -rSC --size-sort |grep " [dD] "`for the .data section only. – apriori Feb 21 '16 at 22:02
-
exactly. Since the necessary information had been presented before, I suggested a duplicate. – Thomas Dickey Feb 21 '16 at 22:06