简体   繁体   中英

What is the purpose of _GLOBAL__I_?

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM