How to write asm output file in finish_unit_callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I'm writing a plugin which extract some information first then write
them back to asm file formatted as pseudo-ops. In my design the write
back to asm part is in finish_unit_callback. I thought  at this time
output to asm_out_file should already finished and file already
closed, so i used

fopen ( asm_file_name, "a" );

and fprintf() to write my data. But I found:

If I use fclose() after fprintf(), I got nothing in asm output;
If I don't close the file I opened, I can got correct output, but if I
write too much data, the first several chracters are truncated.

I guess at the time finish_unit_callback execute the asm output file
is still being accessed by the compiler, is it? how to append some
pseudo-ops at the end of asm output file in a plugin?

Thanks,
Yue Liu




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux