Commit 272687ec authored by Anthony Martin's avatar Anthony Martin

cmd/nm: don't add filename elements for m symbols

The compilers used to generate only one 'm' symbol
to record the stack frame size for each function.

In cmd/nm, the 'm' and 'f' symbols are handled in
the same switch case with a special exception for
the symbol described above called ".frame".

Now that the compilers emit additional 'm' symbols
for precise garbage collection of the stack, the
current logic is incorrect. cmd/nm will attempt to
interpret these new 'm' symbols as 'f' symbols and
add them to the file name index table.

This fails with an out-of-memory condition when
zenter encounters an 'm' symbol with a very large
value (usually the .args symbol indicating a
variadic NOSPLIT function).

R=iant
CC=dave, gobot, golang-dev, rsc
https://golang.org/cl/7962045
parent 1b9e3635
......@@ -275,11 +275,13 @@ psym(Sym *s, void* p)
return;
break;
case 'm':
if(!aflag || uflag || gflag)
return;
break;
case 'f': /* we only see a 'z' when the following is true*/
if(!aflag || uflag || gflag)
return;
if (strcmp(s->name, ".frame"))
zenter(s);
zenter(s);
break;
case 'a':
case 'p':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment