1
0
mirror of https://github.com/golang/go synced 2024-11-20 09:54:45 -07:00

fix freebsd build

R=iant, r
CC=dho, golang-dev
https://golang.org/cl/3687041
This commit is contained in:
Russ Cox 2010-12-15 17:20:26 -05:00
parent 1a072f4b37
commit 33405ecc86
12 changed files with 37 additions and 13 deletions

View File

@ -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;

View File

@ -245,6 +245,7 @@ main(int argc, char *argv[])
else
doprof2();
span();
addexport();
textaddress();
pclntab();
symtab();

View File

@ -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;

View File

@ -313,6 +313,7 @@ main(int argc, char *argv[])
else
doprof2();
span();
addexport();
textaddress();
pclntab();
symtab();

View File

@ -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);

View File

@ -658,3 +658,12 @@ deadcode(void)
else
last->next = nil;
}
void
addexport(void)
{
int i;
for(i=0; i<ndynexp; i++)
adddynsym(dynexp[i]);
}

View File

@ -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);

View File

@ -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 (

View File

@ -31,6 +31,12 @@ OFILES=\
CGO_LDFLAGS=-lpthread
ifeq ($(GOOS),freebsd)
OFILES+=\
freebsd.$O\
endif
endif
include ../../../Make.pkg

View File

@ -0,0 +1,13 @@
// 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

View File

@ -7,9 +7,6 @@
static void* threadentry(void*);
char *environ[] = { 0 };
char *__progname;
static void
xinitcgo(void)
{

View File

@ -7,9 +7,6 @@
static void* threadentry(void*);
char *environ[] = { 0 };
char *__progname;
static void
xinitcgo(void)
{