1 /* libgcj_bc.c */ 2 3 /* Copyright (C) 2006, 2009 Free Software Foundation 4 5 This file is part of libgcj. 6 7 This software is copyrighted work licensed under the terms of the 8 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for 9 details. */ 10 11 /* This file is used to build libgcj_bc.so, a 'fake' library that is 12 used at link time only. It ensures that binaries built with the 13 BC-ABI link against a constant SONAME. This way, BC-ABI binaries 14 continue to work if the SONAME underlying libgcj.so changes. */ 15 16 #include <stdlib.h> 17 #include <stdio.h> 18 print_wrong_lib_msg()19static void print_wrong_lib_msg () 20 { 21 fprintf (stderr, "libgcj error: \ 22 This is libgcj_bc.so, a fake library used only for linking.\n\ 23 Please create a symlink from libgcj_bc.so.1 to the real libgcj.so.\n"); 24 exit (1); 25 } 26 27 /* Functions called from code generated by gcj. */ 28 _Jv_AllocObject()29void _Jv_AllocObject () {} _Jv_AllocObjectNoFinalizer()30void _Jv_AllocObjectNoFinalizer () {} _Jv_CheckArrayStore()31void _Jv_CheckArrayStore () {} _Jv_CheckCast()32void _Jv_CheckCast () {} _Jv_InitClass()33void _Jv_InitClass () {} _Jv_IsInstanceOf()34void _Jv_IsInstanceOf () {} _Jv_LookupInterfaceMethod()35void _Jv_LookupInterfaceMethod () {} _Jv_LookupInterfaceMethodIdx()36void _Jv_LookupInterfaceMethodIdx () {} _Jv_MonitorEnter()37void _Jv_MonitorEnter () {} _Jv_MonitorExit()38void _Jv_MonitorExit () {} _Jv_NewMultiArray()39void _Jv_NewMultiArray () {} _Jv_NewObjectArray()40void _Jv_NewObjectArray () {} _Jv_NewPrimArray()41void _Jv_NewPrimArray () {} _Jv_RegisterResource()42void _Jv_RegisterResource () {} _Jv_ResolvePoolEntry()43void _Jv_ResolvePoolEntry () {} _Jv_Throw()44void _Jv_Throw () {} _Jv_ThrowAbstractMethodError()45void _Jv_ThrowAbstractMethodError () {} _Jv_ThrowBadArrayIndex()46void _Jv_ThrowBadArrayIndex () {} _Jv_ThrowNoSuchFieldError()47void _Jv_ThrowNoSuchFieldError () {} _Jv_ThrowNullPointerException()48void _Jv_ThrowNullPointerException () {} __gcj_personality_v0()49void __gcj_personality_v0 () {} 50 _Jv_RegisterClasses()51void _Jv_RegisterClasses () 52 { 53 print_wrong_lib_msg (); 54 } 55 _Jv_RegisterNewClasses()56void _Jv_RegisterNewClasses () 57 { 58 print_wrong_lib_msg (); 59 } 60 61 /* Symbols used by jvgenmain (-fmain). */ 62 JvRunMain()63void JvRunMain () {} JvRunMainName()64void JvRunMainName () {} 65 const char **_Jv_Compiler_Properties; 66 67 /* Functions used by -fjni. */ 68 _Jv_GetJNIEnvNewFrame()69void _Jv_GetJNIEnvNewFrame () {} _Jv_LookupJNIMethod()70void _Jv_LookupJNIMethod () {} _Jv_UnwrapJNIweakReference()71void _Jv_UnwrapJNIweakReference () {} _Jv_JNI_PopSystemFrame()72void _Jv_JNI_PopSystemFrame () {} 73 74 75 /* Checked divide (-fuse-divide-subroutine). */ 76 _Jv_divI()77void _Jv_divI () {} _Jv_divJ()78void _Jv_divJ () {} _Jv_remI()79void _Jv_remI () {} _Jv_remJ()80void _Jv_remJ () {} 81 82 83 /* CNI Functions. */ 84 _Jv_AllocBytes()85void _Jv_AllocBytes () {} _Jv_AllocString()86void _Jv_AllocString () {} _Jv_AttachCurrentThread()87void _Jv_AttachCurrentThread () {} _Jv_AttachCurrentThreadAsDaemon()88void _Jv_AttachCurrentThreadAsDaemon () {} _Jv_CreateJavaVM()89void _Jv_CreateJavaVM () {} _Jv_DetachCurrentThread()90void _Jv_DetachCurrentThread () {} _Jv_Free()91void _Jv_Free () {} _Jv_GetStringUTFLength()92void _Jv_GetStringUTFLength () {} _Jv_GetStringUTFRegion()93void _Jv_GetStringUTFRegion () {} _Jv_Malloc()94void _Jv_Malloc () {} _Jv_NewString()95void _Jv_NewString () {} _Jv_NewStringLatin1()96void _Jv_NewStringLatin1 () {} _Jv_NewStringUTF()97void _Jv_NewStringUTF () {} _Jv_Realloc()98void _Jv_Realloc () {} 99 100 101 /* Classes for primitive types. */ 102 103 #define DECLARE_PRIM_TYPE(NAME) \ 104 int _Jv_##NAME##Class; 105 106 DECLARE_PRIM_TYPE(byte) 107 DECLARE_PRIM_TYPE(short) 108 DECLARE_PRIM_TYPE(int) 109 DECLARE_PRIM_TYPE(long) 110 DECLARE_PRIM_TYPE(boolean) 111 DECLARE_PRIM_TYPE(char) 112 DECLARE_PRIM_TYPE(float) 113 DECLARE_PRIM_TYPE(double) 114 DECLARE_PRIM_TYPE(void) 115 116 117 /* Force executable to export __data_start et al. */ 118 119 #pragma weak __data_start 120 extern int __data_start[]; 121 #pragma weak data_start 122 extern int data_start[]; 123 #pragma weak _end 124 extern int _end[]; 125 static void *dummy[] __attribute__((used)) = {__data_start, data_start, _end}; 126