2015-12-22 4 views
6

हमारी निर्माण प्रक्रिया के हिस्से के रूप में हम एक निष्पादन योग्य संकलित करते समय एक मानचित्र फ़ाइल उत्पन्न करते हैं। उदाहरण के लिए:लिंकर मानचित्र फ़ाइल में कभी-कभी उलझन वाले प्रतीक होते हैं लेकिन हमेशा

g++ -Wl,-Map,/tmp/foo.map -o foo foo.cpp 

जीसीसी 4.3/4.4 से जीसीसी 4.9 में माइग्रेट करने के प्रयास में हमने एक नया निर्माण सर्वर स्थापित किया है। 4.9 बिल्ड सर्वर द्वारा उत्पन्न मानचित्र फ़ाइल में उलझन वाले प्रतीक नाम नहीं हैं। 4.3/4.4 बिल्ड सर्वर द्वारा उत्पन्न मानचित्र फ़ाइल करते हैं। उदाहरण के लिए, चल 4.3 मैं इस नक्शे फ़ाइल में कतरना पाने के साथ ऊपर:

.plt   0x0000000000400700  0x90 /usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../lib64/crt1.o 
       0x0000000000400710    [email protected]@GLIBCXX_3.4 
       0x0000000000400720    [email protected]@GLIBCXX_3.4 
       0x0000000000400730    [email protected]@GLIBC_2.2.5 

4,9 के खिलाफ एक ही कोड चल रहा है मैं निम्नलिखित स्निपेट हो:

.plt   0x00000000004006e0  0x80 /usr/lib/../lib64/crt1.o 
       0x00000000004006f0    std::ostream::operator<<(int)@@GLIBCXX_3.4 
       0x0000000000400700    std::ios_base::Init::Init()@@GLIBCXX_3.4 
       0x0000000000400710    [email protected]@GLIBC_2.2.5 
       0x0000000000400720    [email protected]@GLIBC_2.2.5 

इस बदलाव की उम्मीद है? क्या जीसीसी 4.9 (कुछ प्रकार की पिछली संगतता विकल्प) के साथ मैंगल्ड आउटपुट उत्पन्न करने का कोई तरीका है? मैं पूछता हूं क्योंकि हमारे निर्माण में बाद के उपकरण प्रतीक फ़ाइल का उपयोग करते हैं और बदनाम नामों पर चकित कर रहे हैं।

उत्तर

1

वहाँ एक रास्ता जीसीसी 4,9

मानचित्र फ़ाइल पीढ़ी कुछ भी नहीं जीसीसी के संस्करण के साथ क्या करना है के साथ घायल उत्पादन उत्पन्न करने के लिए है, और सब कुछ लिंकर के संस्करण के साथ क्या करना आप उपयोग कर रहे हैं (जो पुराने और नए निर्माण सर्वर के बीच अलग होना चाहिए)।

man ld से

:

--demangle[=style] 
--no-demangle 
     These options control whether to demangle symbol names in error 
     messages and other output. When the linker is told to demangle, 
     it tries to present symbol names in a readable fashion: it strips 
     leading underscores if they are used by the object file format, 
     and converts C++ mangled symbol names into user readable names. 
     Different compilers have different mangling styles. The optional 
     demangling style argument can be used to choose an appropriate 
     demangling style for your compiler. The linker will demangle by 
     default unless the environment variable COLLECT_NO_DEMANGLE is 
     set. These options may be used to override the default. 

मैं अनुमान लगा रहा हूँ कि पुराने लिंकर जब उत्पादन नक्शा पैदा करने, और नए लिंकर कि तय किया है --demangle पर ध्यान देना नहीं था।

+0

धन्यवाद, जोड़ना - किसी भी मुद्दे को हल नहीं किया। – Pace

संबंधित मुद्दे