This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gofrontend-dev] Re: [PATCH 00/13] Go closures, libffi, and the static chain
- From: Richard Henderson <rth at redhat dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, gofrontend-dev at googlegroups dot com, Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Date: Fri, 12 Dec 2014 10:49:20 -0800
- Subject: Re: [gofrontend-dev] Re: [PATCH 00/13] Go closures, libffi, and the static chain
- Authentication-results: sourceware.org; auth=none
- References: <1412973773-3942-1-git-send-email-rth at redhat dot com> <20141211090623 dot GA30484 at linux dot vnet dot ibm dot com> <20141211092144 dot GE4283 at bubble dot grove dot modra dot org> <20141212135747 dot GA14881 at linux dot vnet dot ibm dot com>
On 12/12/2014 05:57 AM, Dominik Vogt wrote:
> On Thu, Dec 11, 2014 at 07:51:44PM +1030, Alan Modra wrote:
>> I was worried about exactly the same "problem" on powerpc with r11
>> being used for the static chain and also destroyed in linkage stubs.
>> It turns out we don't traverse any linkage stubs.
>>
>> See https://gcc.gnu.org/ml/gcc-patches/2014-11/msg00446.html.
>
> I've written a small test suite that tests reflection calls over
> module boundaries (see attachment). Build with "make" and then
> just run "./main". The program must not crash; it does not check
> consistency of the function arguments.
Oh, that's interesting. You've found a bug in the x86_64 linking:
gccgo -g3 -O3 -Wall -Werror -c -fPIC q.go -o q.o
gccgo -shared -Wl,-soname,libq.so -o libq.so q.o
gccgo -g3 -O3 -Wall -Werror -c -fPIC p.go -o p.o
gccgo -shared -Wl,-soname,libp.so -o libp.so p.o
gccgo -g3 -O3 -Wall -Werror -o main main.go libq.so libp.so
/usr/bin/ld: main: hidden symbol `__morestack' in
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/libgcc.a(morestack.o) is referenced by DSO
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make: *** [main] Error 1
Sure enough, both shared libraries failed to pull __morestack
from the static libgcc.
$ nm libq.so | grep more
U __morestack
I guess __morestack is included in the wrong portion of libgcc?
Ian?
r~