diff options
| author | Russ Cox <rsc@golang.org> | 2013-03-07 09:19:02 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2013-03-07 09:19:02 -0500 |
| commit | 60f783d92bc07fa7ca78e8efccbbc841d9f9cbcb (patch) | |
| tree | 8677601561fbb007429777514911480aa4c871fd /src/cmd/ld/dwarf.c | |
| parent | 8aafb44b0bbba85535feb67e7ae0f4f254524c0f (diff) | |
| download | go-60f783d92bc07fa7ca78e8efccbbc841d9f9cbcb.tar.xz | |
cmd/ld: host linking support for linux/amd64
Still to do: non-linux and non-amd64.
It may work on other ELF-based amd64 systems too, but untested.
"go test -ldflags -hostobj $GOROOT/misc/cgo/test" passes.
Much may yet change, but this seems a reasonable checkpoint.
R=iant
CC=golang-dev
https://golang.org/cl/7369057
Diffstat (limited to 'src/cmd/ld/dwarf.c')
| -rw-r--r-- | src/cmd/ld/dwarf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/ld/dwarf.c b/src/cmd/ld/dwarf.c index d6a357e498..949752994b 100644 --- a/src/cmd/ld/dwarf.c +++ b/src/cmd/ld/dwarf.c @@ -1260,7 +1260,7 @@ dwarfaddfrag(int n, char *frag) if (n >= ftabsize) { s = ftabsize; ftabsize = 1 + n + (n >> 2); - ftab = realloc(ftab, ftabsize * sizeof(ftab[0])); + ftab = erealloc(ftab, ftabsize * sizeof(ftab[0])); memset(ftab + s, 0, (ftabsize - s) * sizeof(ftab[0])); } @@ -1342,7 +1342,7 @@ addhistfile(char *zentry) if (histfilesize == histfilecap) { histfilecap = 2 * histfilecap + 2; - histfile = realloc(histfile, histfilecap * sizeof(char*)); + histfile = erealloc(histfile, histfilecap * sizeof(char*)); } if (histfilesize == 0) histfile[histfilesize++] = "<eof>"; @@ -1412,7 +1412,7 @@ checknesting(void) includestacksize += 1; includestacksize <<= 2; // print("checknesting: growing to %d\n", includestacksize); - includestack = realloc(includestack, includestacksize * sizeof *includestack); + includestack = erealloc(includestack, includestacksize * sizeof *includestack); } } @@ -1651,7 +1651,7 @@ writelines(void) lang = guesslang(histfile[1]); finddebugruntimepath(); - dwinfo = newdie(&dwroot, DW_ABRV_COMPUNIT, strdup(histfile[1])); + dwinfo = newdie(&dwroot, DW_ABRV_COMPUNIT, estrdup(histfile[1])); newattr(dwinfo, DW_AT_language, DW_CLS_CONSTANT,lang, 0); newattr(dwinfo, DW_AT_stmt_list, DW_CLS_PTR, unitstart - lineo, 0); newattr(dwinfo, DW_AT_low_pc, DW_CLS_ADDRESS, s->text->pc, 0); |
