diff options
| author | Russ Cox <rsc@golang.org> | 2014-04-16 17:11:44 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2014-04-16 17:11:44 -0400 |
| commit | cc08d9232c4875a11b9e2a8097e069467d79f31f (patch) | |
| tree | 03a531b03b0221d27193628b1990e2b7baa6f087 /src/cmd/ld | |
| parent | 0de521d111b88b2bc6466a4e1f29a8a284c0b3ee (diff) | |
| download | go-cc08d9232c4875a11b9e2a8097e069467d79f31f.tar.xz | |
liblink: add leaf bit to object file format
Without the leaf bit, the linker cannot record
the correct frame size in the symbol table, and
then stack traces get mangled. (Only for ARM.)
Fixes #7338.
Fixes #7347.
LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/88550043
Diffstat (limited to 'src/cmd/ld')
| -rw-r--r-- | src/cmd/ld/pcln.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cmd/ld/pcln.c b/src/cmd/ld/pcln.c index bdb139f7a4..b2370f2a91 100644 --- a/src/cmd/ld/pcln.c +++ b/src/cmd/ld/pcln.c @@ -112,7 +112,7 @@ pclntab(void) { int32 i, nfunc, start, funcstart; LSym *ftab, *s; - int32 off, end; + int32 off, end, frameptrsize; int64 funcdata_bytes; Pcln *pcln; Pciter it; @@ -173,7 +173,10 @@ pclntab(void) // when a called function doesn't have argument information. // We need to make sure everything has argument information // and then remove this. - off = setuint32(ctxt, ftab, off, ctxt->cursym->locals + PtrSize); + frameptrsize = PtrSize; + if(ctxt->cursym->leaf) + frameptrsize = 0; + off = setuint32(ctxt, ftab, off, ctxt->cursym->locals + frameptrsize); if(pcln != &zpcln) { renumberfiles(pcln->file, pcln->nfile, &pcln->pcfile); |
