int nelfsym = 1;
-static void adddynsym(Sym*);
static void addpltsym(Sym*);
static void addgotsym(Sym*);
}
}
-static void
+void
adddynsym(Sym *s)
{
Sym *d, *str;
else
doprof2();
span();
+ addexport();
textaddress();
pclntab();
symtab();
int nelfsym = 1;
-static void adddynsym(Sym*);
static void addpltsym(Sym*);
static void addgotsym(Sym*);
}
}
-static void
+void
adddynsym(Sym *s)
{
Sym *d, *str;
else
doprof2();
span();
+ addexport();
textaddress();
pclntab();
symtab();
if(r->type >= 256)
continue;
- if(r->sym != S && (r->sym->type == SDYNIMPORT || r->sym->dynimpname != nil))
+ if(r->sym != S && r->sym->type == SDYNIMPORT)
if (thechar != '8' || HEADTYPE != 10) // Windows PE supports relocation references to dynamic import symbols
- diag("unhandled relocation for %s (rtype %d)", r->sym->name, r->type);
+ diag("unhandled relocation for %s (type %d rtype %d)", r->sym->name, r->sym->type, r->type);
if(r->sym != S && !r->sym->reachable)
diag("unreachable sym in relocation: %s %s", s->name, r->sym->name);
else
last->next = nil;
}
+
+void
+addexport(void)
+{
+ int i;
+
+ for(i=0; i<ndynexp; i++)
+ adddynsym(dynexp[i]);
+}
vlong datoff(vlong);
void adddynlib(char*);
int archreloc(Reloc*, Sym*, vlong*);
+void adddynsym(Sym*);
+void addexport(void);
int pathchar(void);
void* mal(uint32);
fi
# Get list of directories from Makefile
-dirs=$(make echo-dirs)
+dirs=$(gomake echo-dirs)
dirpat=$(echo $dirs C | sed 's/ /|/g; s/.*/^(&)$/')
for dir in $dirs; do (
CGO_LDFLAGS=-lpthread
+ifeq ($(GOOS),freebsd)
+OFILES+=\
+ freebsd.$O\
+
+endif
+
endif
include ../../../Make.pkg
--- /dev/null
+// Copyright 2010 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Supply environ and __progname, because we don't
+// link against the standard FreeBSD crt0.o and the
+// libc dynamic library needs them.
+
+char *environ[1];
+char *__progname;
+
+#pragma dynexport environ environ
+#pragma dynexport __progname __progname
static void* threadentry(void*);
-char *environ[] = { 0 };
-char *__progname;
-
static void
xinitcgo(void)
{
static void* threadentry(void*);
-char *environ[] = { 0 };
-char *__progname;
-
static void
xinitcgo(void)
{