In embedded software, why does the .map file have _variable names and not just variable names? A particular variable name in code doesn't start with underscore. Then, why does this variable start with an underscore in .map file?
Variable names that start with an underscore are valid variable names. But user variables do not, by convention, begin with an underscore. Variable names that begin with a single underscore are produced by the compiler (I am not sure who looks at them). There are system variables that begin with two underscores. For the user, it has no significance.
I think the compiler adds an underscore to all user-specified symbols to make sure that they never can clash with "internal" symbols used by the compiler.
The compiler can safely use any symbol that doesn't begin with an underscore.