[LLVMdev] weird function

Le Anh Quang anhquangbk at googlemail.com
Thu Jul 24 04:55:12 PDT 2008


Hi,
 thank for your answer. Is there any document/tutorial about linking
bytecode file with libstdc++ avaiable ?

Quang

-----Ursprüngliche Nachricht-----
Von: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] Im
Auftrag von Chris Lattner
Gesendet: Mittwoch, 23. Juli 2008 20:35
An: LLVM Developers Mailing List
Cc: Le Anh Quang
Betreff: Re: [LLVMdev] weird function


On Jul 23, 2008, at 11:31 AM, Duncan Sands wrote:

>> I  have tried to compile a simple cpp file with llvm-gcc. I have  
>> attached
>> the assemble file here.
>> I see a weird thing there. There are some call instructions, they  
>> call the
>> function "@_Znwj". But this function was only declared in the file,  
>> there is
>> no definition of it. So, how can it work, if this function is  
>> "empty" ?
>
> When you create a final executable using llvm-g++ it links with some  
> standard
> C++ libraries.  Probably @_Znwj is defined in one of those libraries.

_Znwj is aka "operator new".  You need to link to libstdc++.

-Chris
_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





More information about the llvm-dev mailing list