Shop OBEX P1 Docs P2 Docs Learn Events
PropGCC: Fundamental misunderstanding of program size? — Parallax Forums

PropGCC: Fundamental misunderstanding of program size?

SRLMSRLM Posts: 5,045
edited 2013-12-04 16:48 in Propeller 1
I think I've been misleading myself, so I ask this clarifying question:

What is the actual program size?

I've been happily developing away, and keeping a careful eye on the memory usage. 24232 bytes sent as indicated by propeller-load.

But, if I increase one of my arrays by 1 then I get hub memory overflow!

If I use propeller-elf-size on the original elf I get
$ propeller-elf-size main.gamma.elf 
   text	   data	    bss	    dec	    hex	filename
  20148	   4084	   8528	  32760	   7ff8	main.gamma.elf
[/code]

Which would seem to indicate that I'm right at the border (32KB - 32760 = 8 bytes) of a program that fits. My guess is that propeller-load only loads the text and data sections, and doesn't count the bss section.

Hmmm. I think I'll have to make another pass through my code and optimize for size again.

Comments

  • KyeKye Posts: 2,200
    edited 2013-12-04 15:55
    Yeah, bss doesn't need to be loaded. Maybe it should be reported however.
  • ersmithersmith Posts: 6,054
    edited 2013-12-04 16:31
    Yes, propeller-load only sends the code and initialized data -- the bss doesn't need to be sent and so isn't reported in the "bytes sent". To get the total program size you have to add up the size of the sections.

    Also note that you'll need a little bit of space for stack (depending on your application you may want anywhere from 64 bytes to 2K of stack).
  • jazzedjazzed Posts: 11,803
    edited 2013-12-04 16:48
    SimpleIDE reports the total program size.
Sign In or Register to comment.