diff options
| author | Keith Randall <khr@golang.org> | 2013-07-19 11:19:18 -0700 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2013-07-19 11:19:18 -0700 |
| commit | 6fc49c18540938cd4699c1eb8cb05bd00ff9f59c (patch) | |
| tree | db7220ee8c655facf9f9492e4d75137d4eb3b81b /src/cmd/ld | |
| parent | eb04df75cd87722f396fb66583279afe5abfb1ca (diff) | |
| download | go-6fc49c18540938cd4699c1eb8cb05bd00ff9f59c.tar.xz | |
runtime: cleanup: use ArgsSizeUnknown to mark all functions
whose argument size is unknown (C vararg functions, and
assembly code without an explicit specification).
We used to use 0 to mean "unknown" and 1 to mean "zero".
Now we use ArgsSizeUnknown (0x80000000) to mean "unknown".
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/11590043
Diffstat (limited to 'src/cmd/ld')
| -rw-r--r-- | src/cmd/ld/lib.c | 9 | ||||
| -rw-r--r-- | src/cmd/ld/lib.h | 7 |
2 files changed, 3 insertions, 13 deletions
diff --git a/src/cmd/ld/lib.c b/src/cmd/ld/lib.c index 1594526a86..feb84736df 100644 --- a/src/cmd/ld/lib.c +++ b/src/cmd/ld/lib.c @@ -33,6 +33,7 @@ #include "lib.h" #include "../ld/elf.h" #include "../../pkg/runtime/stack.h" +#include "../../pkg/runtime/funcdata.h" #include <ar.h> @@ -2414,13 +2415,9 @@ pclntab(void) // args int32 // TODO: Move into funcinfo. - if(cursym->text == nil || (cursym->text->textflag & NOSPLIT) && cursym->args == 0 && cursym->nptrs < 0) { - // This might be a vararg function and have no - // predetermined argument size. This check is - // approximate and will also match 0 argument - // nosplit functions compiled by 6c. + if(cursym->text == nil) off = setuint32(ftab, off, ArgsSizeUnknown); - } else + else off = setuint32(ftab, off, cursym->args); // locals int32 diff --git a/src/cmd/ld/lib.h b/src/cmd/ld/lib.h index ce920b0ef3..55c4055d2b 100644 --- a/src/cmd/ld/lib.h +++ b/src/cmd/ld/lib.h @@ -81,13 +81,6 @@ enum NHASH = 100003, }; -enum -{ - // This value is known to the garbage collector and should be kept in - // sync with runtime/pkg/runtime.h - ArgsSizeUnknown = 0x80000000 -}; - typedef struct Library Library; struct Library { |
