From 574142b7d5b3ef3a10d76de1b6f08bd4a720b08c Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 13 Apr 2000 01:08:05 +0000 Subject: Remove U suffix from constants for K&R compilers. Fix a couple of 64 bit nits. --- bfd/elf32-d30v.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'bfd/elf32-d30v.c') diff --git a/bfd/elf32-d30v.c b/bfd/elf32-d30v.c index 263b5c010e..601fb95763 100644 --- a/bfd/elf32-d30v.c +++ b/bfd/elf32-d30v.c @@ -1,5 +1,5 @@ /* D30V-specific support for 32-bit ELF - Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1997, 98, 99, 2000 Free Software Foundation, Inc. Contributed by Martin Hunt (hunt@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -263,8 +263,8 @@ static reloc_howto_type elf_d30v_howto_table[] = }; -#define MIN32 (long long)0xffffffff80000000LL -#define MAX32 0x7fffffffLL +#define MAX32 ((bfd_signed_vma) 0x7fffffff) +#define MIN32 (- MAX32 - 1) static bfd_reloc_status_type bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) @@ -276,7 +276,7 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, bfd *output_bfd; char **error_message; { - long long relocation; + bfd_signed_vma relocation; bfd_vma in1, in2, num; bfd_vma tmp_addr = 0; bfd_reloc_status_type r; @@ -360,15 +360,10 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, if (howto->pc_relative == true && howto->bitsize == 32) { - /* the D30V has a PC that doesn't wrap and PC-relative jumps */ - /* are signed, so a PC-relative jump can'tbe more than +/- 2^31 byrtes */ - /* if one exceeds this, change it to an absolute jump */ - if (relocation > MAX32) - { - relocation = (relocation + tmp_addr) & 0xffffffff; - make_absolute = 1; - } - else if (relocation < MIN32) + /* The D30V has a PC that doesn't wrap and PC-relative jumps are + signed, so a PC-relative jump can't be more than +/- 2^31 bytes. + If one exceeds this, change it to an absolute jump. */ + if (relocation > MAX32 || relocation < MIN32) { relocation = (relocation + tmp_addr) & 0xffffffff; make_absolute = 1; -- cgit v1.2.1