I've been using the MAC version of MCUXpresso for a few months now with a new K22F project; I noticed today that the end of my compiled code has garbage nonsense in it, looks sometimes like source code! I just now used objcopy to convert the axf output file to lst format ("arm-none-eabi-objdump -S "${BuildArtifactFileName}" > "${BuildArtifactFileBaseName}.lst"") and the end of the file has sections like attached.
The screenshot shows "DRIVEROOT" in the listing, which is defined as a one character string:
const TCHAR DRIVEROOT[] = "/";
So it looks like the compiler is leaving heaps of junk after the definition; it's hard to be sure but maybe there's junk at the end of the "last" constant string in any module - although it looks like the order of constant strings isn't the same as source code so I can't be sure.
It looks like it's not just constant strings either; the final item in the listing is "__num_Ciob_streams" which doesn't exist in any source code.
Anyone got any ideas why this is happening, compiler / linker settings to make this issue go away? I've never seen it in my Windows MCUXpresso projects, though that's no proof that this is a MAC only issue.