[LLVMdev] [DragonEgg] Strange call to @"\01__isoc99_fscanf"
dmitry at kernelgen.org
Tue Dec 25 14:03:27 PST 2012
Thanks for the hint! You're right: it is "callq __isoc99_fscanf" in .s
file. My mistake is that I'm taking a function name directly from CallInst
and trying to dlsym it from the running executable. Now I'm using
mangler.getNameWithPrefix method to get the actual name, and it works.
2012/12/25 Anton Korobeynikov <anton at korobeynikov.info>
> > While testing a File I/O sample program, I've encountered a link failure
> > to missing implementation of "\01__isoc99_fscanf" function. I think this
> > function should be named "__isoc99_fscanf" instead. Please see the
> > code and LLVM IR generated by DragonEgg and clang below. It shows that
> > generates "__isoc99_fscanf", while DragonEgg gives "\01__isoc99_fscanf".
> > generally use DragonEgg as our compiler frontend, so it is more
> > What could be the reason of "\01" issue?
> \01 is the magic prefix from asm("") thing in C sources. Basically
> this is the instruction to mangler not to change the name in any way,
> so, it should be emitted to assembler / binary code as
> How does .s / .o look like?
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev