]> Cypherpunks repositories - gostls13.git/commit
first attempt at real FFI support.
authorRuss Cox <rsc@golang.org>
Mon, 24 Aug 2009 23:15:21 +0000 (16:15 -0700)
committerRuss Cox <rsc@golang.org>
Mon, 24 Aug 2009 23:15:21 +0000 (16:15 -0700)
commit8c253bcae511d12bbbbded99759c8197f52642ad
treea65fa19b965ad5b4c2a0bacc21bb06f03a8bdd95
parent0262f8834dc8a1ade69810903779cb9538859f93
first attempt at real FFI support.

in a .6 file, an export line

//ffi T localfib remotefib remote.so

means the dynamic linker should initialize
localfib, always a pointer, to the address of
remotefib, either text (T) or data (D) after
loading remote.so.

the C compiler will generate an export section
when given the pragmas

#pragma package fib
#pragma ffi T localfib remotefib remote.so

needing #pragma package is a bit of a kludge
and hopefully could go away later.

this is just the 6 tool chain support.
other architectures will happen once 6 settles down.

code using this to do FFI is in a later CL.

R=r
DELTA=161  (141 added, 14 deleted, 6 changed)
OCL=33783
CL=33795
src/cmd/6c/swt.c
src/cmd/ar/ar.c
src/cmd/cc/cc.h
src/cmd/cc/dpchk.c
src/cmd/cc/lexbody
src/cmd/cc/macbody
src/cmd/ld/go.c