www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - objconv 2.03 released (includes .OBJ disassembler)

reply Don <nospam nospam.com> writes:
Agner Fog's objconv utility 2.03 has just been released.
It supports conversions between object file types
(OMF<->COFF<->ELF<->Mach-O).
This latest release is significant for users of  DMD - Windows, since it
is the first one which can disassemble OMF files containing COMDAT 
sections - which means every .obj file produced by DMD Windows.

It cannot do everything which Walter's obj2asm can do, but it does have 
a comprehensive disassembler which includes all x87, MMX, SSE, SSE2, 
SSE3, SSE4, SSE5, AVX, and FMA instructions. So many D programmers 
should find it useful.

Source code is released under the GPL. The support for COMDAT, and 
testing for DMD was done by me. Everything else is by Agner.

Download it from
http://www.agner.org/optimize/
in the section "Object File Converter".
Dec 06 2008
next sibling parent John Reimer <terminal.node gmail.com> writes:
Hello Don,

 Agner Fog's objconv utility 2.03 has just been released.
 It supports conversions between object file types
 (OMF<->COFF<->ELF<->Mach-O).
 This latest release is significant for users of  DMD - Windows, since
 it
 is the first one which can disassemble OMF files containing COMDAT
 sections - which means every .obj file produced by DMD Windows.
 It cannot do everything which Walter's obj2asm can do, but it does
 have a comprehensive disassembler which includes all x87, MMX, SSE,
 SSE2, SSE3, SSE4, SSE5, AVX, and FMA instructions. So many D
 programmers should find it useful.
 
 Source code is released under the GPL. The support for COMDAT, and
 testing for DMD was done by me. Everything else is by Agner.
 
 Download it from
 http://www.agner.org/optimize/
 in the section "Object File Converter".
Nice! Thanks! :-) -JJR
Dec 06 2008
prev sibling next sibling parent "Tim M" <a b.com> writes:
Thanks to you and agner. I use this tool all the time for my ms-vs coff to  
omf conversions.

  On Sun, 07 Dec 2008 19:19:16 +1300, Don <nospam nospam.com> wrote:

 Agner Fog's objconv utility 2.03 has just been released.
 It supports conversions between object file types
 (OMF<->COFF<->ELF<->Mach-O).
 This latest release is significant for users of  DMD - Windows, since it
 is the first one which can disassemble OMF files containing COMDAT  
 sections - which means every .obj file produced by DMD Windows.

 It cannot do everything which Walter's obj2asm can do, but it does have  
 a comprehensive disassembler which includes all x87, MMX, SSE, SSE2,  
 SSE3, SSE4, SSE5, AVX, and FMA instructions. So many D programmers  
 should find it useful.

 Source code is released under the GPL. The support for COMDAT, and  
 testing for DMD was done by me. Everything else is by Agner.

 Download it from
 http://www.agner.org/optimize/
 in the section "Object File Converter".
Dec 07 2008
prev sibling next sibling parent =?iso-8859-1?Q?Robert_M=2E_M=FCnch?= <robert.muench robertmuench.de> writes:
On Sun, 07 Dec 2008 07:19:16 +0100, Don <nospam nospam.com> wrote:

 Agner Fog's objconv utility 2.03 has just been released.
 It supports conversions between object file types
 (OMF<->COFF<->ELF<->Mach-O).
 [...]
I think this will help a lot of DMC users as well. I sometimes have quite a problem when converting .lib files compiled with MSVC to use them with DMC. Thanks a lot for this. -- Robert M. Münch Management & IT Freelancer http://www.robertmuench.de
Dec 08 2008
prev sibling next sibling parent reply Esa Kylli <esa.kylli swipnet.se> writes:
Hi,

I'm a newbie to D and this tool.
I'm trying to convert an .OBJ file compiled in MSVC to OMF-format so that I can
link to it from my D code.
I get no errors in the conversion. But when I try to link to the OMF OBJ-file I
get these errors:
Error 42: Symbol Undefined __RTC_Shutdown
Error 42: Symbol Undefined __RTC_InitBase
Error 42: Symbol Undefined __RTC_CheckEsp

Anyone know what's going on here?
I would be grateful for any tips.

Another problem I have is when I try to convert the MSCV compiled OBJ-file to
OMF-format, but this time it's been compiled in release mode, I get the
following error:
Error 2006: Unsupported file type for file Main2.obj: Whole program
optimization intermediate file, Microsoft specific

Could this be caused by the fact that objconv doesn't support this case?

Best regards,
/Esa


Don Wrote:

 Agner Fog's objconv utility 2.03 has just been released.
 It supports conversions between object file types
 (OMF<->COFF<->ELF<->Mach-O).
 This latest release is significant for users of  DMD - Windows, since it
 is the first one which can disassemble OMF files containing COMDAT 
 sections - which means every .obj file produced by DMD Windows.
 
 It cannot do everything which Walter's obj2asm can do, but it does have 
 a comprehensive disassembler which includes all x87, MMX, SSE, SSE2, 
 SSE3, SSE4, SSE5, AVX, and FMA instructions. So many D programmers 
 should find it useful.
 
 Source code is released under the GPL. The support for COMDAT, and 
 testing for DMD was done by me. Everything else is by Agner.
 
 Download it from
 http://www.agner.org/optimize/
 in the section "Object File Converter".
Dec 09 2008
parent reply "Jarrett Billingsley" <jarrett.billingsley gmail.com> writes:
On Tue, Dec 9, 2008 at 10:02 AM, Esa Kylli <esa.kylli swipnet.se> wrote:
 Hi,

 I'm a newbie to D and this tool.
 I'm trying to convert an .OBJ file compiled in MSVC to OMF-format so that I
can link to it from my D code.
 I get no errors in the conversion. But when I try to link to the OMF OBJ-file
I get these errors:
 Error 42: Symbol Undefined __RTC_Shutdown
 Error 42: Symbol Undefined __RTC_InitBase
 Error 42: Symbol Undefined __RTC_CheckEsp

 Anyone know what's going on here?
 I would be grateful for any tips.
Those look like symbols for the MSVC runtime library. Your converted library apparently needs them. This is the problem with converting object files - even if you can convert it, you still have to deal with the fact that compilers will insert all kinds of dependencies on other libraries and objects that you don't know about. Compilers will also make assumptions about the way things are linked, and so even if you are able to convert the object, it might not work.
 Another problem I have is when I try to convert the MSCV compiled OBJ-file to
OMF-format, but this time it's been compiled in release mode, I get the
following error:
 Error 2006: Unsupported file type for file Main2.obj: Whole program
optimization intermediate file, Microsoft specific

 Could this be caused by the fact that objconv doesn't support this case?
Uh, yeah, that's pretty much exactly what the error message says. "Unsupported" means "I don't support this" ;)
Dec 09 2008
parent reply "Tim M" <a b.com> writes:
It's not really that much of a problem though. Just project->properties in  
ms vs and change a few options then it's plain sailing. Can't remember  
what it was though and it may of been a multiple of things but try code  
generation->buffer secuirty check off.



On Wed, 10 Dec 2008 04:23:00 +1300, Jarrett Billingsley  
<jarrett.billingsley gmail.com> wrote:

 On Tue, Dec 9, 2008 at 10:02 AM, Esa Kylli <esa.kylli swipnet.se> wrote:
 Hi,

 I'm a newbie to D and this tool.
 I'm trying to convert an .OBJ file compiled in MSVC to OMF-format so  
 that I can link to it from my D code.
 I get no errors in the conversion. But when I try to link to the OMF  
 OBJ-file I get these errors:
 Error 42: Symbol Undefined __RTC_Shutdown
 Error 42: Symbol Undefined __RTC_InitBase
 Error 42: Symbol Undefined __RTC_CheckEsp

 Anyone know what's going on here?
 I would be grateful for any tips.
Those look like symbols for the MSVC runtime library. Your converted library apparently needs them. This is the problem with converting object files - even if you can convert it, you still have to deal with the fact that compilers will insert all kinds of dependencies on other libraries and objects that you don't know about. Compilers will also make assumptions about the way things are linked, and so even if you are able to convert the object, it might not work.
 Another problem I have is when I try to convert the MSCV compiled  
 OBJ-file to OMF-format, but this time it's been compiled in release  
 mode, I get the following error:
 Error 2006: Unsupported file type for file Main2.obj: Whole program  
 optimization intermediate file, Microsoft specific

 Could this be caused by the fact that objconv doesn't support this case?
Uh, yeah, that's pretty much exactly what the error message says. "Unsupported" means "I don't support this" ;)
Dec 09 2008
parent Esa Kylli <esa.kylli swipnet.se> writes:
Thanks for the tip.
That setting didn't do it, but changing Basic Runtime Checks to Default did it.

Thanks for the help :-)

Best regards,
/Esa


Tim M Wrote:

 It's not really that much of a problem though. Just project->properties in  
 ms vs and change a few options then it's plain sailing. Can't remember  
 what it was though and it may of been a multiple of things but try code  
 generation->buffer secuirty check off.
 
 
 
 On Wed, 10 Dec 2008 04:23:00 +1300, Jarrett Billingsley  
 <jarrett.billingsley gmail.com> wrote:
 
 On Tue, Dec 9, 2008 at 10:02 AM, Esa Kylli <esa.kylli swipnet.se> wrote:
 Hi,

 I'm a newbie to D and this tool.
 I'm trying to convert an .OBJ file compiled in MSVC to OMF-format so  
 that I can link to it from my D code.
 I get no errors in the conversion. But when I try to link to the OMF  
 OBJ-file I get these errors:
 Error 42: Symbol Undefined __RTC_Shutdown
 Error 42: Symbol Undefined __RTC_InitBase
 Error 42: Symbol Undefined __RTC_CheckEsp

 Anyone know what's going on here?
 I would be grateful for any tips.
Those look like symbols for the MSVC runtime library. Your converted library apparently needs them. This is the problem with converting object files - even if you can convert it, you still have to deal with the fact that compilers will insert all kinds of dependencies on other libraries and objects that you don't know about. Compilers will also make assumptions about the way things are linked, and so even if you are able to convert the object, it might not work.
 Another problem I have is when I try to convert the MSCV compiled  
 OBJ-file to OMF-format, but this time it's been compiled in release  
 mode, I get the following error:
 Error 2006: Unsupported file type for file Main2.obj: Whole program  
 optimization intermediate file, Microsoft specific

 Could this be caused by the fact that objconv doesn't support this case?
Uh, yeah, that's pretty much exactly what the error message says. "Unsupported" means "I don't support this" ;)
Dec 10 2008
prev sibling parent reply Hoenir <mrmocool gmx.de> writes:
Don schrieb:
 This latest release is significant for users of  DMD - Windows, since it
 is the first one which can disassemble OMF files containing COMDAT 
 sections - which means every .obj file produced by DMD Windows.
It isn't even capable to convert the simplest example in the current version: extern(C): int global1=5; int doSomething(int num) { printf("blablub\n"); return global1; } -> Error 2305: 2 Communal Sections found. Currently not supported.
Jan 13 2009
parent reply Don <nospam nospam.com> writes:
Hoenir wrote:
 Don schrieb:
 This latest release is significant for users of  DMD - Windows, since it
 is the first one which can disassemble OMF files containing COMDAT 
 sections - which means every .obj file produced by DMD Windows.
It isn't even capable to convert the simplest example in the current version: extern(C): int global1=5; int doSomething(int num) { printf("blablub\n"); return global1; } -> Error 2305: 2 Communal Sections found. Currently not supported.
Works for me. Looks like you have an older version?
Jan 14 2009
parent reply Hoenir <mrmocool gmx.de> writes:
Don schrieb:
 Hoenir wrote:
 Don schrieb:
 This latest release is significant for users of  DMD - Windows, since it
 is the first one which can disassemble OMF files containing COMDAT 
 sections - which means every .obj file produced by DMD Windows.
It isn't even capable to convert the simplest example in the current version: extern(C): int global1=5; int doSomething(int num) { printf("blablub\n"); return global1; } -> Error 2305: 2 Communal Sections found. Currently not supported.
Works for me. Looks like you have an older version?
I downloaded the latest version. Used the calls: dmd main.d and objconv -fcoff32 main.obj main.o doesn't work.
Jan 14 2009
parent Don <nospam nospam.com> writes:
Hoenir wrote:
 Don schrieb:
 Hoenir wrote:
 Don schrieb:
 This latest release is significant for users of  DMD - Windows, 
 since it
 is the first one which can disassemble OMF files containing COMDAT 
 sections - which means every .obj file produced by DMD Windows.
It isn't even capable to convert the simplest example in the current version: extern(C): int global1=5; int doSomething(int num) { printf("blablub\n"); return global1; } -> Error 2305: 2 Communal Sections found. Currently not supported.
Works for me. Looks like you have an older version?
I downloaded the latest version. Used the calls: dmd main.d and objconv -fcoff32 main.obj main.o doesn't work.
I never said that conversion to COFF works. It doesn't. Only the disassembly listing works. objconv -fasm main.obj should work. (It didn't work on previous versions, which made the tool 100% useless for D).
Jan 14 2009