aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2007-12-17 18:53:06 +0000
committerH.J. Lu <hjl.tools@gmail.com>2007-12-17 18:53:06 +0000
commit4a3523fa63382284cdcfe2c574e51446bf6ccfaf (patch)
tree99656c0d749da9fe58ddb946fa9793a0d8f342ff
parentc6a0999f0fcb83bda7db3c75a1970b5cfd82c6dd (diff)
downloadgdb-4a3523fa63382284cdcfe2c574e51446bf6ccfaf.zip
gdb-4a3523fa63382284cdcfe2c574e51446bf6ccfaf.tar.gz
gdb-4a3523fa63382284cdcfe2c574e51446bf6ccfaf.tar.bz2
2007-12-17 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-i386.c (output_insn): Use FRAG_APPEND_1_CHAR instead of frag_more/md_number_to_chars. (md_short_jump_size): Removed. (md_long_jump_size): Likewise. (md_create_short_jump): Likewise. (md_create_long_jump): Likewise.
-rw-r--r--gas/ChangeLog9
-rw-r--r--gas/config/tc-i386.c60
2 files changed, 16 insertions, 53 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index a68a38f..e1de1f0 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,12 @@
+2007-12-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/tc-i386.c (output_insn): Use FRAG_APPEND_1_CHAR
+ instead of frag_more/md_number_to_chars.
+ (md_short_jump_size): Removed.
+ (md_long_jump_size): Likewise.
+ (md_create_short_jump): Likewise.
+ (md_create_long_jump): Likewise.
+
2007-12-13 Bob Wilson <bob.wilson@acm.org>
* config/tc-xtensa.c (xg_symbolic_immeds_fit): Relax for weak
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index d0a387c..1906201 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -5000,10 +5000,7 @@ check_prefix:
q++)
{
if (*q)
- {
- p = frag_more (1);
- md_number_to_chars (p, (valueT) *q, 1);
- }
+ FRAG_APPEND_1_CHAR (*q);
}
/* Now the opcode; be careful about word order here! */
@@ -5042,12 +5039,9 @@ check_prefix:
/* Now the modrm byte and sib byte (if present). */
if (i.tm.opcode_modifier.modrm)
{
- p = frag_more (1);
- md_number_to_chars (p,
- (valueT) (i.rm.regmem << 0
- | i.rm.reg << 3
- | i.rm.mode << 6),
- 1);
+ FRAG_APPEND_1_CHAR ((i.rm.regmem << 0
+ | i.rm.reg << 3
+ | i.rm.mode << 6));
/* If i.rm.regmem == ESP (4)
&& i.rm.mode != (Register mode)
&& not 16 bit
@@ -5055,14 +5049,9 @@ check_prefix:
if (i.rm.regmem == ESCAPE_TO_TWO_BYTE_ADDRESSING
&& i.rm.mode != 3
&& !(i.base_reg && i.base_reg->reg_type.bitfield.reg16))
- {
- p = frag_more (1);
- md_number_to_chars (p,
- (valueT) (i.sib.base << 0
- | i.sib.index << 3
- | i.sib.scale << 6),
- 1);
- }
+ FRAG_APPEND_1_CHAR ((i.sib.base << 0
+ | i.sib.index << 3
+ | i.sib.scale << 6));
}
/* Write the DREX byte if needed. */
@@ -6574,41 +6563,6 @@ md_convert_frag (abfd, sec, fragP)
fragP->fr_fix += extension;
}
-/* Size of byte displacement jmp. */
-int md_short_jump_size = 2;
-
-/* Size of dword displacement jmp. */
-int md_long_jump_size = 5;
-
-void
-md_create_short_jump (ptr, from_addr, to_addr, frag, to_symbol)
- char *ptr;
- addressT from_addr, to_addr;
- fragS *frag ATTRIBUTE_UNUSED;
- symbolS *to_symbol ATTRIBUTE_UNUSED;
-{
- offsetT offset;
-
- offset = to_addr - (from_addr + 2);
- /* Opcode for byte-disp jump. */
- md_number_to_chars (ptr, (valueT) 0xeb, 1);
- md_number_to_chars (ptr + 1, (valueT) offset, 1);
-}
-
-void
-md_create_long_jump (ptr, from_addr, to_addr, frag, to_symbol)
- char *ptr;
- addressT from_addr, to_addr;
- fragS *frag ATTRIBUTE_UNUSED;
- symbolS *to_symbol ATTRIBUTE_UNUSED;
-{
- offsetT offset;
-
- offset = to_addr - (from_addr + 5);
- md_number_to_chars (ptr, (valueT) 0xe9, 1);
- md_number_to_chars (ptr + 1, (valueT) offset, 4);
-}
-
/* Apply a fixup (fixS) to segment data, once it has been determined
by our caller that we have all the info we need to fix it up.