Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

strange symbol in the object file

Li__Yang
Beginner
191 Views

Hi,all.

When i link to generate executable file after compiled the whole project in 32bits mode, the linker tell me there is a symbol at one object file can not be found! I work at the mac OSX 10.12 and use the intel compiler of version 2018. 

The symbol is '___cvtu64todp_sse2'. I am sure I not define or use the symbol in my whole project.  I use the objdump tool to get more info of the object file.

First, I open the symbol table. I find the strange symbol and it is tagged "UNDEFINED".

......
00000000         *UND* _g_thread_functions_for_glib_use
00000000         *UND* ___gxx_personality_v0
00000000         *UND* _g_threads_got_initialized
00000000         *UND* ___cxa_call_unexpected
00000000         *UND* __Unwind_Resume
00000000         *UND* ___cvtu64todp_sse2
00000000         *UND* __Z11GetLogLevelv
00000000         *UND* __Z17printf_log_helper13AudioLogLevelPKcz
00000000         *UND* _printf
 
Then I open the relocation table, There are a lot of entry of this symbol. A segment of the relocation table:
...
00000391 GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
000003b0 GENERIC_RELOC_LOCAL_SECTDIFF 0x40f8-0x2ff
000003d9 GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
000003ea GENERIC_RELOC_LOCAL_SECTDIFF 0x4100-0x2ff
00000403 GENERIC_RELOC_LOCAL_SECTDIFF 0x4150-0x2ff
000004ce GENERIC_RELOC_LOCAL_SECTDIFF 0x4098-0x2ff
0000063c GENERIC_RELOC_LOCAL_SECTDIFF 0x40f8-0x2ff
00000657 GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
000006a5 GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
00000790 GENERIC_RELOC_LOCAL_SECTDIFF __const-0x2ff
00000797 GENERIC_RELOC_LOCAL_SECTDIFF 0x4140-0x2ff
00000810 GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
00000838 GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
0000096c GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
000009df GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
00000a42 GENERIC_RELOC_LOCAL_SECTDIFF 0x40f8-0x2ff
00000b25 GENERIC_RELOC_LOCAL_SECTDIFF __const-0x2ff
00000b63 GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
00000b86 GENERIC_RELOC_LOCAL_SECTDIFF 0x4140-0x2ff
00000b9a GENERIC_RELOC_LOCAL_SECTDIFF 0x4118-0x2ff
00000bf5 GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
00000c1d GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
00000cae GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
00000cd6 GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
00000d67 GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
00000d8f GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
00000e20 GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
00000e48 GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
00000f36 GENERIC_RELOC_LOCAL_SECTDIFF __const-0x2ff
00000f67 GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
00000f92 GENERIC_RELOC_LOCAL_SECTDIFF 0x4140-0x2ff
00000fa6 GENERIC_RELOC_LOCAL_SECTDIFF 0x4118-0x2ff
0000100e GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
00001036 GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
00001113 GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
00001157 GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
0000119c GENERIC_RELOC_LOCAL_SECTDIFF 0x4150-0x2ff
...
 
Last, I disassembling the object file and display the symbol in the assembly code. I find there are 77 site. Moreover the symbol appear at a almost same code:
......
6a4: e8 57 f9 ff ff calll -1705 <__ZN16ClockrateManagerC1Ev>
        000006a5:  GENERIC_RELOC_VANILLA ___cvtu64todp_sse2
......
 
The symbol, '__ZN16ClockrateManagerC1Ev', is a construction function in my source file. But I not call it so many times
 
So many strange things happened. I want to know the reason. Is it a defect of intel compile of 2018. There more than one strange object file just like this in my project
 
I can post the command used to compile the file:
"/usr/local/bin/icpc -o clockratemanager.o -c -arch i386 -std=c++11 -stdlib=libc++ -isysroot /Applications/... -mmacosx-version-min=10.7 -arch i386 -I/opt/intel/composerxe/ipp/include -I/opt/intel/composerxe/include -g -O3 -pipe -wd1,161,172,177,181,188,383,593,869,981,1418,1419,1572,1599,2259,3199,18000 -restrict -fasm-blocks -ip -MD -MP -m32, -DENV_DARWIN=1..."
 
 
On the other hand, I compile the same source file at the same system and 2017 intel compile. I open the above object file, and find there a no the strange symbol in the symbol table:
......
00000000         *UND* _g_thread_functions_for_glib_use
00000000         *UND* ___gxx_personality_v0
00000000         *UND* _g_threads_got_initialized
00000000         *UND* ___cxa_call_unexpected
00000000         *UND* __Unwind_Resume
00000000         *UND* __Z11GetLogLevelv
00000000         *UND* __Z17printf_log_helper13AudioLogLevelPKcz
00000000         *UND* _printf
 
You can see that the 2018 compiler just generate one more symbol, the strange one, ___cvtu64todp_sse2.
 
In the assembly code, every thing seem normal. The construct function is just called 6 times. Build the whole project in 32bits, successfully.
 
I go back to the 2018 compiler and compile the file and whole project in 64bits, Every thing also is OK.
 
so any one encounter the same problem? I need help!
 
 
 
 
 
 
 
  
  
 
 
 
0 Kudos
5 Replies
jimdempseyatthecove
Black Belt
191 Views

Try -arch IA32

Jim Dempsey

Li__Yang
Beginner
191 Views

jimdempseyatthecove wrote:

Try -arch IA32

Jim Dempsey

Thank you to reply

I try it. But the compiler tell me :

icpc: command line warning #10159: invalid argument for option '-arch' 

so nothing chang

jimdempseyatthecove
Black Belt
191 Views

Sorry, I notice you are on MAC

-arch is listed (v17 docs) as not being a Linux and macOS option

Windows has /arch:IA32, you could try -arch=IA32  (with =  in place of the space)

-march=processor is supported (with available processor options)
*** however i386 is not an available processor option.

You do have -mcode (e.g. -mia32), but then this generates the x86/x87 (old Floating Point format)

ifort has (had) two versions of the compiler: Intel64 and IA32. Using the 32-bit compiler should default to generating 32-bit code.

Did you source the 32-bit compiler?

Jim Dempsey

Li__Yang
Beginner
191 Views

jimdempseyatthecove wrote:

Sorry, I notice you are on MAC

-arch is listed (v17 docs) as not being a Linux and macOS option

Windows has /arch:IA32, you could try -arch=IA32  (with =  in place of the space)

-march=processor is supported (with available processor options)
*** however i386 is not an available processor option.

You do have -mcode (e.g. -mia32), but then this generates the x86/x87 (old Floating Point format)

ifort has (had) two versions of the compiler: Intel64 and IA32. Using the 32-bit compiler should default to generating 32-bit code.

Did you source the 32-bit compiler?

Jim Dempsey

Thank you very much!

I think i should chang the arguments option

-arch is not available for macOS,i will throw it.

-march = corei7 is suitable i think

"You do have -mcode (e.g. -mia32), but then this generates the x86/x87 (old Floating Point format)"

what is the meaning? -m32 should not be used? i find the docs :

-m32 or /Qm32

Tells the compiler to generate code for IA-32 architecture.

"ifort has (had) two versions of the compiler: Intel64 and IA32. Using the 32-bit compiler should default to generating 32-bit code."

Dose the above line means the intel 2018 compiler has tow version, for 64bit and for 32bits?

I think i can only find a dmg for intel 2018 compiler. m_ccompxe_2018.0.026.dmg

Dose i have to use different compiler for different build?

jimdempseyatthecove
Black Belt
191 Views

I haven't installed V18 yet as I produce production code and I would rather wait for V18 update 1 or 2 before updating. I do use V17 update 5 on Linux and Windows. On Linux you issue something like

source /< install-dir >/bin/psxevars.sh ia32

or

source /< install-dir >/bin/compilervars.sh ia32

Where < install-dir > is where you installed the Intel code. The psxevars.sh may be in a different folder from the compilervars.sh

And the .sh files are for bash shell. You may have a different shell and may need to specify a different environment setup method.

Your documentation should state where and how to do this.

For 64-bit compiler, replace ia32 with intel64

Jim Dempsey

Reply