On Wed, Oct 19, 2016 at 3:38 PM, Eric Botcazou <ebotca...@adacore.com> wrote: > > linking any Go program on SPARC/Solaris with the GNU assembler and the Sun > linker yields a warning: > > ld: warning: relocation error: R_SPARC_UA32: file > /sydney.a/users/botcazou/gcc-head/sparc-sun- > solaris2.10/./libgo/libgobegin.a(libgobegin_a-go-main.o): symbol > runtime_startup_random_data: external symbolic relocation against non- > allocatable section .debug_info; cannot be processed at runtime: relocation > ignored > > It's because (almost) every C file in runtime/ includes runtime.h, which has > these lines: > > byte* runtime_startup_random_data; > uint32 runtime_startup_random_data_len; > void runtime_get_random_data(byte**, int32*); > > which cause (almost) every object file to have the first 2 as common symbols > and this runs afoul of some limitation of the Sun linker. Now there seem to > be no other references to these 3 objects in the libgo directory and removing > them doesn't seem to change the behavior of the Go compiler so the attached > patch does just that. > > Tested on x86_64-suse-linux and SPARC/Solaris, OK for mainline? > > > 2016-10-19 Eric Botcazou <ebotca...@adacore.com> > > * runtime/runtime.h (runtime_startup_random_data): Delete. > (runtime_startup_random_data_len): Likewise. > (runtime_get_random_data): Likewise.
Sorry, I missed this. Committed to mainline. Ian
Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 243321) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -2102112e26a21589455f940ec6b409766d942c62 +08d221726e3f50cb197a931ba385fac67f66a028 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: libgo/runtime/runtime.h =================================================================== --- libgo/runtime/runtime.h (revision 243084) +++ libgo/runtime/runtime.h (working copy) @@ -212,10 +212,6 @@ extern bool runtime_copystack; #define USED(v) ((void) v) #define ROUND(x, n) (((x)+(n)-1)&~(uintptr)((n)-1)) /* all-caps to mark as macro: it evaluates n twice */ -byte* runtime_startup_random_data; -uint32 runtime_startup_random_data_len; -void runtime_get_random_data(byte**, int32*); - enum { // hashinit wants this many random bytes HashRandomBytes = 32