+2002-02-18 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * elf-hppa.h (elf_hppa_reloc_final_type): New function stripped
+ from _bfd_elf_hppa_gen_reloc_type.
+ (_bfd_elf_hppa_gen_reloc_type): Remove duplicate prototype.
+ * elf32-hppa.h (elf32_hppa_reloc_final_type): Add protptype.
+ * elf32-hppa.c: Include elf32-hppa.h before elf-hppa.h.
+ * elf64-hppa.h (elf64_hppa_reloc_final_type): Add protptype.
+
2002-02-17 Hans-Peter Nilsson <hp@bitrange.com>
* mmo.c: Correct and improve comments.
/* Common code for PA ELF implementations.
- Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#define ELF_R_TYPE(X) ELF64_R_TYPE(X)
#define ELF_R_SYM(X) ELF64_R_SYM(X)
#define elf_hppa_internal_shdr Elf64_Internal_Shdr
+#define elf_hppa_reloc_final_type elf64_hppa_reloc_final_type
#define _bfd_elf_hppa_gen_reloc_type _bfd_elf64_hppa_gen_reloc_type
#define elf_hppa_relocate_section elf64_hppa_relocate_section
#define bfd_elf_bfd_final_link bfd_elf64_bfd_final_link
#define ELF_R_TYPE(X) ELF32_R_TYPE(X)
#define ELF_R_SYM(X) ELF32_R_SYM(X)
#define elf_hppa_internal_shdr Elf32_Internal_Shdr
+#define elf_hppa_reloc_final_type elf32_hppa_reloc_final_type
#define _bfd_elf_hppa_gen_reloc_type _bfd_elf32_hppa_gen_reloc_type
#define elf_hppa_relocate_section elf32_hppa_relocate_section
#define bfd_elf_bfd_final_link bfd_elf32_bfd_final_link
#define elf_hppa_final_link elf32_hppa_final_link
#endif
-elf_hppa_reloc_type ** _bfd_elf_hppa_gen_reloc_type
- PARAMS ((bfd *, elf_hppa_reloc_type, int, unsigned int, int, asymbol *));
-
static void elf_hppa_info_to_howto
PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
#define OFFSET_14R_FROM_21L 4
#define OFFSET_14F_FROM_21L 5
-/* Return one (or more) BFD relocations which implement the base
- relocation with modifications based on format and field. */
+/* Return the final relocation type for the given base type, instruction
+ format, and field selector. */
-elf_hppa_reloc_type **
-_bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym)
+elf_hppa_reloc_type
+elf_hppa_reloc_final_type (abfd, base_type, format, field)
bfd *abfd;
elf_hppa_reloc_type base_type;
int format;
unsigned int field;
- int ignore ATTRIBUTE_UNUSED;
- asymbol *sym ATTRIBUTE_UNUSED;
{
- elf_hppa_reloc_type *finaltype;
- elf_hppa_reloc_type **final_types;
- bfd_size_type amt = sizeof (elf_hppa_reloc_type *) * 2;
-
- /* Allocate slots for the BFD relocation. */
- final_types = (elf_hppa_reloc_type **) bfd_alloc (abfd, amt);
- if (final_types == NULL)
- return NULL;
-
- /* Allocate space for the relocation itself. */
- amt = sizeof (elf_hppa_reloc_type);
- finaltype = (elf_hppa_reloc_type *) bfd_alloc (abfd, amt);
- if (finaltype == NULL)
- return NULL;
-
- /* Some reasonable defaults. */
- final_types[0] = finaltype;
- final_types[1] = NULL;
-
-#define final_type finaltype[0]
-
- final_type = base_type;
+ elf_hppa_reloc_type final_type = base_type;
/* Just a tangle of nested switch statements to deal with the braindamage
that a different field selector means a completely different relocation
final_type = R_PARISC_PLABEL14R;
break;
default:
- return NULL;
+ return R_PARISC_NONE;
}
break;
final_type = R_PARISC_DIR17R;
break;
default:
- return NULL;
+ return R_PARISC_NONE;
}
break;
final_type = R_PARISC_PLABEL21L;
break;
default:
- return NULL;
+ return R_PARISC_NONE;
}
break;
final_type = R_PARISC_PLABEL32;
break;
default:
- return NULL;
+ return R_PARISC_NONE;
}
break;
final_type = R_PARISC_FPTR64;
break;
default:
- return NULL;
+ return R_PARISC_NONE;
}
break;
default:
- return NULL;
+ return R_PARISC_NONE;
}
break;
final_type = base_type + OFFSET_14F_FROM_21L;
break;
default:
- return NULL;
+ return R_PARISC_NONE;
}
break;
final_type = base_type;
break;
default:
- return NULL;
+ return R_PARISC_NONE;
}
break;
default:
- return NULL;
+ return R_PARISC_NONE;
}
break;
final_type = R_PARISC_PCREL12F;
break;
default:
- return NULL;
+ return R_PARISC_NONE;
}
break;
final_type = R_PARISC_PCREL14F;
break;
default:
- return NULL;
+ return R_PARISC_NONE;
}
break;
final_type = R_PARISC_PCREL17F;
break;
default:
- return NULL;
+ return R_PARISC_NONE;
}
break;
final_type = R_PARISC_PCREL21L;
break;
default:
- return NULL;
+ return R_PARISC_NONE;
}
break;
final_type = R_PARISC_PCREL22F;
break;
default:
- return NULL;
+ return R_PARISC_NONE;
}
break;
default:
- return NULL;
+ return R_PARISC_NONE;
}
break;
break;
default:
- return NULL;
+ return R_PARISC_NONE;
}
+ return final_type;
+}
+
+/* Return one (or more) BFD relocations which implement the base
+ relocation with modifications based on format and field. */
+
+elf_hppa_reloc_type **
+_bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym)
+ bfd *abfd;
+ elf_hppa_reloc_type base_type;
+ int format;
+ unsigned int field;
+ int ignore ATTRIBUTE_UNUSED;
+ asymbol *sym ATTRIBUTE_UNUSED;
+{
+ elf_hppa_reloc_type *finaltype;
+ elf_hppa_reloc_type **final_types;
+ bfd_size_type amt = sizeof (elf_hppa_reloc_type *) * 2;
+
+ /* Allocate slots for the BFD relocation. */
+ final_types = (elf_hppa_reloc_type **) bfd_alloc (abfd, amt);
+ if (final_types == NULL)
+ return NULL;
+
+ /* Allocate space for the relocation itself. */
+ amt = sizeof (elf_hppa_reloc_type);
+ finaltype = (elf_hppa_reloc_type *) bfd_alloc (abfd, amt);
+ if (finaltype == NULL)
+ return NULL;
+
+ /* Some reasonable defaults. */
+ final_types[0] = finaltype;
+ final_types[1] = NULL;
+
+ *finaltype = elf_hppa_reloc_final_type (abfd, base_type, format, field);
+
return final_types;
}
#include "libhppa.h"
#include "elf32-hppa.h"
#define ARCH_SIZE 32
-#include "elf-hppa.h"
#include "elf32-hppa.h"
+#include "elf-hppa.h"
/* In order to gain some understanding of code in this file without
knowing all the intricate details of the linker, note the
boolean elf32_hppa_build_stubs
PARAMS ((struct bfd_link_info *));
+elf_hppa_reloc_type elf32_hppa_reloc_final_type
+ PARAMS ((bfd *, elf_hppa_reloc_type, int, unsigned int));
+
extern elf_hppa_reloc_type ** _bfd_elf32_hppa_gen_reloc_type
PARAMS ((bfd *, elf_hppa_reloc_type, int, unsigned int, int, asymbol *));
/* ELF64/HPPA support
- Copyright 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#include "libhppa.h"
#include "elf/hppa.h"
+elf_hppa_reloc_type elf64_hppa_reloc_final_type
+ PARAMS ((bfd *, elf_hppa_reloc_type, int, unsigned int));
+
extern elf_hppa_reloc_type ** _bfd_elf64_hppa_gen_reloc_type
PARAMS ((bfd *, elf_hppa_reloc_type, int, unsigned int, int, asymbol *));
+2002-02-18 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * config/tc-hppa.c (hppa_fix_adjustable): Don't adjust final types
+ that implicitly use LR and RR selectors.
+
2002-02-16 Nick Clifton <nickc@cambridge.redhat.com>
* doc/as.texinfo (Machine Dependencies): Fix typo: MMIX used
/* tc-hppa.c -- Assemble for the PA
- Copyright 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+ Copyright 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+ 2002 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
#if TARGET_ARCH_SIZE == 64
/* How to generate a relocation. */
#define hppa_gen_reloc_type _bfd_elf64_hppa_gen_reloc_type
+#define elf_hppa_reloc_final_type elf64_hppa_reloc_final_type
#else
#define hppa_gen_reloc_type _bfd_elf32_hppa_gen_reloc_type
+#define elf_hppa_reloc_final_type elf32_hppa_reloc_final_type
#endif
/* ELF objects can have versions, but apparently do not have anywhere
hppa_fix_adjustable (fixp)
fixS *fixp;
{
+ reloc_type code;
struct hppa_fix_struct *hppa_fix;
hppa_fix = (struct hppa_fix_struct *) fixp->tc_fix_data;
#endif
#ifdef OBJ_ELF
- if (fixp->fx_r_type == (int) R_PARISC_GNU_VTINHERIT
- || fixp->fx_r_type == (int) R_PARISC_GNU_VTENTRY)
- return 0;
+ /* LR/RR selectors are implicitly used for a number of different relocation
+ types. We must ensure that none of these types are adjusted (see below)
+ even if they occur with a different selector. */
+ code = elf_hppa_reloc_final_type (stdoutput, fixp->fx_r_type,
+ hppa_fix->fx_r_format,
+ hppa_fix->fx_r_field);
+
+ switch (code)
+ {
+ /* Relocation types which use e_lrsel. */
+ case R_PARISC_DIR21L:
+ case R_PARISC_DLTIND21L:
+ case R_PARISC_DLTREL21L:
+ case R_PARISC_DPREL21L:
+ case R_PARISC_LTOFF_FPTR21L:
+ case R_PARISC_LTOFF_TP21L:
+ case R_PARISC_PCREL21L:
+ case R_PARISC_PLABEL21L:
+ case R_PARISC_PLTOFF21L:
+
+ /* Relocation types which use e_rrsel. */
+ case R_PARISC_DIR14R:
+ case R_PARISC_DIR14DR:
+ case R_PARISC_DIR14WR:
+ case R_PARISC_DIR17R:
+ case R_PARISC_DLTIND14R:
+ case R_PARISC_DLTIND14DR:
+ case R_PARISC_DLTIND14WR:
+ case R_PARISC_DLTREL14R:
+ case R_PARISC_DLTREL14DR:
+ case R_PARISC_DLTREL14WR:
+ case R_PARISC_DPREL14R:
+ case R_PARISC_DPREL14DR:
+ case R_PARISC_DPREL14WR:
+ case R_PARISC_PCREL14R:
+ case R_PARISC_PCREL17R:
+ case R_PARISC_PLABEL14R:
+ case R_PARISC_LTOFF_FPTR14R:
+ case R_PARISC_LTOFF_FPTR14DR:
+ case R_PARISC_LTOFF_FPTR14WR:
+ case R_PARISC_LTOFF_TP14R:
+ case R_PARISC_LTOFF_TP14DR:
+ case R_PARISC_LTOFF_TP14WR:
+
+ /* Other types that we reject for reduction. */
+ case R_PARISC_GNU_VTENTRY:
+ case R_PARISC_GNU_VTINHERIT:
+ return 0;
+ default:
+ break;
+ }
#endif
if (fixp->fx_addsy && (S_IS_EXTERNAL (fixp->fx_addsy)
+2002-02-18 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * gas/hppa/reloc/reloc.exp (labelopbug.s): Change test to suit
+ hppa_fix_adjustable change.
+
2002-02-09 Richard Henderson <rth@redhat.com>
* gas/alpha/elf-reloc-5.s, gas/alpha/elf-reloc-5.d: New.
-# Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
+# Copyright 1993, 1996, 1997, 2002 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
if [gas_test_old "labelopbug.s" "" "Local label as operand (part 1)"] {
objdump_start_no_subdir "a.out" "-r"
- # Check to make sure we handle difference of local lables as an operand
- # to a non-branching instruction correctly.
- while 1 {
- expect {
- -re "^0+2c\[^\n\]*0x0+24\[^\n\]*\n"
- { set x [expr $x+1] }
- -re "^0+30\[^\n\]*0x0+24\[^\n\]*\n"
- { set x [expr $x+1] }
- -re "\[^\n\]*\n" { }
- timeout { perror "timeout\n"; break }
- eof { break }
- }
+ # Check to make sure we handle difference of local labels as an operand
+ # to a non-branching instruction correctly. On hppa elf targets, the
+ # R_PARISC_DIR21 and R_PARISC_DIR14R relocations are done with LR and
+ # RR selectors, respectively. As a result, we can't reduce these to
+ # section offsets without risking incorrect rounding. So, we just
+ # check to see if the label hasn't been reduced.
+ if {[istarget hppa*64*-*-*]
+ || [istarget hppa*-*-*elf*] || [istarget hppa*-*-linux*]} then {
+ while 1 {
+ expect {
+ -re "^0+2c\[^\n\]*L.0002\[^\n\]*\n"
+ { set x [expr $x+1] }
+ -re "^0+30\[^\n\]*L.0002\[^\n\]*\n"
+ { set x [expr $x+1] }
+ -re "\[^\n\]*\n" { }
+ timeout { perror "timeout\n"; break }
+ eof { break }
+ }
+ }
+ } else {
+ while 1 {
+ expect {
+ -re "^0+2c\[^\n\]*0x0+24\[^\n\]*\n"
+ { set x [expr $x+1] }
+ -re "^0+30\[^\n\]*0x0+24\[^\n\]*\n"
+ { set x [expr $x+1] }
+ -re "\[^\n\]*\n" { }
+ timeout { perror "timeout\n"; break }
+ eof { break }
+ }
+ }
}
# This was intended to do any cleanup necessary. It kinda looks like it
+2002-02-18 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * ld-selective/selective.exp: Link against libgcc on
+ hppa*-*-linux* targets.
+
2002-02-17 Hans-Peter Nilsson <hp@bitrange.com>
* ld-mmix/b-nosym.d, ld-mmix/sec-6.d: Tweak for change in symbol
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
if [istarget v850*-*-elf] {
set objfile "$objfile -L ../gcc -lgcc"
}
-
+
# ARM targets need libgcc.a in THUMB mode so that __call_via_r3 is provided
if {[istarget arm-*-*] || [istarget xscale-*-*]} {
set objfile "$objfile -L ../gcc -lgcc"
}
-
+
+ # HPPA linux targets need libgcc.a for millicode routines ($$dyncall).
+ if [istarget hppa*-*-linux*] {
+ catch "exec $CC -print-libgcc-file-name" libgcc
+ set objfile "$objfile $libgcc"
+ }
+
# m6811/m6812 code has references to soft registers.
if {[istarget m6811-*-*] || [istarget m6812-*-*]} {
set objfile "$objfile --defsym _.frame=0 --defsym _.d1=0"
}
}
- # Check each mandated symbol and optionally mandated values.
+ # Check each mandated symbol and optionally mandated values.
foreach mustsym $mustsyms {
if { [llength [concat $mustsym]] == 1 } {
if { ![info exists nm_output($mustsym)] } {