www.digitalmars.com         C & C++   DMDScript  

c++.windows.32-bits - coff2omf doesn't work correctly - example.zip

coff2omf.exe produce omf file from coff input with some mistakes
I attached an example, where it is very clear to see.

Here the disassempled input from original (coff) obj file

text:00000000                 public _zxfft_bitrev
text:00000000 _zxfft_bitrev   proc near               ; C
text:00000000
..
text:00000022                 xor     edx, edx
text:00000024                 mov     dl, ds:$L1227[eax]
text:0000002A                 jmp     ds:$L1228[edx*4]
text:00000031 $L971:
..
text:0000003A $L973:
..
text:0000013A $L1228          dd offset $L971         ; DATA
text:0000013E                 dd offset $L973
text:00000142                 dd offset $L975
text:00000146                 dd offset $L977
text:0000014A                 dd offset $L979
text:0000014E                 dd offset $L981
text:00000152                 dd offset $L983
;
text:00000156 $L1227          db 0, 7 dup(6), 1, 0Fh dup(6) ;
text:00000156                 db 2, 1Fh dup(6), 3, 3Fh dup(6)
text:00000156                 db 4, 7Fh dup(6), 5

==================================================================
The result of conversion to Omf is totally wrong!!!

_TEXT:00000010                 public _zxfft_bitrev
_TEXT:00000010 _zxfft_bitrev   proc near
..
_TEXT:00000032                 xor     edx, edx
_TEXT:00000034                 mov     dl, byte ptr ds:_zxfft_bitrev[eax]
_TEXT:0000003A                 jmp     dword ptr ds:_zxfft_bitrev[edx*4]
..
_TEXT:0000014A                 dd offset _zxfft_bitrev
_TEXT:0000014E                 dd offset _zxfft_bitrev
_TEXT:00000152                 dd offset _zxfft_bitrev
_TEXT:00000156                 dd offset _zxfft_bitrev
_TEXT:0000015A                 dd offset _zxfft_bitrev
_TEXT:0000015E                 dd offset _zxfft_bitrev
_TEXT:00000162                 dd offset _zxfft_bitrev
_TEXT:00000166                 db 0, 7 dup(6), 1, 0Fh dup(6)
_TEXT:00000166                 db 2, 1Fh dup(6), 3, 3Fh dup(6)
_TEXT:00000166                 db 4, 7Fh dup(6), 5


Regards
Dmitry


begin 0644 example.zip
M4$L#!`H``````#`&*3,````````````````%````0V]F9B]02P,$%````` `
M9G0H,_Q`R<"6"0``P! ```T```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O^1/JIO8
M[[CO*^,Y1\2-T^#O]E FA_U&/#1.+XSF9-D]"!*GKO8^Z+U1:,>7 V-[:O6\
MS?SIQG"'N>;0'C0(K]`M3T\19[9T M08I6.1/[O+%K%AK!(8Y-X*2P/#L.M-
MD0_QP93N*T+FY.'JR\H8W /?F<)F*K[_)U,;LY2Q4"P\9Q7OYRQ.2)GWZ&Y6
M\AX5)?=1 <`3"<%O]*R2PJ]2H$F1#M";4)[3)U,? ?7R,R)_=$I\JJ!E8!<;
MC()!UH!-FL`FW2A_5Y<'W\"70]M5,,LJ,,JGD;>`7;Z%N\MR,$L#\J?!,BKR
MG^ /#+VMKQKZEYX8? 17E^/X1O38\)_UU>Q<"WA2ABH'!'ZQA8$2'!!+AO6C
MT&4FA3F=DML9"#R>P^-JH)H-KM)7#WY1C[%^^EOKOU!+`0(5! H``````#`&
M*3,````````````````%````````````$`#`00````!#;V9F+U!+`0(5!A0`
M```(`&9T*#/\0,G`E D``,`8```-````````````(`"` 2,```!#;V9F+V9F
M=' N;V)J4$L!`A4&" ``````-P8I,P````````````````0````````````0
M`,!!Y`D``$]M9B]02P$"%084````"`!F=" S:OXIZA )``#X%```#```````
M`````"`` ($&" ``3VUF+V9F=' N;V)J4$L%! `````$``0`V ```$ 3````
!````
`
end
Sep 08 2005