From: "H. J. Lu" <hjl@lucon.org>
To: binutils@sources.redhat.com
Cc: bob.wilson@acm.org
Subject: PATCH: Support 64bit BFD and 64bit host for xtensa
Date: Sun, 10 Apr 2005 16:39:00 -0000 [thread overview]
Message-ID: <20050410163925.GB28734@lucon.org> (raw)
In-Reply-To: <20050409204835.GA1319@lucon.org>
On Sat, Apr 09, 2005 at 01:48:35PM -0700, H. J. Lu wrote:
> m68k and xtensa are failed to build with --enable-64-bit-bfd. This
> patch fixes it.
>
It turns out that xtensa doesn't support 64bit BFD on 32bit host
nor 64bit host. xtensa passes pointer as int to frag_variant, where
it is stored as offsetT. This patch changes int to long.
H.J.
----
2005-04-10 H.J. Lu <hongjiu.lu@intel.com>
* frags.c (frag_variant): Change type of var from int to long.
* frags.h (frag_variant): Updated.
* config/tc-i960.c (get_cdisp): Updated call to frag_variant.
* config/tc-m68hc11.c (build_jump_insn): Likewise.
* config/tc-msp430.c (msp430_operands): Likewise.
* config/tc-xtensa.c (xtensa_mark_literal_pool_location): Likewise.
(xg_assemble_vliw_tokens): Likewise.
* config/tc-xtensa.c (xg_translate_sysreg_op): Likewise.
(xtensa_translate_old_userreg_ops): Likewise.
(xtensa_find_unaligned_branch_targets): Likewise.
(xtensa_find_unaligned_loops): Likewise.
(xtensa_fix_close_loop_end_frags): Likewise.
(relax_frag_add_nop): Likewise.
(xtensa_move_literals): Likewise.
--- gas/config/tc-i960.c.64bit 2005-03-25 10:18:49.000000000 -0800
+++ gas/config/tc-i960.c 2005-04-10 09:21:12.216332749 -0700
@@ -599,7 +599,7 @@ get_cdisp (char *dispP, /* Displacement
{
outP = frag_more (8); /* Allocate worst-case storage. */
md_number_to_chars (outP, instr, 4);
- frag_variant (rs_machine_dependent, 4, 4, 1,
+ frag_variant (rs_machine_dependent, 4, 4L, 1,
adds (e), offs (e), outP);
}
else
--- gas/config/tc-m68hc11.c.64bit 2005-02-24 12:47:34.000000000 -0800
+++ gas/config/tc-m68hc11.c 2005-04-10 09:21:19.773352892 -0700
@@ -1685,7 +1685,7 @@ build_jump_insn (struct m68hc11_opcode *
opcode = m68hc11_new_insn (3);
number_to_chars_bigendian (opcode, code, 1);
number_to_chars_bigendian (opcode + 1, 0, 1);
- frag_variant (rs_machine_dependent, 1, 1,
+ frag_variant (rs_machine_dependent, 1, 1L,
ENCODE_RELAX (STATE_PC_RELATIVE, STATE_UNDF),
operands[0].exp.X_add_symbol, (offsetT) n,
opcode);
--- gas/config/tc-msp430.c.64bit 2005-02-24 12:47:35.000000000 -0800
+++ gas/config/tc-msp430.c 2005-04-10 09:21:31.924777316 -0700
@@ -1695,7 +1695,7 @@ msp430_operands (struct msp430_opcode_s
frag = frag_more (8);
bfd_putl16 ((bfd_vma) rc.sop, frag);
- frag = frag_variant (rs_machine_dependent, 8, 2,
+ frag = frag_variant (rs_machine_dependent, 8, 2L,
ENCODE_RELAX (rc.lpos, STATE_BITS10), /* Wild guess. */
exp.X_add_symbol,
0, /* Offset is zero if jump dist less than 1K. */
@@ -1727,7 +1727,7 @@ msp430_operands (struct msp430_opcode_s
frag = frag_more (8);
bfd_putl16 ((bfd_vma) hc.op0, frag);
bfd_putl16 ((bfd_vma) hc.op1, frag+2);
- frag = frag_variant (rs_machine_dependent, 8, 2,
+ frag = frag_variant (rs_machine_dependent, 8, 2L,
ENCODE_RELAX (STATE_EMUL_BRANCH, STATE_BITS10), /* Wild guess. */
exp.X_add_symbol,
0, /* Offset is zero if jump dist less than 1K. */
--- gas/config/tc-xtensa.c.64bit 2005-04-09 13:58:23.000000000 -0700
+++ gas/config/tc-xtensa.c 2005-04-10 09:19:57.993956558 -0700
@@ -2247,7 +2247,7 @@ xg_translate_sysreg_op (char **popname,
if (sr == XTENSA_UNDEFINED)
{
as_bad (_("invalid register number (%ld) for '%s' instruction"),
- val, opname);
+ (long) val, opname);
return -1;
}
}
@@ -2316,7 +2316,7 @@ xtensa_translate_old_userreg_ops (char *
if (sr == XTENSA_UNDEFINED)
{
as_bad (_("invalid register number (%ld) for '%s'"),
- val, opname);
+ (long) val, opname);
return -1;
}
}
@@ -4650,10 +4650,10 @@ xtensa_mark_literal_pool_location (void)
frchain's fix list. We can use fr_var because fr_var's
interpretation depends solely on the fr_type and subtype. */
pool_location = frag_now;
- frag_variant (rs_machine_dependent, 0, (int) frchain_now,
+ frag_variant (rs_machine_dependent, 0, (long) frchain_now,
RELAX_LITERAL_POOL_BEGIN, NULL, 0, NULL);
xtensa_set_frag_assembly_state (frag_now);
- frag_variant (rs_machine_dependent, 0, (int) now_seg,
+ frag_variant (rs_machine_dependent, 0, (long) now_seg,
RELAX_LITERAL_POOL_END, NULL, 0, NULL);
xtensa_set_frag_assembly_state (frag_now);
@@ -4882,7 +4882,7 @@ xtensa_find_unaligned_branch_targets (bf
if (frag_addr + op_size > branch_align)
as_warn_where (frag->fr_file, frag->fr_line,
_("unaligned branch target: %d bytes at 0x%lx"),
- op_size, frag->fr_address);
+ op_size, (long) frag->fr_address);
}
frag = frag->fr_next;
}
@@ -4921,7 +4921,7 @@ xtensa_find_unaligned_loops (bfd *abfd A
if (frag_addr + op_size > xtensa_fetch_width)
as_warn_where (frag->fr_file, frag->fr_line,
_("unaligned loop: %d bytes at 0x%lx"),
- op_size, frag->fr_address);
+ op_size, (long) frag->fr_address);
}
frag = frag->fr_next;
}
@@ -6890,7 +6890,7 @@ xg_assemble_vliw_tokens (vliw_insn *vins
if (finish_frag)
{
frag_variant (rs_machine_dependent,
- extra_space, extra_space, RELAX_SLOTS,
+ extra_space, (long) extra_space, RELAX_SLOTS,
frag_now->fr_symbol, frag_now->fr_offset, f);
xtensa_set_frag_assembly_state (frag_now);
}
@@ -7462,7 +7462,7 @@ xtensa_fix_close_loop_end_frags (void)
if (fragP->fr_var < length)
as_fatal (_("fr_var %lu < length %d"),
- fragP->fr_var, length);
+ (long) fragP->fr_var, length);
else
{
assemble_nop (length,
@@ -8410,7 +8410,8 @@ relax_frag_add_nop (fragS *fragP)
if (fragP->fr_var < length)
{
- as_fatal (_("fr_var (%ld) < length (%d)"), fragP->fr_var, length);
+ as_fatal (_("fr_var (%ld) < length (%d)"),
+ (long) fragP->fr_var, length);
return 0;
}
@@ -9872,14 +9873,14 @@ xtensa_move_literals (void)
/* Note that we set this fr_var to be a fix
chain when we created the literal pool location
as RELAX_LITERAL_POOL_BEGIN. */
- frchain_to = (frchainS *) literal_pool->fr_var;
+ frchain_to = (frchainS *) (unsigned long) literal_pool->fr_var;
}
insert_after = literal_pool;
while (insert_after->fr_next->fr_subtype != RELAX_LITERAL_POOL_END)
insert_after = insert_after->fr_next;
- dest_seg = (segT) insert_after->fr_next->fr_var;
+ dest_seg = (segT) (unsigned long) insert_after->fr_next->fr_var;
*frag_splice = next_frag;
search_frag->fr_next = insert_after->fr_next;
--- gas/frags.c.64bit 2005-03-03 08:56:17.000000000 -0800
+++ gas/frags.c 2005-04-10 09:18:02.244964784 -0700
@@ -226,7 +226,7 @@ frag_var (relax_stateT type, int max_cha
No call to frag_grow is done. */
char *
-frag_variant (relax_stateT type, int max_chars, int var,
+frag_variant (relax_stateT type, int max_chars, long var,
relax_substateT subtype, symbolS *symbol, offsetT offset,
char *opcode)
{
--- gas/frags.h.64bit 2005-03-03 08:56:17.000000000 -0800
+++ gas/frags.h 2005-04-10 09:18:31.282199763 -0700
@@ -136,7 +136,7 @@ int frag_room (void);
char *frag_variant (relax_stateT type,
int max_chars,
- int var,
+ long var,
relax_substateT subtype,
symbolS * symbol,
offsetT offset,
next prev parent reply other threads:[~2005-04-10 16:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-09 20:48 PATCH: Support 64bit BFD for m68k and xtensa H. J. Lu
2005-04-10 16:39 ` H. J. Lu [this message]
2005-04-10 20:15 ` PATCH: Support 64bit BFD and 64bit host for xtensa Andreas Schwab
2005-04-10 20:27 ` H. J. Lu
2005-04-11 16:58 ` Bob Wilson
2005-04-11 17:40 ` H. J. Lu
2005-04-14 22:38 ` Bob Wilson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050410163925.GB28734@lucon.org \
--to=hjl@lucon.org \
--cc=binutils@sources.redhat.com \
--cc=bob.wilson@acm.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).