Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29284 Discussions

How to convert an O file to fortran source file

Vahid_E_
Beginner
1,932 Views

Hi all,

I have received from somebody else a Fortran object file (created under Linux). Can I convert it back to the source file? (I have Windows 7)

0 Kudos
5 Replies
andrew_4619
Honored Contributor III
1,932 Views

No you need the original source file (.for / .f90) , the o file is the compiled binary code.

0 Kudos
mecej4
Honored Contributor III
1,933 Views

A tool that does this is called a "decompiler". As far as I know, in practical terms, especially if the object file was produced by an optimizing compiler or the -g compiler was not used, there is no such tool.

 

0 Kudos
Arjen_Markus
Honored Contributor II
1,933 Views

The best you might hope to achieve is to convert it to assembly code and as that is rather platform-dependent, you would have to figure out from that code what is really going on. It would be much easier to reprogram the thing if you know what it is meant to do.

0 Kudos
Andrew_Smith
Valued Contributor I
1,933 Views

No you can not

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,933 Views

An alternative question might be can you convert the Fortran Linux built .o file into a compatible Fortran Windows build .obj file. It might be possible to do this, but you may need to add helper functions if the calling conventions differ. Other than that, it is reverse engineering from the assembly code.

Jim Dempsey

0 Kudos
Reply