2010-08-06 9 views
0

J'ai deux fonctions déclarées comme suit, en utilisant extern "C" pour éviter le mangling de nom.Quel est le but de _GLOBAL__I_?

#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 

Étonnamment, la deuxième fonction ont encore un nom mutilée _GLOBAL__I_Java_com_trident_tv_si_SIManagerImpl_nGetServiceCurrentEvent, je me demandais quel est le but de celui-ci et pourquoi la première fonction n'a pas généré un?

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:

Trouver quelque chose. Cependant, pas de réponse claire pour le moment.

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

Répondre

1

Il me semble que les deux fonctions ont les noms corrects (les deux précédés de T), et qu'un troisième symbole (précédé par t) est créé pour gccs usage interne.

Ils ont cependant été réorganisés.

// 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