네임 맹글링
보이기
컴파일러 구조에서 네임 맹글링(name mangling)은 현대의 수많은 프로그래밍 언어에서 프로그래밍 엔티티의 고유한 이름을 사용할 때 발생하는 다양한 문제를 해결하기 위해 사용되는 기법이다.
컴파일러로부터 링커로 더 시맨틱한 정보를 전달하기 위해 함수, 구조, 클래스 또는 다른 자료형의 이름에서 추가 정보를 인코딩하는 한 수단을 제공한다.
컴파일러별 동일 함수를 맹글링하는 방법
[편집]| Compiler | void h(int)
| void h(int, char)
| void h(void)
|
|---|---|---|---|
| Intel C++ 8.0 for Linux | _Z1hi
| _Z1hic
| _Z1hv
|
| HP aC++ A.05.55 IA-64 | |||
| IAR EWARM C++ | |||
| GCC 3.x 이상 | |||
| Clang 1.x 이상[1] | |||
| GCC 2.9.x | h__Fi
| h__Fic
| h__Fv
|
| HP aC++ A.03.45 PA-RISC | |||
| Microsoft Visual C++ v6-v10 (mangling details) | ?h@@YAXH@Z
| ?h@@YAXHD@Z
| ?h@@YAXXZ
|
| Digital Mars C++ | |||
| Borland C++ v3.1 | @h$qi
| @h$qizc
| @h$qv
|
| OpenVMS C++ v6.5 (ARM mode) | H__XI
| H__XIC
| H__XV
|
| OpenVMS C++ v6.5 (ANSI mode) | CXX$__7H__FIC26CDH77
| CXX$__7H__FV2CB06E8
| |
| OpenVMS C++ X7.1 IA-64 | CXX$_Z1HI2DSQ26A
| CXX$_Z1HIC2NP3LI4
| CXX$_Z1HV0BCA19V
|
| SunPro CC | __1cBh6Fi_v_
| __1cBh6Fic_v_
| __1cBh6F_v_
|
| Tru64 C++ v6.5 (ARM mode) | h__Xi
| h__Xic
| h__Xv
|
| Tru64 C++ v6.5 (ANSI mode) | __7h__Fi
| __7h__Fic
| __7h__Fv
|
| Watcom C++ 10.6 | W?h$n(i)v
| W?h$n(ia)v
| W?h$n()v
|
같이 보기
[편집]각주
[편집]- ↑ 《Clang - Features and Goals: GCC Compatibility》, 2013년 4월 15일
외부 링크
[편집]- Linux Itanium ABI for C++, including name mangling scheme.
- Macintosh C/C++ ABI Standard Specification
- c++filt — filter to demangle encoded C++ symbols for GNU/Intel compilers
- undname — msvc tool to demangle names.
- demangler.com — An online tool for demangling GCC and MSVC C++ symbols
- The Objective-C Runtime System — From Apple's The Objective-C Programming Language 1.0
- Calling conventions for different C++ compilers by Agner Fog contains detailed description of name mangling schemes for various x86 and x64 C++ compilers (pp. 24–42 in 2011-06-08 version)
- C++ Name Mangling/Demangling Quite detailed explanation of Visual C++ compiler name mangling scheme
- PHP UnDecorateSymbolName a php script that demangles Microsoft Visual C's function names.
- Mixing C and C++ Code
- Levine, John R. (2000) [October 1999]. 〈Chapter 5: Symbol management〉 1판. 《Linkers and Loaders》. The Morgan Kaufmann Series in Software Engineering and Programming. San Francisco, USA: Morgan Kaufmann. ISBN 1-55860-496-0. OCLC 42413382. 2012년 12월 5일에 원본 문서에서 보존된 문서. 2020년 1월 12일에 확인함. Code: [깨진 링크(과거 내용 찾기)] Errata:
- Name mangling demystified by Fivos Kefallonitis