build failure for ia64 (due to -Werror)

Andreas Schwab schwab@suse.de
Fri Mar 18 23:37:00 GMT 2005


James E Wilson <wilson@specifixinc.com> writes:

> On Fri, 2005-03-18 at 04:21, Alan Modra wrote:
>> I would guess 32-bit host, no --enable-64-bit-bfd.  Then "bfd_vma insn"
>> is 32-bit and ia64_insn is long long.  There's worse things in that code
>> than type-punned pointers..
>
> I believe this can only happen if --enable-targets=all is used.
>
> I see this is a documented feature in configure.in.  This seems like a
> flaw to me.  The elfxx-ia64.c file won't work without a 64-bit integer
> type, and it seems unreasonable to try to fix this.

The use of 32-bit vs 64-bit bfd_vma has nothing to do with the general
availability of a 64-bit type.  This bug is trivial to fix.  I've checked
in this patch as obvious.

Andreas.

2005-03-18  Andreas Schwab  <schwab@suse.de>

	* elfxx-ia64.c (elfNN_ia64_install_value): Change type of insn
	from bfd_vma to ia64_insn, remove broken cast.

Index: bfd/elfxx-ia64.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-ia64.c,v
retrieving revision 1.149
retrieving revision 1.150
diff -u -a -p -u -p -a -r1.149 -r1.150
--- bfd/elfxx-ia64.c	14 Mar 2005 18:55:44 -0000	1.149
+++ bfd/elfxx-ia64.c	18 Mar 2005 21:31:31 -0000	1.150
@@ -3119,7 +3119,8 @@ elfNN_ia64_install_value (hit_addr, v, r
 {
   const struct ia64_operand *op;
   int bigendian = 0, shift = 0;
-  bfd_vma t0, t1, insn, dword;
+  bfd_vma t0, t1, dword;
+  ia64_insn insn;
   enum ia64_opnd opnd;
   const char *err;
   size_t size = 8;
@@ -3308,7 +3309,7 @@ elfNN_ia64_install_value (hit_addr, v, r
       insn = (dword >> shift) & 0x1ffffffffffLL;
 
       op = elf64_ia64_operands + opnd;
-      err = (*op->insert) (op, val, (ia64_insn *)& insn);
+      err = (*op->insert) (op, val, &insn);
       if (err)
 	return bfd_reloc_overflow;
 

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



More information about the Binutils mailing list