This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] S/390: Fix objdump output of larl operand - take 2


> How about (memaddr + (int) value + (int) value)?  That avoids the
> overflow without the need for long long.

Right - that would be better. I've just committed the attached patch.

Thanks!

Bye,

-Andreas-


2009-09-10  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
	
	* s390-dis.c (print_insn_s390): Avoid 'long long'.


Index: opcodes/s390-dis.c
===================================================================
--- opcodes/s390-dis.c.orig	2009-09-10 10:14:21.000000000 +0200
+++ opcodes/s390-dis.c	2009-09-10 10:56:29.000000000 +0200
@@ -222,8 +222,8 @@ print_insn_s390 (bfd_vma memaddr, struct
 	      else if (operand->flags & S390_OPERAND_CR)
 		(*info->fprintf_func) (info->stream, "%%c%i", value);
 	      else if (operand->flags & S390_OPERAND_PCREL)
-		(*info->print_address_func) (memaddr +
-					     (((long long)(int)value) << 1), info);
+		(*info->print_address_func) (memaddr + (int)value + (int)value,
+					     info);
 	      else if (operand->flags & S390_OPERAND_SIGNED)
 		(*info->fprintf_func) (info->stream, "%i", (int) value);
 	      else


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]