This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
split out ppc64 defs from elf/ppc.h
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com
- Date: Thu, 16 Jan 2003 14:42:51 +1030
- Subject: split out ppc64 defs from elf/ppc.h
This patch splits out the PowerPC64 relocation types from include/elf/ppc.h
and puts them in a new file, because
a) It's cleaner. ppc64 doesn't want ppc32 specific types and vice versa.
b) I wanted readelf to consistenly dump out R_PPC64_* for ppc64 relocs
rather than a mix of R_PPC_* and R_PPC64_*.
c) Adding consecutively numbered TLS relocs for ppc64 ran into R_PPC_EMB_*
reloc numbers. I could have split them into two blocks, but that's
messy, and ppc32 will need a bunch of different TLS relocs, further
filling the available reloc space.
Additionally, I've renamed R_PPC64_ADDR30 to R_PPC64_REL30 because the
name is inconsistent with the definition; It's a relative reloc, not an
absolute one. I'm not aware of anything that uses it, so I don't think
there's a need for a backwards compatibility define. If there is, we
can add that later. Renaming the reloc showed one place in elf64-ppc.c
where it was handled wrongly..
include/elf/ChangeLog
* ppc.h: Split out ppc64 definitions to..
* pcc64.h: ..here. New file.
(R_PPC64_REL30): Rename from R_PPC64_ADDR30.
bfd/ChangeLog
* elf64-ppc.c: Include elf/ppc64.h rather than elf/ppc.h.
(R_PPC_*): Rename all occurrences to R_PPC64_*.
(R_PPC64_ADDR30): Rename all occurrences to R_PPC64_REL30.
(enum elf_ppc_reloc_type): Ditto to enum elf_ppc64_reloc_type.
(ppc64_elf_gc_sweep_hook): Handle R_PPC64_REL30 along with other
relative relocs, not with absolute ones.
* Makefile.am: Run "make dep-am".
* Makefile.in: Regenerate.
* po/SRC-POTFILES.in: Regenerate.
binutils/ChangeLog
* readelf.c: Include elf/ppc64.h.
(dump_relocations <EM_PPC64>): Use elf_ppc64_reloc_type.
* Makefile.am: Run "make dep-am".
* Makefile.in: Regenerate.
And some more housekeeping.
opcodes/ChangeLog
* Makefile.am: Run "make dep-am".
* Makefile.in: Regenerate.
* po/POTFILES.in: Regenerate.
gas/ChangeLog
* Makefile.am: Run "make dep-am".
* Makefile.in: Regenerate.
* po/POTFILES.in: Regenerate.
ld/ChangeLog
* Makefile.in: Regenerate.
Committed to mainline.
Index: include/elf/ppc.h
===================================================================
RCS file: /cvs/src/src/include/elf/ppc.h,v
retrieving revision 1.8
diff -u -p -r1.8 ppc.h
--- include/elf/ppc.h 12 Feb 2002 06:31:24 -0000 1.8
+++ include/elf/ppc.h 16 Jan 2003 02:23:08 -0000
@@ -70,39 +70,6 @@ START_RELOC_NUMBERS (elf_ppc_reloc_type)
RELOC_NUMBER (R_PPC_SECTOFF_HA, 36)
RELOC_NUMBER (R_PPC_ADDR30, 37)
-/* The following relocs are from the 64-bit PowerPC ELF ABI. */
- RELOC_NUMBER (R_PPC64_ADDR64, 38)
- RELOC_NUMBER (R_PPC64_ADDR16_HIGHER, 39)
- RELOC_NUMBER (R_PPC64_ADDR16_HIGHERA, 40)
- RELOC_NUMBER (R_PPC64_ADDR16_HIGHEST, 41)
- RELOC_NUMBER (R_PPC64_ADDR16_HIGHESTA, 42)
- RELOC_NUMBER (R_PPC64_UADDR64, 43)
- RELOC_NUMBER (R_PPC64_REL64, 44)
- RELOC_NUMBER (R_PPC64_PLT64, 45)
- RELOC_NUMBER (R_PPC64_PLTREL64, 46)
- RELOC_NUMBER (R_PPC64_TOC16, 47)
- RELOC_NUMBER (R_PPC64_TOC16_LO, 48)
- RELOC_NUMBER (R_PPC64_TOC16_HI, 49)
- RELOC_NUMBER (R_PPC64_TOC16_HA, 50)
- RELOC_NUMBER (R_PPC64_TOC, 51)
- RELOC_NUMBER (R_PPC64_PLTGOT16, 52)
- RELOC_NUMBER (R_PPC64_PLTGOT16_LO, 53)
- RELOC_NUMBER (R_PPC64_PLTGOT16_HI, 54)
- RELOC_NUMBER (R_PPC64_PLTGOT16_HA, 55)
-
-/* The following relocs were added in the 64-bit PowerPC ELF ABI revision 1.2. */
- RELOC_NUMBER (R_PPC64_ADDR16_DS, 56)
- RELOC_NUMBER (R_PPC64_ADDR16_LO_DS, 57)
- RELOC_NUMBER (R_PPC64_GOT16_DS, 58)
- RELOC_NUMBER (R_PPC64_GOT16_LO_DS, 59)
- RELOC_NUMBER (R_PPC64_PLT16_LO_DS, 60)
- RELOC_NUMBER (R_PPC64_SECTOFF_DS, 61)
- RELOC_NUMBER (R_PPC64_SECTOFF_LO_DS, 62)
- RELOC_NUMBER (R_PPC64_TOC16_DS, 63)
- RELOC_NUMBER (R_PPC64_TOC16_LO_DS, 64)
- RELOC_NUMBER (R_PPC64_PLTGOT16_DS, 65)
- RELOC_NUMBER (R_PPC64_PLTGOT16_LO_DS, 66)
-
/* The remaining relocs are from the Embedded ELF ABI, and are not
in the SVR4 ELF ABI. */
RELOC_NUMBER (R_PPC_EMB_NADDR32, 101)
@@ -132,51 +99,6 @@ START_RELOC_NUMBERS (elf_ppc_reloc_type)
END_RELOC_NUMBERS (R_PPC_max)
-/* Aliases for R_PPC64-relocs. */
-#define R_PPC64_NONE R_PPC_NONE
-#define R_PPC64_ADDR32 R_PPC_ADDR32
-#define R_PPC64_ADDR24 R_PPC_ADDR24
-#define R_PPC64_ADDR16 R_PPC_ADDR16
-#define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO
-#define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI
-#define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA
-#define R_PPC64_ADDR14 R_PPC_ADDR14
-#define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN
-#define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN
-#define R_PPC64_REL24 R_PPC_REL24
-#define R_PPC64_REL14 R_PPC_REL14
-#define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN
-#define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN
-#define R_PPC64_GOT16 R_PPC_GOT16
-#define R_PPC64_GOT16_LO R_PPC_GOT16_LO
-#define R_PPC64_GOT16_HI R_PPC_GOT16_HI
-#define R_PPC64_GOT16_HA R_PPC_GOT16_HA
-#define R_PPC64_COPY R_PPC_COPY
-#define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT
-#define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT
-#define R_PPC64_RELATIVE R_PPC_RELATIVE
-#define R_PPC64_UADDR32 R_PPC_UADDR32
-#define R_PPC64_UADDR16 R_PPC_UADDR16
-#define R_PPC64_REL32 R_PPC_REL32
-#define R_PPC64_PLT32 R_PPC_PLT32
-#define R_PPC64_PLTREL32 R_PPC_PLTREL32
-#define R_PPC64_PLT16_LO R_PPC_PLT16_LO
-#define R_PPC64_PLT16_HI R_PPC_PLT16_HI
-#define R_PPC64_PLT16_HA R_PPC_PLT16_HA
-#define R_PPC64_SECTOFF R_PPC_SECTOFF
-#define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO
-#define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI
-#define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA
-#define R_PPC64_ADDR30 R_PPC_ADDR30
-#define R_PPC64_GNU_VTINHERIT R_PPC_GNU_VTINHERIT
-#define R_PPC64_GNU_VTENTRY R_PPC_GNU_VTENTRY
-
-/* Specify the start of the .glink section. */
-#define DT_PPC64_GLINK DT_LOPROC
-
-/* Specify the start and size of the .opd section. */
-#define DT_PPC64_OPD (DT_LOPROC + 1)
-#define DT_PPC64_OPDSZ (DT_LOPROC + 2)
/* Processor specific flags for the ELF header e_flags field. */
Index: include/elf/ppc64.h
===================================================================
RCS file: include/elf/ppc64.h
diff -N include/elf/ppc64.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ include/elf/ppc64.h 16 Jan 2003 02:34:23 -0000
@@ -0,0 +1,111 @@
+/* PPC64 ELF support for BFD.
+ Copyright 2003 Free Software Foundation, Inc.
+
+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 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. */
+
+#ifndef _ELF_PPC64_H
+#define _ELF_PPC64_H
+
+#include "elf/reloc-macros.h"
+
+/* Relocations. */
+START_RELOC_NUMBERS (elf_ppc64_reloc_type)
+ RELOC_NUMBER (R_PPC64_NONE, 0)
+ RELOC_NUMBER (R_PPC64_ADDR32, 1)
+ RELOC_NUMBER (R_PPC64_ADDR24, 2)
+ RELOC_NUMBER (R_PPC64_ADDR16, 3)
+ RELOC_NUMBER (R_PPC64_ADDR16_LO, 4)
+ RELOC_NUMBER (R_PPC64_ADDR16_HI, 5)
+ RELOC_NUMBER (R_PPC64_ADDR16_HA, 6)
+ RELOC_NUMBER (R_PPC64_ADDR14, 7)
+ RELOC_NUMBER (R_PPC64_ADDR14_BRTAKEN, 8)
+ RELOC_NUMBER (R_PPC64_ADDR14_BRNTAKEN, 9)
+ RELOC_NUMBER (R_PPC64_REL24, 10)
+ RELOC_NUMBER (R_PPC64_REL14, 11)
+ RELOC_NUMBER (R_PPC64_REL14_BRTAKEN, 12)
+ RELOC_NUMBER (R_PPC64_REL14_BRNTAKEN, 13)
+ RELOC_NUMBER (R_PPC64_GOT16, 14)
+ RELOC_NUMBER (R_PPC64_GOT16_LO, 15)
+ RELOC_NUMBER (R_PPC64_GOT16_HI, 16)
+ RELOC_NUMBER (R_PPC64_GOT16_HA, 17)
+ /* 18 unused. 32-bit reloc is R_PPC_PLTREL24. */
+ RELOC_NUMBER (R_PPC64_COPY, 19)
+ RELOC_NUMBER (R_PPC64_GLOB_DAT, 20)
+ RELOC_NUMBER (R_PPC64_JMP_SLOT, 21)
+ RELOC_NUMBER (R_PPC64_RELATIVE, 22)
+ /* 23 unused. 32-bit reloc is R_PPC_LOCAL24PC. */
+ RELOC_NUMBER (R_PPC64_UADDR32, 24)
+ RELOC_NUMBER (R_PPC64_UADDR16, 25)
+ RELOC_NUMBER (R_PPC64_REL32, 26)
+ RELOC_NUMBER (R_PPC64_PLT32, 27)
+ RELOC_NUMBER (R_PPC64_PLTREL32, 28)
+ RELOC_NUMBER (R_PPC64_PLT16_LO, 29)
+ RELOC_NUMBER (R_PPC64_PLT16_HI, 30)
+ RELOC_NUMBER (R_PPC64_PLT16_HA, 31)
+ /* 32 unused. 32-bit reloc is R_PPC_SDAREL16. */
+ RELOC_NUMBER (R_PPC64_SECTOFF, 33)
+ RELOC_NUMBER (R_PPC64_SECTOFF_LO, 34)
+ RELOC_NUMBER (R_PPC64_SECTOFF_HI, 35)
+ RELOC_NUMBER (R_PPC64_SECTOFF_HA, 36)
+ RELOC_NUMBER (R_PPC64_REL30, 37)
+ RELOC_NUMBER (R_PPC64_ADDR64, 38)
+ RELOC_NUMBER (R_PPC64_ADDR16_HIGHER, 39)
+ RELOC_NUMBER (R_PPC64_ADDR16_HIGHERA, 40)
+ RELOC_NUMBER (R_PPC64_ADDR16_HIGHEST, 41)
+ RELOC_NUMBER (R_PPC64_ADDR16_HIGHESTA, 42)
+ RELOC_NUMBER (R_PPC64_UADDR64, 43)
+ RELOC_NUMBER (R_PPC64_REL64, 44)
+ RELOC_NUMBER (R_PPC64_PLT64, 45)
+ RELOC_NUMBER (R_PPC64_PLTREL64, 46)
+ RELOC_NUMBER (R_PPC64_TOC16, 47)
+ RELOC_NUMBER (R_PPC64_TOC16_LO, 48)
+ RELOC_NUMBER (R_PPC64_TOC16_HI, 49)
+ RELOC_NUMBER (R_PPC64_TOC16_HA, 50)
+ RELOC_NUMBER (R_PPC64_TOC, 51)
+ RELOC_NUMBER (R_PPC64_PLTGOT16, 52)
+ RELOC_NUMBER (R_PPC64_PLTGOT16_LO, 53)
+ RELOC_NUMBER (R_PPC64_PLTGOT16_HI, 54)
+ RELOC_NUMBER (R_PPC64_PLTGOT16_HA, 55)
+
+/* The following relocs were added in the 64-bit PowerPC ELF ABI
+ revision 1.2. */
+ RELOC_NUMBER (R_PPC64_ADDR16_DS, 56)
+ RELOC_NUMBER (R_PPC64_ADDR16_LO_DS, 57)
+ RELOC_NUMBER (R_PPC64_GOT16_DS, 58)
+ RELOC_NUMBER (R_PPC64_GOT16_LO_DS, 59)
+ RELOC_NUMBER (R_PPC64_PLT16_LO_DS, 60)
+ RELOC_NUMBER (R_PPC64_SECTOFF_DS, 61)
+ RELOC_NUMBER (R_PPC64_SECTOFF_LO_DS, 62)
+ RELOC_NUMBER (R_PPC64_TOC16_DS, 63)
+ RELOC_NUMBER (R_PPC64_TOC16_LO_DS, 64)
+ RELOC_NUMBER (R_PPC64_PLTGOT16_DS, 65)
+ RELOC_NUMBER (R_PPC64_PLTGOT16_LO_DS, 66)
+
+ /* These are GNU extensions to enable C++ vtable garbage collection. */
+ RELOC_NUMBER (R_PPC64_GNU_VTINHERIT, 253)
+ RELOC_NUMBER (R_PPC64_GNU_VTENTRY, 254)
+
+END_RELOC_NUMBERS (R_PPC64_max)
+
+/* Specify the start of the .glink section. */
+#define DT_PPC64_GLINK DT_LOPROC
+
+/* Specify the start and size of the .opd section. */
+#define DT_PPC64_OPD (DT_LOPROC + 1)
+#define DT_PPC64_OPDSZ (DT_LOPROC + 2)
+
+#endif /* _ELF_PPC64_H */
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.77
diff -u -p -r1.77 elf64-ppc.c
--- bfd/elf64-ppc.c 9 Jan 2003 22:51:37 -0000 1.77
+++ bfd/elf64-ppc.c 16 Jan 2003 02:22:34 -0000
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suit
#include "bfdlink.h"
#include "libbfd.h"
#include "elf-bfd.h"
-#include "elf/ppc.h"
+#include "elf/ppc64.h"
#include "elf64-ppc.h"
static void ppc_howto_init
@@ -126,7 +126,7 @@ static bfd_boolean ppc64_elf_merge_priva
#define ONES(n) (((bfd_vma) 1 << ((n) - 1) << 1) - 1)
/* Relocation HOWTO's. */
-static reloc_howto_type *ppc64_elf_howto_table[(int) R_PPC_max];
+static reloc_howto_type *ppc64_elf_howto_table[(int) R_PPC64_max];
static reloc_howto_type ppc64_elf_howto_raw[] = {
/* This reloc does nothing. */
@@ -667,9 +667,8 @@ static reloc_howto_type ppc64_elf_howto_
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
- /* Like R_PPC64_REL24 without touching the two least significant
- bits. Should have been named R_PPC64_REL30! */
- HOWTO (R_PPC64_ADDR30, /* type */
+ /* Like R_PPC64_REL24 without touching the two least significant bits. */
+ HOWTO (R_PPC64_REL30, /* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
30, /* bitsize */
@@ -677,7 +676,7 @@ static reloc_howto_type ppc64_elf_howto_
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_PPC64_ADDR30", /* name */
+ "R_PPC64_REL30", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0xfffffffc, /* dst_mask */
@@ -1207,7 +1206,7 @@ ppc64_elf_reloc_type_lookup (abfd, code)
bfd *abfd ATTRIBUTE_UNUSED;
bfd_reloc_code_real_type code;
{
- enum elf_ppc_reloc_type ppc_reloc = R_PPC_NONE;
+ enum elf_ppc64_reloc_type ppc_reloc = R_PPC64_NONE;
if (!ppc64_elf_howto_table[R_PPC64_ADDR32])
/* Initialize howto table if needed. */
@@ -1365,7 +1364,7 @@ ppc64_elf_info_to_howto (abfd, cache_ptr
cache_ptr->howto = ppc64_elf_howto_table[type];
}
-/* Handle the R_PPC_ADDR16_HA and similar relocs. */
+/* Handle the R_PPC64_ADDR16_HA and similar relocs. */
static bfd_reloc_status_type
ppc64_elf_ha_reloc (abfd, reloc_entry, symbol, data,
@@ -1404,7 +1403,7 @@ ppc64_elf_brtaken_reloc (abfd, reloc_ent
char **error_message;
{
long insn;
- enum elf_ppc_reloc_type r_type;
+ enum elf_ppc64_reloc_type r_type;
bfd_size_type octets;
/* Disabled until we sort out how ld should choose 'y' vs 'at'. */
bfd_boolean is_power4 = FALSE;
@@ -1419,7 +1418,7 @@ ppc64_elf_brtaken_reloc (abfd, reloc_ent
octets = reloc_entry->address * bfd_octets_per_byte (abfd);
insn = bfd_get_32 (abfd, (bfd_byte *) data + octets);
insn &= ~(0x01 << 21);
- r_type = (enum elf_ppc_reloc_type) reloc_entry->howto->type;
+ r_type = (enum elf_ppc64_reloc_type) reloc_entry->howto->type;
if (r_type == R_PPC64_ADDR14_BRTAKEN
|| r_type == R_PPC64_REL14_BRTAKEN)
insn |= 0x01 << 21; /* 'y' or 't' bit, lowest bit of BO field. */
@@ -1771,7 +1770,7 @@ struct ppc_dyn_relocs
#define IS_ABSOLUTE_RELOC(RTYPE) \
((RTYPE) != R_PPC64_REL32 \
&& (RTYPE) != R_PPC64_REL64 \
- && (RTYPE) != R_PPC64_ADDR30)
+ && (RTYPE) != R_PPC64_REL30)
/* Section name for stubs is the associated section name plus this
string. */
@@ -2579,7 +2578,7 @@ ppc64_elf_check_relocs (abfd, info, sec,
{
unsigned long r_symndx;
struct elf_link_hash_entry *h;
- enum elf_ppc_reloc_type r_type;
+ enum elf_ppc64_reloc_type r_type;
r_symndx = ELF64_R_SYM (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
@@ -2587,7 +2586,7 @@ ppc64_elf_check_relocs (abfd, info, sec,
else
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info);
+ r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel->r_info);
switch (r_type)
{
/* GOT16 relocations */
@@ -2723,7 +2722,7 @@ ppc64_elf_check_relocs (abfd, info, sec,
if (opd_sym_map != NULL
&& h == NULL
&& rel + 1 < rel_end
- && ((enum elf_ppc_reloc_type) ELF64_R_TYPE ((rel + 1)->r_info)
+ && ((enum elf_ppc64_reloc_type) ELF64_R_TYPE ((rel + 1)->r_info)
== R_PPC64_TOC))
{
asection *s;
@@ -2737,8 +2736,9 @@ ppc64_elf_check_relocs (abfd, info, sec,
}
/* Fall through. */
- case R_PPC64_REL64:
+ case R_PPC64_REL30:
case R_PPC64_REL32:
+ case R_PPC64_REL64:
case R_PPC64_ADDR14:
case R_PPC64_ADDR14_BRNTAKEN:
case R_PPC64_ADDR14_BRTAKEN:
@@ -2753,7 +2753,6 @@ ppc64_elf_check_relocs (abfd, info, sec,
case R_PPC64_ADDR16_LO:
case R_PPC64_ADDR16_LO_DS:
case R_PPC64_ADDR24:
- case R_PPC64_ADDR30:
case R_PPC64_ADDR32:
case R_PPC64_UADDR16:
case R_PPC64_UADDR32:
@@ -2912,10 +2911,10 @@ ppc64_elf_gc_mark_hook (sec, info, rel,
if (h != NULL)
{
- enum elf_ppc_reloc_type r_type;
+ enum elf_ppc64_reloc_type r_type;
struct ppc_link_hash_entry *fdh;
- r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info);
+ r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel->r_info);
switch (r_type)
{
case R_PPC64_GNU_VTINHERIT:
@@ -2993,11 +2992,11 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec
for (rel = relocs; rel < relend; rel++)
{
unsigned long r_symndx;
- enum elf_ppc_reloc_type r_type;
+ enum elf_ppc64_reloc_type r_type;
struct elf_link_hash_entry *h;
r_symndx = ELF64_R_SYM (rel->r_info);
- r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info);
+ r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel->r_info);
switch (r_type)
{
case R_PPC64_GOT16:
@@ -3044,6 +3043,7 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec
}
break;
+ case R_PPC64_REL30:
case R_PPC64_REL32:
case R_PPC64_REL64:
if (r_symndx >= symtab_hdr->sh_info)
@@ -3081,7 +3081,6 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec
case R_PPC64_ADDR16_LO:
case R_PPC64_ADDR16_LO_DS:
case R_PPC64_ADDR24:
- case R_PPC64_ADDR30:
case R_PPC64_ADDR32:
case R_PPC64_ADDR64:
case R_PPC64_UADDR16:
@@ -3443,8 +3442,8 @@ ppc64_elf_adjust_dynamic_symbol (info, h
both the dynamic object and the regular object will refer to the
same memory location for the variable. */
- /* We must generate a R_PPC_COPY reloc to tell the dynamic linker to
- copy the initial value out of the dynamic object and into the
+ /* We must generate a R_PPC64_COPY reloc to tell the dynamic linker
+ to copy the initial value out of the dynamic object and into the
runtime process image. We need to remember the offset into the
.rela.bss section we are going to use. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
@@ -3599,7 +3598,7 @@ ppc64_elf_edit_opd (obfd, info)
relend = relstart + sec->reloc_count;
for (rel = relstart; rel < relend; rel++)
{
- enum elf_ppc_reloc_type r_type;
+ enum elf_ppc64_reloc_type r_type;
unsigned long r_symndx;
asection *sym_sec;
struct elf_link_hash_entry *h;
@@ -3608,7 +3607,7 @@ ppc64_elf_edit_opd (obfd, info)
/* .opd contains a regular array of 24 byte entries. We're
only interested in the reloc pointing to a function entry
point. */
- r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info);
+ r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel->r_info);
if (r_type == R_PPC64_TOC)
continue;
@@ -3623,7 +3622,7 @@ ppc64_elf_edit_opd (obfd, info)
if (rel + 1 >= relend)
continue;
- r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE ((rel + 1)->r_info);
+ r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE ((rel + 1)->r_info);
if (r_type != R_PPC64_TOC)
continue;
@@ -4914,7 +4913,7 @@ ppc64_elf_size_stubs (output_bfd, stub_b
r_type = ELF64_R_TYPE (irela->r_info);
r_indx = ELF64_R_SYM (irela->r_info);
- if (r_type >= (unsigned int) R_PPC_max)
+ if (r_type >= (unsigned int) R_PPC64_max)
{
bfd_set_error (bfd_error_bad_value);
goto error_ret_free_internal;
@@ -5312,7 +5311,7 @@ ppc64_elf_relocate_section (output_bfd,
relend = relocs + input_section->reloc_count;
for (; rel < relend; rel++)
{
- enum elf_ppc_reloc_type r_type;
+ enum elf_ppc64_reloc_type r_type;
bfd_vma offset;
bfd_vma addend;
bfd_reloc_status_type r;
@@ -5330,7 +5329,7 @@ ppc64_elf_relocate_section (output_bfd,
bfd_vma max_br_offset;
bfd_vma from;
- r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info);
+ r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rel->r_info);
r_symndx = ELF64_R_SYM (rel->r_info);
offset = rel->r_offset;
addend = rel->r_addend;
@@ -5537,8 +5536,8 @@ ppc64_elf_relocate_section (output_bfd,
continue;
case R_PPC64_NONE:
- case R_PPC_GNU_VTINHERIT:
- case R_PPC_GNU_VTENTRY:
+ case R_PPC64_GNU_VTINHERIT:
+ case R_PPC64_GNU_VTENTRY:
continue;
/* GOT16 relocations. Like an ADDR16 using the symbol's
@@ -5707,6 +5706,7 @@ ppc64_elf_relocate_section (output_bfd,
/* Relocations that may need to be propagated if this is a
dynamic object. */
+ case R_PPC64_REL30:
case R_PPC64_REL32:
case R_PPC64_REL64:
case R_PPC64_ADDR14:
@@ -5723,7 +5723,6 @@ ppc64_elf_relocate_section (output_bfd,
case R_PPC64_ADDR16_LO:
case R_PPC64_ADDR16_LO_DS:
case R_PPC64_ADDR24:
- case R_PPC64_ADDR30:
case R_PPC64_ADDR32:
case R_PPC64_ADDR64:
case R_PPC64_UADDR16:
@@ -6176,9 +6175,9 @@ static enum elf_reloc_type_class
ppc64_elf_reloc_type_class (rela)
const Elf_Internal_Rela *rela;
{
- enum elf_ppc_reloc_type r_type;
+ enum elf_ppc64_reloc_type r_type;
- r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rela->r_info);
+ r_type = (enum elf_ppc64_reloc_type) ELF64_R_TYPE (rela->r_info);
switch (r_type)
{
case R_PPC64_RELATIVE:
Index: binutils/readelf.c
===================================================================
RCS file: /cvs/src/src/binutils/readelf.c,v
retrieving revision 1.189
diff -u -p -r1.189 readelf.c
--- binutils/readelf.c 4 Jan 2003 02:13:46 -0000 1.189
+++ binutils/readelf.c 16 Jan 2003 02:22:43 -0000
@@ -79,6 +79,7 @@
#include "elf/or32.h"
#include "elf/pj.h"
#include "elf/ppc.h"
+#include "elf/ppc64.h"
#include "elf/s390.h"
#include "elf/sh.h"
#include "elf/sparc.h"
@@ -1165,8 +1166,11 @@ dump_relocations (file, rel_offset, rel_
break;
case EM_PPC:
- case EM_PPC64:
rtype = elf_ppc_reloc_type (type);
+ break;
+
+ case EM_PPC64:
+ rtype = elf_ppc64_reloc_type (type);
break;
case EM_MIPS:
--
Alan Modra
IBM OzLabs - Linux Technology Centre