Ticket #33 (closed defect: fixed)

Opened 4 years ago

Last modified 2 years ago

object format `win32' does not support architecture `x86' machine `amd64'

Reported by: jlawson-yasm Assigned to: peter@tortall.net
Priority: P2 Milestone: 0.4.0
Component: Object Format: coff Version: other
Severity: major Keywords:
Cc:

Description

(Note: there is no "Object Format: win32" component in Bugzilla)

Specifying "-a x86 -m amd64 -f win32" fails with this error.

yasm: FATAL: object format `win32' does not support architecture `x86' machine
`amd64'

Microsoft is currently doing public beta testing of upcoming Platform SDK and
Visual Studio 2005 ("Whidbey") compiler tools that produce AMD64 object code. 
YASM should strive to produce object files compatible with these upcoming tools.

Attachments

Change History

04/02/04 19:59:17 changed by peter

At present, there seems to be little available information regarding Microsoft's
AMD64 extensions to PE/COFF.  A little bit is available with regards to IA-64,
but that's all.  Until such information is available (are you aware of a good
source?  Microsoft seems to have very little truly publically available), we
will have to postpone adding this support.

04/02/04 23:51:36 changed by jlawson-yasm

Here is a posting from someone that contains a link to pre-release versions of
Microsoft's MASM ml64.exe -- http://www.sandpile.org/post/msgs/20004230.htm

04/11/04 08:58:29 changed by peter

  • status changed from new to assigned.
Started working on this; the link to the prerelease tools is very useful, as is
the test code you sent in private email.  Thanks!

04/11/04 16:27:17 changed by peter

Committed rudimentary support in modules/objfmts/coff/coff-objfmt.c r1.34.  I've
not yet completely figured out how the COFF relocations are supposed to work;
MASM generates REL32 (PC-relative) relocations for everything (!).  Rev 1.34
should work for all code without relocs (like the sample code you sent me earlier).

Continuing to leave open until I've had more chance to properly work through
(and do some testing of) relocations.

05/21/04 22:59:57 changed by jlawson-yasm

Created an attachment (id=8)
example that fails with "invalid relocation size"

05/21/04 23:00:56 changed by jlawson-yasm

Sample command-line to reproduce compile failure of attachment 8:

J:\>yasm -a x86 -m amd64 -o relfoo.obj -f win32 relfoo.asm
relfoo.asm:10: coff: invalid relocation size

06/19/04 15:46:24 changed by jlawson-yasm

I still see the "invalid relocation size" problem in the current nightly win32
snapshot (20040619) using the command-line given in my previous comment.

08/31/04 22:44:57 changed by jlawson-yasm

  • severity changed from normal to major.

09/03/04 16:08:22 changed by peter

  • status changed from assigned to resolved.
  • resolution set to fixed.
r1134 indirectly fixes the invalid relocation size issue, but doesn't generate
identical code to MASM.  MASM automatically generates RIP-relative relocations
for [varname].  To reproduce the same code generation on YASM, it's necessary to
use [varname wrt rip].

If RIP-relative relocations are not used, it may be the case on 64-bit Windows
that Windows will be unable to relocate the code above the 32-bit boundary, but
I have no way to test this.

While it is possible for YASM to mimic the behavior of MASM, it would not be
consistent with the overall theme (carried over from NASM) of not doing things
behind the programmer's back.

Unless someone can convince me otherwise, I think we'll just leave this as one
of those things to think about when translating 64-bit MASM code to YASM.

Add/Change #33 (object format `win32' does not support architecture `x86' machine `amd64')