This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Instruction "call 0" in generated code


On Jan 29, 2012, at 4:27 PM, Kalle Olavi Niemitalo wrote:

> Amittai Aviram <amittai.aviram@yale.edu> writes:
> 
>> As you can see, instruction 0x4090e5 has "callq 0"!
>> So the question is why GCC has generated this code.
> 
> I think this will happen if you link with the static pthread
> library and your program uses pthread_cancel but not
> pthread_mutex_destroy.  To work around the problem, add some kind
> of reference to pthread_mutex_destroy so that the linker will
> pull it in.  If you are using GNU ld, try its -u (or --undefined)
> option; e.g. -Wl,-upthread_mutex_destroy.

This works!  Thank you very much!

Amittai Aviram
PhD Student in Computer Science
Yale University
646 483 2639
amittai.aviram@yale.edu
http://www.amittai.com



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]