diff options
author | Alan Modra <amodra@gmail.com> | 2000-04-13 01:08:05 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2000-04-13 01:08:05 +0000 |
commit | fc633e5b9780011f74f2c23837968e43e262a239 (patch) | |
tree | 5ccc69c4b1e69941727cee9ebe0a9a7fcd31de32 /bfd | |
parent | 3db10f32e0e0cbf960edcdf6ed42ccb3bc7c4952 (diff) | |
download | gdb-fc633e5b9780011f74f2c23837968e43e262a239.zip gdb-fc633e5b9780011f74f2c23837968e43e262a239.tar.gz gdb-fc633e5b9780011f74f2c23837968e43e262a239.tar.bz2 |
Remove U suffix from constants for K&R compilers.
Fix a couple of 64 bit nits.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 16 | ||||
-rw-r--r-- | bfd/coff-a29k.c | 6 | ||||
-rw-r--r-- | bfd/elf32-d30v.c | 21 | ||||
-rw-r--r-- | bfd/elf32-fr30.c | 4 | ||||
-rw-r--r-- | bfd/elf32-hppa.h | 3 | ||||
-rw-r--r-- | bfd/elf32-mips.c | 8 | ||||
-rw-r--r-- | bfd/peicode.h | 4 |
7 files changed, 37 insertions, 25 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index d860c58..72d2896 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,19 @@ +2000-04-13 Alan Modra <alan@linuxcare.com.au> + + * elf32-hppa.h: Update copyright date. + + * elf32-fr30.c (fr30_elf_i20_reloc): Don't use U suffix. + * elf32-mips.c (_bfd_mips_elf_relocate_section): And here. + + * elf32-d30v.c (MAX32): Don't use LL suffix. + (MIN32): Define in terms of MAX32. + (bfd_elf_d30v_reloc): Make relocation a bfd_signed_vma. + + * coff-a29k.c (SIGN_EXTEND_HWORD): Replace with more concise + expression. + + * peicode.h (pe_ILF_build_a_bfd): Remove UL from hex constants. + 2000-04-12 Alan Modra <alan@linuxcare.com.au> * dep-in.sed: Match space before file name, not after. diff --git a/bfd/coff-a29k.c b/bfd/coff-a29k.c index 0374b20..26d3c64 100644 --- a/bfd/coff-a29k.c +++ b/bfd/coff-a29k.c @@ -1,5 +1,5 @@ /* BFD back-end for AMD 29000 COFF binaries. - Copyright 1990, 91, 92, 93, 94, 95, 97, 98, 1999 + Copyright 1990, 91, 92, 93, 94, 95, 97, 98, 99, 2000 Free Software Foundation, Inc. Contributed by David Wood at New York University 7/8/91. @@ -43,9 +43,9 @@ static boolean coff_a29k_adjust_symndx #define INSERT_HWORD(WORD,HWORD) \ (((WORD) & 0xff00ff00) | (((HWORD) & 0xff00) << 8) | ((HWORD)& 0xff)) #define EXTRACT_HWORD(WORD) \ - ((((WORD) & 0x00ff0000) >> 8) | ((WORD)& 0xff)) + ((((WORD) & 0x00ff0000) >> 8) | ((WORD) & 0xff)) #define SIGN_EXTEND_HWORD(HWORD) \ - ((HWORD) & 0x8000 ? (HWORD)|(~0xffffL) : (HWORD)) + (((HWORD) ^ 0x8000) - 0x8000) /* Provided the symbol, returns the value reffed */ static long diff --git a/bfd/elf32-d30v.c b/bfd/elf32-d30v.c index 263b5c0..601fb95 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; diff --git a/bfd/elf32-fr30.c b/bfd/elf32-fr30.c index 6b295d3..b150ec9 100644 --- a/bfd/elf32-fr30.c +++ b/bfd/elf32-fr30.c @@ -1,5 +1,5 @@ /* FR30-specific support for 32-bit ELF. - Copyright (C) 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -275,7 +275,7 @@ fr30_elf_i20_reloc (abfd, reloc_entry, symbol, data, + symbol->section->output_offset + reloc_entry->addend; - if (relocation > ((1U << 20) - 1)) + if (relocation > (((bfd_vma) 1 << 20) - 1)) return bfd_reloc_overflow; x = bfd_get_32 (abfd, data + reloc_entry->address); diff --git a/bfd/elf32-hppa.h b/bfd/elf32-hppa.h index 915fc13..17c5e16 100644 --- a/bfd/elf32-hppa.h +++ b/bfd/elf32-hppa.h @@ -4,7 +4,8 @@ in the Stratus FTX/Golf Object File Format (SED-1762) dated February 1994. - Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc. + Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 98, 99, 2000 + Free Software Foundation, Inc. Written by: diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c index d8471bf..c1506e1 100644 --- a/bfd/elf32-mips.c +++ b/bfd/elf32-mips.c @@ -6739,8 +6739,8 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_vma low_bits; bfd_vma high_bits; - if (addend & 0x80000000u) - sign_bits = 0xffffffffu; + if (addend & ((bfd_vma) 1 << 31)) + sign_bits = ((bfd_vma) 1 << 32) - 1; else sign_bits = 0; @@ -6859,8 +6859,8 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_vma low_bits; bfd_vma high_bits; - if (value & 0x80000000u) - sign_bits = 0xffffffffu; + if (value & ((bfd_vma) 1 << 31)) + sign_bits = ((bfd_vma) 1 << 32) - 1; else sign_bits = 0; diff --git a/bfd/peicode.h b/bfd/peicode.h index 7238c78..1c58ad0 100644 --- a/bfd/peicode.h +++ b/bfd/peicode.h @@ -905,8 +905,8 @@ pe_ILF_build_a_bfd (bfd * abfd, /* XXX - treat as IMPORT_NAME ??? */ abort (); - * (unsigned int *) id4->contents = ordinal | 0x80000000UL; - * (unsigned int *) id5->contents = ordinal | 0x80000000UL; + * (unsigned int *) id4->contents = ordinal | 0x80000000; + * (unsigned int *) id5->contents = ordinal | 0x80000000; } else { |