Okay I found some interesting results after a bit of testing...<div><br></div><div>When using bin2obj you get a byte of array typed constant which you can include in your sources. The compiler will always include the resource whether it is referenced from code or not. Stripping the app (strip -s -g appname) does not remove the size the constants add to the app even if they aren't referenced by any other code.</div>
<div><br></div><div>Using an untyped constant such as "const Image = {$r image.base64};" still adds to the app size even if it's not referenced, but it can only be stripped out if no units are included which reference access to the constant. This means if a "function A" sets a string using part of the constant, then Image (in the example above) will be embedded and cannot be stripped, even if no code calls "function A".</div>
<div><br></div><div>image.base64 contains 480kb of encoded text </div><div>'/9j/4AAQSkZJRgABAQEASABIAAD//gATQ3JlYXRlZCB3.....</div><div><br></div><div>What this means is that all string constants and typed constants are take up space in your executable whether your use them or not, which is not ideal IMO. The compiler ought to be able to detect when these constants are not referenced (much like not including the machine code of unused functions) and exclude them from the final app.</div>