the only real difference I see is that the sram one
The difference is that all the sections are being put in the ram region, > ram
Just delete the ram linker script. You are not going to wear out the flash anytime soon, which is probably the original reason for this scheme. There may be uses for it, but you are not going to need it.
MPLABX seems to really not get that one may program in C++
MPLABX does not care whether you use C/C++, but XC32 may have ideas about that. Except for maybe an initial omission of handling the .cpp extension in MPLABX settings, it handles C++ just fine (that's all I use in MPLABX).
so I do not believe that any heap is needed?
You can tell the linker to allocate no heap space via a passed in define (or just modify the linker script)-
-Wl,--defsym=__heap_size__=0
If you use newlib printf, then malloc_r will be hauled in even if not actually used for printf (you are not using stdio buffer). If malloc_r is hauled in, then you will need _sbrk(), and depending on which specs file is in use (nano/nosys/etc) it may or may not have _sbrk (nano does not). Then there is the symbol 'end' which newlib _sbrk uses as the start of heap (same as _sheap which is in your linker script, but most likely will need to add this 'end' symbol by duplicating the _sheap line in the linker script with the addition symbol name).
So, with __heap_size__ set to 0, and specs set to something other than nano, and 'end' is in the linker script- even if malloc attempts to use the heap it will fail because the .heap section size is 0 (_sbrk will always return -1). The malloc failure will be at runtime, but if it was used without your knowledge (library code) it will fail and the most probable outcome is something (you just added) will not work.
If using nano specs, then as soon as malloc_r is hauled in (because of some library function that needs it), you will get a linker error because the nano library has no _sbrk() function. You will know the code you just added uses malloc.
If you want to use nano specs (libnano), and want to use printf, you can simply add your own _sbrk function-
extern "C" char* _sbrk(int n){ return (char*)-1; } //assumes in a C++ source file, so extern "C"
which simply causes a malloc_r failure. You can also do something else inside, and deal with it like an exception. For printf (typical uses), malloc does not actually allocate so _sbrk is never called but still has to be available (just as printf requires malloc_r to be available, even if not used).
an example makefile I use for stm32-
https://godbolt.org/z/T1oW3f4eEIn this case I have a wrap on malloc_r, although when using nano specs the missing _sbrk will cause an error anyway.