aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-ia64.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2002-07-23 11:15:06 +0000
committerNick Clifton <nickc@redhat.com>2002-07-23 11:15:06 +0000
commit5e8d7549530ad332442a2dde84d45242608a0446 (patch)
tree3ab6ffd37bd211da43536d4308408a6389767e37 /bfd/elfxx-ia64.c
parent88ff637d20a39762ef7fe3be2812c58713fecb74 (diff)
downloadgdb-5e8d7549530ad332442a2dde84d45242608a0446.zip
gdb-5e8d7549530ad332442a2dde84d45242608a0446.tar.gz
gdb-5e8d7549530ad332442a2dde84d45242608a0446.tar.bz2
Add new bitfield 'want_p_paddr_set_to_zero'.
Set this field for HPUX IA64 port. Test this field when setting p_paddr.
Diffstat (limited to 'bfd/elfxx-ia64.c')
-rw-r--r--bfd/elfxx-ia64.c127
1 files changed, 65 insertions, 62 deletions
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index b63cfb0..6c7616b 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -2,21 +2,21 @@
Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-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
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ 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
+ 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.
+ 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. */
+ 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. */
#include "bfd.h"
#include "sysdep.h"
@@ -25,35 +25,33 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "opcode/ia64.h"
#include "elf/ia64.h"
-/*
- * THE RULES for all the stuff the linker creates --
- *
- * GOT Entries created in response to LTOFF or LTOFF_FPTR
- * relocations. Dynamic relocs created for dynamic
- * symbols in an application; REL relocs for locals
- * in a shared library.
- *
- * FPTR The canonical function descriptor. Created for local
- * symbols in applications. Descriptors for dynamic symbols
- * and local symbols in shared libraries are created by
- * ld.so. Thus there are no dynamic relocs against these
- * objects. The FPTR relocs for such _are_ passed through
- * to the dynamic relocation tables.
- *
- * FULL_PLT Created for a PCREL21B relocation against a dynamic symbol.
- * Requires the creation of a PLTOFF entry. This does not
- * require any dynamic relocations.
- *
- * PLTOFF Created by PLTOFF relocations. For local symbols, this
- * is an alternate function descriptor, and in shared libraries
- * requires two REL relocations. Note that this cannot be
- * transformed into an FPTR relocation, since it must be in
- * range of the GP. For dynamic symbols, this is a function
- * descriptor for a MIN_PLT entry, and requires one IPLT reloc.
- *
- * MIN_PLT Created by PLTOFF entries against dynamic symbols. This
- * does not reqire dynamic relocations.
- */
+/* THE RULES for all the stuff the linker creates --
+
+ GOT Entries created in response to LTOFF or LTOFF_FPTR
+ relocations. Dynamic relocs created for dynamic
+ symbols in an application; REL relocs for locals
+ in a shared library.
+
+ FPTR The canonical function descriptor. Created for local
+ symbols in applications. Descriptors for dynamic symbols
+ and local symbols in shared libraries are created by
+ ld.so. Thus there are no dynamic relocs against these
+ objects. The FPTR relocs for such _are_ passed through
+ to the dynamic relocation tables.
+
+ FULL_PLT Created for a PCREL21B relocation against a dynamic symbol.
+ Requires the creation of a PLTOFF entry. This does not
+ require any dynamic relocations.
+
+ PLTOFF Created by PLTOFF relocations. For local symbols, this
+ is an alternate function descriptor, and in shared libraries
+ requires two REL relocations. Note that this cannot be
+ transformed into an FPTR relocation, since it must be in
+ range of the GP. For dynamic symbols, this is a function
+ descriptor for a MIN_PLT entry, and requires one IPLT reloc.
+
+ MIN_PLT Created by PLTOFF entries against dynamic symbols. This
+ does not reqire dynamic relocations. */
#define USE_RELA /* we want RELA relocs, not REL */
@@ -140,7 +138,7 @@ struct elfNN_ia64_link_hash_entry
struct elfNN_ia64_link_hash_table
{
- /* The main hash table */
+ /* The main hash table. */
struct elf_link_hash_table root;
asection *got_sec; /* the linkage table section (or NULL) */
@@ -327,7 +325,7 @@ static void elfNN_hpux_post_process_headers
boolean elfNN_hpux_backend_section_from_bfd_section
PARAMS ((bfd *abfd, asection *sec, int *retval));
-/* ia64-specific relocation */
+/* ia64-specific relocation. */
/* Perform a relocation. Not much to do here as all the hard work is
done in elfNN_ia64_final_link_relocate. */
@@ -461,7 +459,7 @@ static unsigned char elf_code_to_howto_index[R_IA64_MAX_RELOC_CODE + 1];
/* Given a BFD reloc type, return the matching HOWTO structure. */
-static reloc_howto_type*
+static reloc_howto_type *
lookup_howto (rtype)
unsigned int rtype;
{
@@ -1087,24 +1085,22 @@ elfNN_ia64_fake_sections (abfd, hdr, sec)
else if (strcmp (name, ".HP.opt_annot") == 0)
hdr->sh_type = SHT_IA_64_HP_OPT_ANOT;
else if (strcmp (name, ".reloc") == 0)
- /*
- * This is an ugly, but unfortunately necessary hack that is
- * needed when producing EFI binaries on IA-64. It tells
- * elf.c:elf_fake_sections() not to consider ".reloc" as a section
- * containing ELF relocation info. We need this hack in order to
- * be able to generate ELF binaries that can be translated into
- * EFI applications (which are essentially COFF objects). Those
- * files contain a COFF ".reloc" section inside an ELFNN object,
- * which would normally cause BFD to segfault because it would
- * attempt to interpret this section as containing relocation
- * entries for section "oc". With this hack enabled, ".reloc"
- * will be treated as a normal data section, which will avoid the
- * segfault. However, you won't be able to create an ELFNN binary
- * with a section named "oc" that needs relocations, but that's
- * the kind of ugly side-effects you get when detecting section
- * types based on their names... In practice, this limitation is
- * unlikely to bite.
- */
+ /* This is an ugly, but unfortunately necessary hack that is
+ needed when producing EFI binaries on IA-64. It tells
+ elf.c:elf_fake_sections() not to consider ".reloc" as a section
+ containing ELF relocation info. We need this hack in order to
+ be able to generate ELF binaries that can be translated into
+ EFI applications (which are essentially COFF objects). Those
+ files contain a COFF ".reloc" section inside an ELFNN object,
+ which would normally cause BFD to segfault because it would
+ attempt to interpret this section as containing relocation
+ entries for section "oc". With this hack enabled, ".reloc"
+ will be treated as a normal data section, which will avoid the
+ segfault. However, you won't be able to create an ELFNN binary
+ with a section named "oc" that needs relocations, but that's
+ the kind of ugly side-effects you get when detecting section
+ types based on their names... In practice, this limitation is
+ unlikely to bite. */
hdr->sh_type = SHT_PROGBITS;
if (sec->flags & SEC_SMALL_DATA)
@@ -1510,6 +1506,8 @@ elfNN_ia64_dynamic_symbol_p (h, info)
case STV_INTERNAL:
case STV_HIDDEN:
return false;
+ default:
+ break;
}
if (h->root.type == bfd_link_hash_undefweak
@@ -4796,6 +4794,9 @@ elfNN_hpux_backend_section_from_bfd_section (abfd, sec, retval)
#undef elf_backend_section_from_bfd_section
#define elf_backend_section_from_bfd_section elfNN_hpux_backend_section_from_bfd_section
+#undef elf_backend_want_p_paddr_set_to_zero
+#define elf_backend_want_p_paddr_set_to_zero 1
+
#undef ELF_MAXPAGESIZE
#define ELF_MAXPAGESIZE 0x1000 /* 1K */
@@ -4803,3 +4804,5 @@ elfNN_hpux_backend_section_from_bfd_section (abfd, sec, retval)
#define elfNN_bed elfNN_ia64_hpux_bed
#include "elfNN-target.h"
+
+#undef elf_backend_want_p_paddr_set_to_zero