I'm pretty sure these problems are due to not-so-robust parsing of symbol table data, and lack of error detection. I'd recommend adding a boolean for each item which defaults to false. Set each boolean to true as your parser finds each number. Or maybe use a bitmask and set a particular bit as you find each item. Or if you don't want to add extra variables, at least initialize all of these with a highly unlikely non-zero number.
Code:
unsigned teensy_model_identifier = 0;
unsigned stext = 0;
unsigned etext = 0;
unsigned sdata = 0;
unsigned ebss = 0;
unsigned flashimagelen = 0;
unsigned heap_start = 0;
unsigned flexram_bank_config = 0;
unsigned estack = 0;
Then after you're done parsing, check the booleans / bits / numbers to detect if your parser didn't find any of the required info. Probably best to print an error message about which info wasn't found and quit. If you go on to call printnumbers() when some info is missing, you'll get wrong results.