Commit Graph

450 Commits

Author SHA1 Message Date
H. Peter Anvin
fb658ae61b regs.dat: fix comment 2007-05-15 04:33:43 +00:00
H. Peter Anvin
90b9417613 16-bit relocations are standard in ELF64 (at my request, incidentally) 2007-05-04 18:47:16 +00:00
Chuck Crayne
b7eea1c940 Addition of elf32 and elf64 output formats.
Addition of ! as unary operator in expression evaluation.
Allow numeric constants in DQ directive.
2007-05-04 02:16:08 +00:00
Chuck Crayne
cb9bc21374 Allow '!' to be used in expressions with same meaning as in C. 2007-05-02 04:21:26 +00:00
Chuck Crayne
60ae75d3ab Add %IFN and %ELIFN as per RFE #786286 2007-05-02 01:59:16 +00:00
Chuck Crayne
45ef7e76ee Accept responsibility for support of outelf64.c 2007-04-30 22:26:58 +00:00
Chuck Crayne
8ab0320f02 Clarify comments about relocation entries. 2007-04-29 20:57:53 +00:00
Chuck Crayne
1c270b7fe2 Allow ELF32 to be invoked either as -f elf or -f elf32 2007-04-29 00:28:24 +00:00
Chuck Crayne
6e61733e38 Eliminate shift count warnings when building on 32-bit systems
Remove define for DEBUG
2007-04-28 22:18:04 +00:00
Chuck Crayne
26d3de3217 Initial support for ELF64 2007-04-28 06:18:48 +00:00
H. Peter Anvin
8d7316a3ff Fix the handling of \324 for computing the length
\324 means REX.W is mandatory, but that doesn't mean add a byte to the
output!  Instead, force REX.W set, and let the REX logic deal with the
length.
2007-04-18 02:27:18 +00:00
Keith Kanios
7295e9856d Fixed RDF/2 to comply with "maxbits" use. 2007-04-18 02:24:34 +00:00
H. Peter Anvin
0db11e236b Handle "LOCK as REX.R" for MOV CRx; fix warning for invalid 64-bit regs
- MOV gpr,CRx or MOV CRx,gpr can access high control registers with a LOCK
  prefix; handle that in both the assembler and disassembler.
- Get a saner error message when trying to access high resources in
  non-64-bit mode.
2007-04-17 20:23:11 +00:00
Keith Kanios
fd626d6770 MEM_OFFSET Instructions Fixed. 2007-04-16 18:16:46 +00:00
Keith Kanios
fd5d91383a Fixed 64-bit Mode Segment Selection. 2007-04-16 15:46:46 +00:00
Keith Kanios
e83b318017 Fixed distinction between [LOCAL]SYMBOL/IMMEDIATE for RIP-relative addressing. 2007-04-16 14:31:54 +00:00
Keith Kanios
56e3528b4a Fixed long mode MEM_OFFS issue. 2007-04-16 14:05:01 +00:00
Keith Kanios
76a83979d8 Filled in all RIP Register Flags. 2007-04-16 13:54:49 +00:00
H. Peter Anvin
ed45f4c6f2 More \321 -> \324 for 64-bit instructions
The assembler doesn't seem to care, but for the disassembler, it's
vitally important that we get our operand-size hints correctly.  We
probably need to audit insns.dat for this kinds of errors.
2007-04-16 05:26:29 +00:00
Keith Kanios
7a68f30dd7 Fixed 64-bit offset generation. 2007-04-16 04:56:06 +00:00
H. Peter Anvin
7cf03aff4f More 64-bit ndisasm fixes.
In particular, now we should handle A0-A3 instructions.
2007-04-16 02:39:56 +00:00
H. Peter Anvin
b061d595fb Fixes for 64-bit ndisasm.
This fixes some of the most glaring bugs in ndisasm 64-bit mode.  We're
still getting redundant prefixes for unknown reason, however.
2007-04-16 02:02:06 +00:00
H. Peter Anvin
88aa185d36 Use + instead of * for extension; it feels cleaner with the new meaning.
We used to use * to mean substitute in 0-7.  Now it means that it should
be incremented 8 times.  Using a different character feels cleaner.
2007-04-16 01:21:29 +00:00
H. Peter Anvin
0ee014231f Initial 64-bit support for ndisasm. Still a work in progress.
64-bit support for ndisasm.  This is very much an initial attempt, and
there are guaranteed to be bugs in the code.  However, some *very*
preliminary testing seems to indicate it's not completely off-base.
2007-04-16 01:18:30 +00:00
H. Peter Anvin
99f309cc07 Clean up the 64-bitification of regs.dat for 64-bit ndisasm support
64-bit support required some major changes to regs.dat; clean some of
it up (re-introduce patterns, where appropriate) and allow a single
register to belong to multiple disassembly classes; also keep track
of the x86 register number again.
2007-04-15 23:12:17 +00:00
H. Peter Anvin
2b8f5d2b80 Remove @GCCFLAGS@
Remove the now obsolete @GCCFLAGS@.
2007-04-15 23:10:26 +00:00
H. Peter Anvin
e2eb92d055 CR8 is not special in any way as far as the assembler is concerned.
CR8 is not special in any way as far as the assembler is concerned.  It's
listed as having a special form in the Intel documentation, but that is
only because there are no other CRs which require a REX prefix.

MOV to CR8 is special in the sense that it's a non-serializing
instruction, but that's irrelevant to the assembler.

Furthermore, it's totally unclear how TRs should be handled in long mode;
there are no CPUs which uses TRs which also have long mode, so the easiest
is to simply mark those instructions NOLONG.

Finally, add PRIV to some privileged instructions.
2007-04-15 23:09:23 +00:00
H. Peter Anvin
876c8a13d9 Get rid of @GCCFLAGS@
Get rid of the now-obsolete @GCCFLAGS@.
2007-04-15 23:03:28 +00:00
H. Peter Anvin
1ed0387476 Cleaner way to add gcc options
We can actually test for the options being accepted, rather than try
to test for gcc; this handles differences between gcc versions as well
as compilers with a similar command line set.
2007-04-15 22:45:25 +00:00
Keith Kanios
3faf938f79 Fixed distinction between RIP relative symbols and immediate values. 2007-04-15 22:08:30 +00:00
H. Peter Anvin
6303c87c45 Fix the register number for CR7 (it was using the same number as CR15). 2007-04-15 05:40:43 +00:00
H. Peter Anvin
7e1b8e909b More perl-like idioms for generating regdis.c
- Don't use an advancing counter through an array to do a push().
- An empty array is written as (), not 0.
2007-04-15 05:32:18 +00:00
Keith Kanios
b7314d83f1 Fixed regdis.c generation. 2007-04-15 01:37:13 +00:00
Keith Kanios
61ff53c80d Added DQ constants for all BITS modes. 2007-04-14 18:54:52 +00:00
H. Peter Anvin
f4ba92577e outmacho.c: stylistic cleanups
- No need to cast (int32_t)NULL for a sentinel; just write 0.
- Fix weird formatting of a structure.
- Remove redundant parantheses.
2007-04-14 08:03:02 +00:00
Keith Kanios
b2a0380eb8 Fixed support for DQ constants in long mode. 2007-04-14 03:52:05 +00:00
Keith Kanios
c8ef68bba9 Hopefully it is actually fixed this time :P 2007-04-14 03:44:31 +00:00
Keith Kanios
3e7bb1e046 Fixed structure initialization issue. 2007-04-14 01:49:07 +00:00
Keith Kanios
a2e9b953f8 Refixed uninitialized data. 2007-04-14 01:44:35 +00:00
Keith Kanios
df12db1f13 Fixed uninitialized structure data. 2007-04-14 01:40:24 +00:00
Keith Kanios
47776ac525 c99 printf/fprintf compliance. 2007-04-14 01:24:14 +00:00
Keith Kanios
c7ae18dba1 Placated unreferenced types. 2007-04-14 00:46:25 +00:00
Keith Kanios
93f2e9a5a1 c99 printf/fprintf compliance. 2007-04-14 00:10:59 +00:00
Keith Kanios
0899e21289 Added outmacho.* to static makefile. 2007-04-13 23:09:18 +00:00
Keith Kanios
567ee739f8 Fixed REGRIP -> RIPREG to match regs.dat. 2007-04-13 22:24:46 +00:00
Keith Kanios
8b2a72881c Fixed obj_fwrite() declaration to match "static" definition. 2007-04-13 22:07:53 +00:00
Keith Kanios
68d52b7737 Added appropriate "void" prototypes. 2007-04-13 22:03:24 +00:00
Keith Kanios
2a3311b546 Replaced str(n)casecmp with more standard str(n)icmp. 2007-04-13 22:00:42 +00:00
H. Peter Anvin
c40f89e1c2 AIf we have config.h, we should actually include it!!
Apparently configure was generating config.h, and nothing ever actually
included it.  Include it in nasm.h as well as compiler.h, and in
rdoff/rdlar.h which uses these macros.

There appears to be no use of HAVE_* macros in any file that doesn't
have nasm.h included; in fact, so far the only use has been in
rdoff/rdlar.h.
2007-04-13 20:06:41 +00:00
H. Peter Anvin
1a4440ac58 When compiling with gcc, compile with -W -Wall for maximum warnings. 2007-04-13 19:59:20 +00:00