summaryrefslogtreecommitdiff
path: root/src/cmd/nm
diff options
context:
space:
mode:
authorAnthony Martin <ality@pbrane.org>2013-04-03 18:23:43 -0700
committerAnthony Martin <ality@pbrane.org>2013-04-03 18:23:43 -0700
commit4ae401fe21bcfd1254093af8fc807289760685dd (patch)
tree8241ba773a2d832a8a868e9c38bb367eeb072105 /src/cmd/nm
parent3e4289878e8e8bd944109e3b2e438b89f01d4ad6 (diff)
downloadgo-4ae401fe21bcfd1254093af8fc807289760685dd.tar.gz
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://codereview.appspot.com/7962045
Diffstat (limited to 'src/cmd/nm')
-rw-r--r--src/cmd/nm/nm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cmd/nm/nm.c b/src/cmd/nm/nm.c
index 668239035..aa056b882 100644
--- a/src/cmd/nm/nm.c
+++ b/src/cmd/nm/nm.c
@@ -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':