Prochaine révision | Révision précédente |
lang:cpp:lieur [2018/12/20 12:41] – Création de "Mangling" avec les sources root | lang:cpp:lieur [2023/07/28 09:48] (Version actuelle) – [Mangling] : ajout de "Demangler online" root |
---|
===Mangling=== | ===Mangling=== |
| |
[[https://en.wikiversity.org/wiki/Visual_C%2B%2B_name_mangling|Visual C++ name mangling]] {{ :lang:cpp:lieur:visual_c_name_mangling_-_wikiversity.mhtml |Archive du 20/12/2018}} | [[https://en.wikiversity.org/wiki/Visual_C%2B%2B_name_mangling|Visual C++ name mangling]] {{ :lang:cpp:lieur:visual_c_name_mangling_-_wikiversity_2019-10-30_16_04_43_.html |Archive du 06/07/2019 le 30/10/2019}} |
| |
[[https://www.agner.org/optimize/calling_conventions.pdf|Calling conventions]] {{ :lang:cpp:lieur:calling_conventions.pdf |Archive du 20/12/2018}} | [[https://www.agner.org/optimize/calling_conventions.pdf|Calling conventions]] {{ :lang:cpp:lieur:calling_conventions_15-08-2019.pdf |Archive du 15/08/2019 le 30/10/2019}} |
| |
[[http://mearie.org/documents/mscmangle/|Microsoft C++ Name Mangling Scheme]] {{ :lang:cpp:lieur:microsoft_c_name_mangling_scheme_mearie.org_documents.mhtml |Archive du 20/12/2018}} | [[http://mearie.org/documents/mscmangle/|Microsoft C++ Name Mangling Scheme]] {{ :lang:cpp:lieur:microsoft_c_name_mangling_scheme_mearie.org_documents_2019-10-30_16_04_57_.html |Archive du 20/07/2006 le 30/10/2019}} |
| |
[[http://www.kegel.com/mangle.html|C++ Name Mangling/Demangling]] {{ :lang:cpp:lieur:mangle.mhtml |Archive du 20/12/2018}} | <blockquote>External functions with the ''%%__%%declspec(dllimport)'' attribute have prefix ''%%__%%imp_'' in all compilers except Borland.</blockquote> |
| |
| [[http://www.kegel.com/mangle.html|C++ Name Mangling/Demangling]] {{ :lang:cpp:lieur:c_name_mangling_demangling_2019-10-30_16_05_08_.html |Archive du 30/04/2002 le 30/10/2019}} |
| |
| * Demangler on-line |
| |
| https://d.fuqu.jp/c++filtjs/ |
| |
| https://demangler.com |
| ===Les méthodes définies dans un entête ont un attribut weak=== |
| Le corps d'une méthode ''template'' doit être identique quelque soit le fichier objet généré. Les méthodes ''template'' étant compilés dans chaque fichier objet (possibilité de nombreux doublons), le compilateur va leur donner l'attribut ''weak''. |
| |
| Si l'implémentation n'est toujours identique, le compilateur va en prendre une au hasard et la généraliser. |
| |
| * Exemple : |
| |
| {{gh>https://github.com/bansan85/wiki_le_garrec_fr/blob/master/cpp/linker/weak/Entete.h}} |
| |
| {{gh>https://github.com/bansan85/wiki_le_garrec_fr/blob/master/cpp/linker/weak/ClasseA.h}} |
| |
| {{gh>https://github.com/bansan85/wiki_le_garrec_fr/blob/master/cpp/linker/weak/ClasseB.h}} |
| |
| {{gh>https://github.com/bansan85/wiki_le_garrec_fr/blob/master/cpp/linker/weak/ClasseA.cpp}} |
| |
| {{gh>https://github.com/bansan85/wiki_le_garrec_fr/blob/master/cpp/linker/weak/ClasseB.cpp}} |
| |
| {{gh>https://github.com/bansan85/wiki_le_garrec_fr/blob/master/cpp/linker/weak/main.cpp}} |
| |
| * Symboles : |
| |
| {{gh>https://github.com/bansan85/wiki_le_garrec_fr_travis/blob/master/cpp/linker/weak/ClasseA.cpp.nm}} |
| |
| {{gh>https://github.com/bansan85/wiki_le_garrec_fr_travis/blob/master/cpp/linker/weak/ClasseB.cpp.nm}} |
| |
| On voit que le symbole ''Entete::go()'' est défini deux fois avec l'attribut weak. Mais le ''#define'' étant différent, les deux implémentations sont différentes. |