Commit 33405ecc authored by Russ Cox's avatar Russ Cox

fix freebsd build

R=iant, r
CC=dho, golang-dev
https://golang.org/cl/3687041
parent 1a072f4b
......@@ -163,7 +163,6 @@ needlib(char *name)
int nelfsym = 1;
static void adddynsym(Sym*);
static void addpltsym(Sym*);
static void addgotsym(Sym*);
......@@ -437,7 +436,7 @@ addgotsym(Sym *s)
}
}
static void
void
adddynsym(Sym *s)
{
Sym *d, *str;
......
......@@ -245,6 +245,7 @@ main(int argc, char *argv[])
else
doprof2();
span();
addexport();
textaddress();
pclntab();
symtab();
......
......@@ -153,7 +153,6 @@ needlib(char *name)
int nelfsym = 1;
static void adddynsym(Sym*);
static void addpltsym(Sym*);
static void addgotsym(Sym*);
......@@ -420,7 +419,7 @@ addgotsym(Sym *s)
}
}
static void
void
adddynsym(Sym *s)
{
Sym *d, *str;
......
......@@ -313,6 +313,7 @@ main(int argc, char *argv[])
else
doprof2();
span();
addexport();
textaddress();
pclntab();
symtab();
......
......@@ -165,9 +165,9 @@ relocsym(Sym *s)
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);
......
......@@ -658,3 +658,12 @@ deadcode(void)
else
last->next = nil;
}
void
addexport(void)
{
int i;
for(i=0; i<ndynexp; i++)
adddynsym(dynexp[i]);
}
......@@ -161,6 +161,8 @@ void genasmsym(void (*put)(Sym*, char*, int, vlong, vlong, int, Sym*));
vlong datoff(vlong);
void adddynlib(char*);
int archreloc(Reloc*, Sym*, vlong*);
void adddynsym(Sym*);
void addexport(void);
int pathchar(void);
void* mal(uint32);
......
......@@ -14,7 +14,7 @@ if [ -f $OUT ] && ! [ -w $OUT ]; then
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 (
......
......@@ -31,6 +31,12 @@ OFILES=\
CGO_LDFLAGS=-lpthread
ifeq ($(GOOS),freebsd)
OFILES+=\
freebsd.$O\
endif
endif
include ../../../Make.pkg
......
// 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
......@@ -7,9 +7,6 @@
static void* threadentry(void*);
char *environ[] = { 0 };
char *__progname;
static void
xinitcgo(void)
{
......
......@@ -7,9 +7,6 @@
static void* threadentry(void*);
char *environ[] = { 0 };
char *__progname;
static void
xinitcgo(void)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment