Commit Graph

1431 Commits

Author SHA1 Message Date
H. Peter Anvin
c3cea48430 ELF64: fix various GOT relocations
Try to make the various GOT relocations do the right thing in ELF64,
including erring out when appropriate.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-15 15:23:18 -07:00
H. Peter Anvin
b048324b9e Test for various ELF64 GOT references
Try to test for various GOT references in ELF64.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-15 15:22:03 -07:00
H. Peter Anvin
a3e57106fa doc: add link to the macro packages when talking about them
When discussing the standard macro packages in the context of
__USE_*__ macros, link to them as well as to the %use directive.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-15 11:15:48 -07:00
H. Peter Anvin
d5118f2009 BR 2164053: --prefix _ not --prefix_
The --prefix option takes a separate argument, not an attached
argument.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-13 10:17:27 -07:00
H. Peter Anvin
d3671e061d NASM 2.05rc4 2008-10-12 21:17:34 -07:00
H. Peter Anvin
8cd1df87e5 Document RIP-relative GOT fixes in ELF64 2008-10-12 21:17:04 -07:00
Charles Crayne
154f6f2380 Fix typo in previous outelf64.c commit
Stray line fragment left in when removing debug code.
2008-10-12 14:14:45 -07:00
Charles Crayne
cff8dc6d6b RIP rel relocations for PIC released for testing.
Expressions like
  mov	r15,[rel integer wrt ..got]
  lea   rax,[rel integer wrt ..gotoff]
now assemble correctly.

In addition, a fix has been made to the corresponding
abs relocations.

Both of these areas still need additional testing.
2008-10-12 14:00:11 -07:00
H. Peter Anvin
507ae03bd1 assemble.c: use case4() macros like in disasm.c
Use the case4() macros as we already do in disasm.c.  It helps reduce
visual clutter, and more clearly demonstrates that groups of four
belong together.  Furthermore, it makes the text compact enough that
we can now use case statements to mask down the EA patterns correctly.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-09 15:37:10 -07:00
H. Peter Anvin
fa3833db81 disasm: collapse all the segment register push/pop bytecodes
As far as the disassembler is concerned, the segment register push/pop
bytecodes can be collapsed to a simple expression; the remaining
differences are handled by the filter expressions in insns.pl.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-09 14:15:36 -07:00
H. Peter Anvin
aac7c0c174 test/pushseg.asm: add "pop cs"
"pop cs" is an 8086-only opcode; we support it for assembly but not
for disassembly.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-08 23:32:33 -07:00
H. Peter Anvin
c3ba3acf70 test/pushseg.asm: test for push/pop of segment registers
Simple test for push/pop of segment registers.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-08 23:30:41 -07:00
H. Peter Anvin
ff6e12da50 Reshuffle and move the bytecodes for segment register push/pop
Reshuffle the bytecodes for segment register push/pop to make more
sense, and move them from \4 to \344, thus freeing up the single-digit
bytecodes \4..\7 for future use.  It doesn't really make sense to use
single-digit bytecodes for this very oddball use.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-08 21:17:32 -07:00
H. Peter Anvin
a5c31197f5 Collect statistics on bytecode use in insnsb.c
We are starting to have to worry about running short on available
bytecodes, especially where we encode the operand number in the byte
code.  Thus, compile a table of bytecode usage and include as a
comment in insnsb.c.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-08 16:56:35 -07:00
H. Peter Anvin
e67484e3cb NASM 2.05rc3 2008-10-08 16:25:26 -07:00
H. Peter Anvin
22098d3618 test/imul.asm: remove obsolete ERROR marker
Error already fixed...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-07 16:53:49 -07:00
H. Peter Anvin
e831d67cec Test for various IMUL patterns
Test for IMUL patterns.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-07 11:28:29 -07:00
H. Peter Anvin
65feb5ae33 Add missing IMUL pattern: reg64,imm8
Make "imul rax,byte 5" work as expected.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-07 11:26:41 -07:00
H. Peter Anvin
37c6d166d2 Add a few missing \15 -> \275 conversions
Add a few \15 -> \275 conversions that had been missed earlier.
Still haven't done the work on IMUL.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-07 10:56:32 -07:00
H. Peter Anvin
55f58acdae Change \40 class opcodes to \254, except IMUL
Change \40 class opcodes which need to be changed to \254.  IMUL will
need a separate audit; I'm not convinced we are really sure what all
the IMUL conditions should be.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-07 10:53:08 -07:00
H. Peter Anvin
588df78b0d New opcode for 32->64 bit sign-extended immediate with warning
Add a new opcode for 32->64 bit sign-extended immediate, with warning
on the number not matching.

This unfortunately calls for an audit of all the \4[0123] opcodes, if
they should be replaced by \25[4567].  This only replaces one
instruction (MOV reg64,imm32); other instructions need to be
considered.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-07 10:05:10 -07:00
H. Peter Anvin
f70fce6cc9 test/immwarn.asm: add a few more non-warning tests
A few non-warning conditions.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-07 09:59:18 -07:00
H. Peter Anvin
ad6b8595b9 Remove is_sbyte64() and replace with is_sbyte32() plus custom warning
is_sbyte64() was equivalent to is_sbyte32() plus the warning; however,
the warning is only used in one place (and conflicts with another
warning there), so remove the function.

Furthermore, add back the test for pure immediates in
possible_sbyte(); they had been broken out but never folded back in --
and are essential.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-07 09:56:38 -07:00
H. Peter Anvin
98a22a65c0 Avoid double warning for signed dword immediate
Avoid double warning for the case where a signed dword immediate is
incorrectly extended to 64 bits.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-06 23:49:01 -07:00
H. Peter Anvin
c1377e9a98 New opcodes to deal with 8-bit immediate sign extended to opsize
New opcodes to deal with 8-bit immediates which are then sign-extended
to the operand size.  These allow us to warn appropriately.
Not sure I'm using these in all the proper places; need audit of all
uses of the \14..\17 opcodes.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-06 23:40:31 -07:00
H. Peter Anvin
94cacf8ea9 NASM 2.05rc2 2008-10-06 19:16:27 -07:00
H. Peter Anvin
68b41d3d47 changes: document immediate fix 2008-10-06 19:15:42 -07:00
H. Peter Anvin
9f8171317d BR 2148448: Fix RIP-relative addressing with an immediate
When there is an immediate in the instruction, a RIP-relative offset
may not be relative to the end of the offset itself, since it is
relative to the end of the *instruction*, not the end of the *offset*.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-06 19:11:07 -07:00
H. Peter Anvin
a9ed99bddf immwarn: more immediate warnings test, with notes of where we fail
More tests for immediate warnings, with notes for the ones where we
currently fail to do the right thing.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-06 18:49:00 -07:00
H. Peter Anvin
e9d7f1a074 Better warnings for out-of-range values
Issue better warnings for out-of-range values.  This is not yet
complete.

In particular, note we may have out-of-range for values that end up
being subject to optimization.  That is because the optimization takes
place on the *truncated* value, not the pre-truncated value.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-06 18:47:29 -07:00
H. Peter Anvin
733cbb3197 test: change .stdout/.stderr to stdout/stderr
Using hidden files are rather antisocial, and rather pointless in this
particular context.  Change .stdout and .stderr to simply stdout and
stderr.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-06 18:28:42 -07:00
H. Peter Anvin
04c6052670 changes: document CVT fixes.
Document fixes to the CVT instructions.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-06 18:00:13 -07:00
H. Peter Anvin
ee6789ceb1 BR 2148476: Fix arguments for a bunch of the CVT* instructions
Fix bugs exposed by test for BR 2148476.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-06 17:58:57 -07:00
H. Peter Anvin
1755a719a4 test/br2148476.asm: comprehensive test of the CVT* instructions
Do a best attempt at a comprehensive test of the various CVT* SSE
instructions.  This includes the bug of BR 2148476.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-06 17:57:18 -07:00
H. Peter Anvin
9ac2b843b4 test/immwarn.asm: new test for immediate warnings
Test for various conditions that should or should not generate
immediate warnings.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-05 19:41:32 -07:00
H. Peter Anvin
1b221bed25 test/Makefile: rule to run performtest --diff
Rule to run performtest with the --diff option.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-04 22:02:44 -07:00
H. Peter Anvin
9c209cc256 performtest: use -u with diff
Unified diffs are the only sane option.  When calling diff, pass the
-u option.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-04 22:01:42 -07:00
H. Peter Anvin
13d9d869a5 test/Makefile: add rules for the automatic tests
Add Makefile rules to run the automatic tests.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-04 21:59:38 -07:00
H. Peter Anvin
833caeab28 assemble.c: be smarter about when to suppress warnings due to SBYTE
Be smarter and don't suppress warnings due to SBYTE when the SBYTE
didn't actually match.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-04 19:02:30 -07:00
H. Peter Anvin
6c80ab6f7f assemble.c: do not warn on valid SBYTE optimizations
Do not warn on valid SBYTE optimizations.  If we are optimizing and
match one of the SBYTE conditions, do not error out.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-04 18:50:47 -07:00
H. Peter Anvin
ece980c38b NASM 2.05rc1 2008-10-01 16:08:23 -07:00
H. Peter Anvin
a3a60e95a0 doc/changes.src: update
Add information about the recent bug fixes.
2008-10-01 10:02:44 -07:00
Victor van den Elzen
fd49408ed9 Already aligned aligns should be 0 bytes, not %1. 2008-10-01 13:21:02 +02:00
Victor van den Elzen
4c9d6220b4 Apply patch from BR 890790 2008-10-01 13:09:27 +02:00
Victor van den Elzen
cf9332ca51 Apply patch from BR 1197827 2008-10-01 12:18:28 +02:00
H. Peter Anvin
1abb9e5370 changes.src: document JMP reg64 fix.
Document the fixed JMP reg64.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-09-30 17:14:54 -07:00
H. Peter Anvin
2aa72b64a6 rdsrc.pl: handle tabs in the input
It is just to painful to keep the source files tab-free.  Handle tabs
in the input as required.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-09-30 17:12:19 -07:00
H. Peter Anvin
e232d9a6bf doc: remove tab
The documentation processor doesn't like tabs.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-09-30 17:07:14 -07:00
H. Peter Anvin
972079f6a8 Put the static information about warnings in a structure
Put the static information about warnings in a structure, so one can
see what goes with what.  Also, change the sense so "true" means
enabled.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-09-30 17:01:23 -07:00
H. Peter Anvin
2f16043879 Allow %warning output to be suppressed
Allow the user to suppress user-specified warnings.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-09-30 16:39:17 -07:00