News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

COFF spec for x64?

Started by nasm64developer, May 30, 2005, 08:52:58 AM

Previous topic - Next topic

nasm64developer

Does anyone know where I can find a COFF spec for x64?

Vortex

Flast assembler is able to emit 64-bit COFF object file, you should ask Privalov about the specification.

nasm64developer

> Flast assembler is able to emit 64-bit COFF object file

I tried ML64, YASM, and FASM -- they don't seem to be
able to emit the A0...A3h MOVs. To be fair though, I
did not try very hard.  :-o

                           <0> ; The A0...A3h MOVs use disp64.
                           <0> ; The B8...BFh MOVs use imm64.
                           <0>
                           <0> ; ELF64 supports the following relocations:
                           <0> ; - 8 and PC8 = 14 and 15
                           <0> ; - 16 and PC16 = 12 and 13
                           <0> ; - 32, 32S, and PC32 = 10, 11, and 2
                           <0> ; - 64 = 1 -- should be used for these MOVs?
                           <0>
                           <0> ; COFF64 supports the following relocations:
                           <0> ; - ADDR32 and REL32 = 2 and 4
                           <0> ; - ADDR64 = 1 -- should be used for these MOVs?
                           <0>
                           <0> ; neither ML64 nor YASM nor FASM get it right
                           <0>
0000 48A1F0DEBC9A7856-     <0> mov rax,[0x123456789ABCDEF0]
0008 3412                  <0>
000A 48A3F0DEBC9A7856-     <0> mov [0x123456789ABCDEF0],rax
0012 3412                  <0>
                           <0>
0014 48B8F0DEBC9A7856-     <0> mov rax,0x123456789ABCDEF0
001C 3412                  <0>
                           <0>
                           <0> extern e
                           <0>
001E 48A1-                 <0> mov rax,[e]
0020 [0000000000000000]    <0>
0028 48A3-                 <0> mov [e],rax
002A [0000000000000000]    <0>
                           <0>
0032 48B8-                 <0> mov rax,e
0034 [0000000000000000]    <0>

MazeGen

Hi developer,
what's wrong with those encodings? They seem correct to me:


48A1F0DEBC9A78563412  mov rax,[0x123456789ABCDEF0]

48: REX.W -> use 64-bit accumulator

A1: MOV RAX,[moffs64]

F0DEBC9A78563412: 64-bit offset

nasm64developer

> what's wrong with those encodings?
> 48A1F0DEBC9A78563412  mov rax,[0x123456789ABCDEF0]

Nothing.

I just had a little trouble getting the various
assemblers to emit them. By now I managed to get
FASM to work for both ELF and COFF. Also, I did
get YASM to work for ELF, but not COFF; it won't
emit ADDR64 relocations for the latter -- which
isn't surprising: there's no support for it in
the source of YASM's COFF backend. Last but not
least, the (slightly older?) version of ML64.EXE
that I'm trying, refuses to emit A0...A3h MOVs,
no matter what I throw at it. Oh well.

Anyway. What I am still looking for is something
like an official COFF64 spec for x86-64.