tags:

views:

39

answers:

1

Hi,

I have two functions declared as following, using extern "C" aming to avoid name mangling.

#ifdef __cplusplus
extern "C" {
#endif
JNIEXPORT jobject JNICALL Java_com_trident_tv_si_SIManagerImpl_nGetServiceDetails
  (JNIEnv *, jobject, jint);

JNIEXPORT jobject JNICALL Java_com_trident_tv_si_SIManagerImpl_nGetServiceCurrentEvent
  (JNIEnv *, jobject, jint);
#ifdef __cplusplus
}
#endif
#endif

Surprisingly, the second function still have a mangled name _GLOBAL__I_Java_com_trident_tv_si_SIManagerImpl_nGetServiceCurrentEvent , I was wondering what is the purpose of it and why the first function did not generate one?

00004d58 T Java_com_trident_tv_si_SIManagerImpl_nGetServiceCurrentEvent
0000533a T Java_com_trident_tv_si_SIManagerImpl_nGetServiceDetails
0000494f t _GLOBAL__I_Java_com_trident_tv_si_SIManagerImpl_nGetServiceCurrentEvent

EDIT:

Find something here. However, no clear answer yet.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12293

+1  A: 

It looks to me like the two functions have the correct names ( the two preceded by T ), and that a third symbol (preceded by t) is created for gccs internal use.

They have been reordered though.

// SECOND FUNCTION, T = exported and in TEXT section
00004d58 T Java_com_trident_tv_si_SIManagerImpl_nGetServiceCurrentEvent
// FIRST FUNCTION, T = exported and in TEXT section
0000533a T Java_com_trident_tv_si_SIManagerImpl_nGetServiceDetails
// INTERNAL symbol, t = non-exported symbol in TEXT section
0000494f t _GLOBAL__I_Java_com_trident_tv_si_SIManagerImpl_nGetS
Michael Anderson