What are the stack and heap set in the GCC linker script used for?

Yes, it would be.

Thank you for sharing!