fix linking of function tables
make function table emitting nicer