]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Add support for a few missing DT_ and R_* values.
authorUlrich Drepper <drepper@redhat.com>
Sun, 7 Aug 2005 08:12:22 +0000 (08:12 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 7 Aug 2005 08:12:22 +0000 (08:12 +0000)
Import new elf.h.

13 files changed:
libebl/ChangeLog
libebl/alpha_init.c
libebl/alpha_symbol.c
libebl/libebl_alpha.h
libebl/libebl_ppc.h
libebl/libebl_ppc64.h
libebl/ppc64_init.c
libebl/ppc64_symbol.c
libebl/ppc_init.c
libebl/ppc_symbol.c
libelf/ChangeLog
libelf/elf.h
tests/run-elflint-self.sh [deleted file]

index 8c4473fdef252e7b4f69fef4237595f5f5ddf3fc..5553cc49ebb8f9febcb321e64630deac0ccaf5b9 100644 (file)
@@ -1,3 +1,15 @@
+2005-08-07  Ulrich Drepper  <drepper@redhat.com>
+
+       * ppc_init.c: Add support for new DT_PPC_* and R_PPC_* values.
+       * ppc_symbol.c: Likewise.
+       * libebl_ppc.h: Likewise.
+       * ppc64_init.c: There is now also a dynamic_tag_check functions
+       * ppc64_symbol.c: Add dynamic_tag_check.
+       * libebl_ppc64.h: Add prototype.
+       * alpha_init.c: Add support for new DT_ALPHA_* value.
+       * alpha_symbol.c: Likewise.
+       * libebl_alpha.h: Likewise.
+
 2005-08-03  Ulrich Drepper  <drepper@redhat.com>
 
        * libebl_alpha.map: Remove unnecessary exports.
index 17eff3734a9c1de19ad9be8eb1da26c72762de50..327f3bd0dc812e6fbc514a68f8ec9a24fe8acfaf 100644 (file)
@@ -34,6 +34,8 @@ alpha_init (elf, machine, eh, ehlen)
   eh->name = "Alpha";
   eh->reloc_type_name = alpha_reloc_type_name;
   eh->reloc_type_check = alpha_reloc_type_check;
+  eh->dynamic_tag_name = alpha_dynamic_tag_name;
+  eh->dynamic_tag_check = alpha_dynamic_tag_check;
   eh->copy_reloc_p = alpha_copy_reloc_p;
   eh->destr = alpha_destr;
 
index 49e7c72f605f6aa178c8158bf7260d8af5dd0bc6..3fcd184624262af6a049b173db59395df6cf22f6 100644 (file)
@@ -93,6 +93,29 @@ alpha_reloc_type_check (int type)
          && reloc_map_table[type] != NULL) ? true : false;
 }
 
+
+const char *
+alpha_dynamic_tag_name (int64_t tag, char *buf __attribute__ ((unused)),
+                       size_t len __attribute__ ((unused)))
+{
+  switch (tag)
+    {
+    case DT_ALPHA_PLTRO:
+      return "ALPHA_PLTRO";
+    default:
+      break;
+    }
+  return NULL;
+}
+
+
+bool
+alpha_dynamic_tag_check (int64_t tag)
+{
+  return tag == DT_ALPHA_PLTRO;
+}
+
+
 /* Check whether given relocation is a copy relocation.  */
 bool
 alpha_copy_reloc_p (int reloc)
index 7990d9956fb9a23e77d1097f8063d6d532184271..24a3500ed687f624d6777b7a7f9a83e449516b05 100644 (file)
@@ -31,6 +31,12 @@ extern const char *alpha_reloc_type_name (int type, char *buf, size_t len);
 /* Check relocation type.  */
 extern bool alpha_reloc_type_check (int type);
 
+/* Name of dynamic tag.  */
+extern const char *alpha_dynamic_tag_name (int64_t tag, char *buf, size_t len);
+
+/* Check dynamic tag.  */
+extern bool alpha_dynamic_tag_check (int64_t tag);
+
 /* Check whether given relocation is a copy relocation.  */
 extern bool alpha_copy_reloc_p (int reloc);
 
index 1e646d4f5b3ff5d3845fc1b44a235bca817f73b2..e3c6d21cb27e256e6ab73da517c212035713ea9f 100644 (file)
@@ -41,6 +41,12 @@ extern Elf_Type ppc_reloc_simple_type (Elf *elf, int type);
 extern bool ppc_core_note (const char *name, uint32_t type, uint32_t descsz,
                              const char *desc);
 
+/* Name of dynamic tag.  */
+extern const char *ppc_dynamic_tag_name (int64_t tag, char *buf, size_t len);
+
+/* Check dynamic tag.  */
+extern bool ppc_dynamic_tag_check (int64_t tag);
+
 /* Check whether given relocation is a copy relocation.  */
 extern bool ppc_copy_reloc_p (int reloc);
 
index e737c56a29f5a9d132d2b420889d8354461f8511..148e2249599c579865de25b736333b96465d7f61 100644 (file)
@@ -44,6 +44,9 @@ extern bool ppc64_core_note (const char *name, uint32_t type, uint32_t descsz,
 /* Name of dynamic tag.  */
 extern const char *ppc64_dynamic_tag_name (int64_t tag, char *buf, size_t len);
 
+/* Check dynamic tag.  */
+extern bool ppc64_dynamic_tag_check (int64_t tag);
+
 /* Check whether given relocation is a copy relocation.  */
 extern bool ppc64_copy_reloc_p (int reloc);
 
index 8231a32dc300a70bf793b35b4571719d1fbb79c2..347444c03c530946df88d03107735d1080a5ab5e 100644 (file)
@@ -37,6 +37,7 @@ ppc64_init (elf, machine, eh, ehlen)
   eh->reloc_valid_use = ppc64_reloc_valid_use;
   eh->reloc_simple_type = ppc64_reloc_simple_type;
   eh->dynamic_tag_name = ppc64_dynamic_tag_name;
+  eh->dynamic_tag_check = ppc64_dynamic_tag_check;
   eh->copy_reloc_p = ppc64_copy_reloc_p;
   eh->destr = ppc64_destr;
 
index f844816b24a4157462178e6ded58b7f0e4c2ba58..457e84e670010befac23b38f3110219b51367781 100644 (file)
@@ -227,6 +227,15 @@ ppc64_dynamic_tag_name (int64_t tag, char *buf __attribute__ ((unused)),
   return NULL;
 }
 
+bool
+ppc64_dynamic_tag_check (int64_t tag)
+{
+  return (tag == DT_PPC64_GLINK
+         || tag == DT_PPC64_OPD
+         || tag == DT_PPC64_OPDSZ);
+}
+
+
 /* Check whether given relocation is a copy relocation.  */
 bool
 ppc64_copy_reloc_p (int reloc)
index 4d72c46d4bae0fe208e03f44a8b4dd306de7b195..dca780b5858db7d6a1c3589863cf542c4ea012f9 100644 (file)
@@ -36,6 +36,8 @@ ppc_init (elf, machine, eh, ehlen)
   eh->reloc_type_check = ppc_reloc_type_check;
   eh->reloc_valid_use = ppc_reloc_valid_use;
   eh->reloc_simple_type = ppc_reloc_simple_type;
+  eh->dynamic_tag_name = ppc_dynamic_tag_name;
+  eh->dynamic_tag_check = ppc_dynamic_tag_check;
   eh->copy_reloc_p = ppc_copy_reloc_p;
   eh->destr = ppc_destr;
 
index 20beae31b38164368a612d7549efbd99923d7b92..e865eaabc7022a0f7ca66135dc0d24ed2f1305ee 100644 (file)
@@ -103,8 +103,14 @@ static struct
     [R_PPC_GOT_DTPREL16] = { "R_PPC_GOT_DTPREL16", exec },
     [R_PPC_GOT_DTPREL16_LO] = { "R_PPC_GOT_DTPREL16_LO", exec },
     [R_PPC_GOT_DTPREL16_HI] = { "R_PPC_GOT_DTPREL16_HI", exec },
-    [R_PPC_GOT_DTPREL16_HA] = { "R_PPC_GOT_DTPREL16_HA", exec }
+    [R_PPC_GOT_DTPREL16_HA] = { "R_PPC_GOT_DTPREL16_HA", exec },
+    [R_PPC_REL16] = { "R_PPC_REL16", rel },
+    [R_PPC_REL16_LO] = { "R_PPC_REL16_LO", rel },
+    [R_PPC_REL16_HI] = { "R_PPC_REL16_HI", rel },
+    [R_PPC_REL16_HA] = { "R_PPC_REL16_HA", rel },
   };
+#define nreloc_map_table \
+     (sizeof (reloc_map_table) / sizeof (reloc_map_table[0]))
 
 
 /* Determine relocation type string for PPC.  */
@@ -112,7 +118,7 @@ const char *
 ppc_reloc_type_name (int type, char *buf __attribute__ ((unused)),
                     size_t len __attribute__ ((unused)))
 {
-  if (type < 0 || type >= R_PPC_NUM)
+  if (type < 0 || (size_t) type >= nreloc_map_table)
     return NULL;
 
   return reloc_map_table[type].name;
@@ -123,7 +129,7 @@ ppc_reloc_type_name (int type, char *buf __attribute__ ((unused)),
 bool
 ppc_reloc_type_check (int type)
 {
-  return (type >= R_PPC_NONE && type < R_PPC_NUM
+  return (type >= R_PPC_NONE && (size_t) type < nreloc_map_table
          && reloc_map_table[type].name != NULL) ? true : false;
 }
 
@@ -166,6 +172,29 @@ ppc_reloc_simple_type (Elf *elf __attribute__ ((unused)), int type)
     }
 }
 
+
+const char *
+ppc_dynamic_tag_name (int64_t tag, char *buf __attribute__ ((unused)),
+                     size_t len __attribute__ ((unused)))
+{
+  switch (tag)
+    {
+    case DT_PPC_GOT:
+      return "PPC_GOT";
+    default:
+      break;
+    }
+  return NULL;
+}
+
+
+bool
+ppc_dynamic_tag_check (int64_t tag)
+{
+  return tag == DT_PPC_GOT;
+}
+
+
 /* Check whether given relocation is a copy relocation.  */
 bool
 ppc_copy_reloc_p (int reloc)
index 4a8bc879bc44d4e67770a4b150a114657d073b3e..aa2a0b11b273940b409e217aa1cb5310dd7591a4 100644 (file)
@@ -1,3 +1,7 @@
+2005-08-07  Ulrich Drepper  <drepper@redhat.com>
+
+       * elf.h: Update from glibc.
+
 2005-08-06  Ulrich Drepper  <drepper@redhat.com>
 
        * Makefile.am (AM_CFLAGS): Add -fpic when BUILD_STATIC.
index e246519fabe019b53bb572d2af89ec2f744e11d5..ef9e27cccc3a8c18979a6a81e4bc09bd9bd58714 100644 (file)
@@ -1866,6 +1866,9 @@ typedef Elf32_Addr Elf32_Conflict;
 #define LITUSE_ALPHA_TLS_GD    4
 #define LITUSE_ALPHA_TLS_LDM   5
 
+/* Legal values for d_tag of Elf64_Dyn.  */
+#define DT_ALPHA_PLTRO         (DT_LOPROC + 0)
+#define DT_ALPHA_NUM           1
 
 /* PowerPC specific declarations */
 
@@ -1976,10 +1979,19 @@ typedef Elf32_Addr Elf32_Conflict;
 #define R_PPC_DIAB_RELSDA_HI   184     /* like EMB_RELSDA, but high 16 bit */
 #define R_PPC_DIAB_RELSDA_HA   185     /* like EMB_RELSDA, adjusted high 16 */
 
+/* GNU relocs used in PIC code sequences.  */
+#define R_PPC_REL16            249     /* word32   (sym-.) */
+#define R_PPC_REL16_LO         250     /* half16   (sym-.)@l */
+#define R_PPC_REL16_HI         251     /* half16   (sym-.)@h */
+#define R_PPC_REL16_HA         252     /* half16   (sym-.)@ha */
+
 /* This is a phony reloc to handle any old fashioned TOC16 references
    that may still be in object files.  */
 #define R_PPC_TOC16            255
 
+/* PowerPC specific values for the Dyn d_tag field.  */
+#define DT_PPC_GOT             (DT_LOPROC + 0)
+#define DT_PPC_NUM             1
 
 /* PowerPC64 relocations defined by the ABIs */
 #define R_PPC64_NONE           R_PPC_NONE
diff --git a/tests/run-elflint-self.sh b/tests/run-elflint-self.sh
deleted file mode 100755 (executable)
index ce5706c..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2005 Red Hat, Inc.
-# Written by Ulrich Drepper <drepper@redhat.com>, 2005.
-#
-# This program is Open Source software; you can redistribute it and/or
-# modify it under the terms of the Open Software License version 1.0 as
-# published by the Open Source Initiative.
-#
-# You should have received a copy of the Open Software License along
-# with this program; if not, you may obtain a copy of the Open Software
-# License version 1.0 from http://www.opensource.org/licenses/osl.php or
-# by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
-# 3001 King Ranch Road, Ukiah, CA 95482.
-set -e
-
-export LD_LIBRARY_PATH=../libebl:../libelf${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
-
-runtest() {
-# Uncomment for debuging
-#  echo $1
-  ../src/elflint --quiet --gnu-ld $1
-}
-
-runtest ../src/addr2line
-runtest ../src/elfcmp
-runtest ../src/elflint
-runtest ../src/findtextrel
-runtest ../src/ld
-runtest ../src/nm
-runtest ../src/objdump
-runtest ../src/readelf
-runtest ../src/size
-runtest ../src/strip
-runtest ../libelf/libelf.so
-runtest ../libdw/libdw.so
-runtest ../libasm/libasm.so
-runtest ../libebl/libebl_alpha.so
-runtest ../libebl/libebl_arm.so
-runtest ../libebl/libebl_i386.so
-runtest ../libebl/libebl_ia64.so
-runtest ../libebl/libebl_ppc.so
-runtest ../libebl/libebl_ppc64.so
-runtest ../libebl/libebl_sh.so
-runtest ../libebl/libebl_sparc.so
-runtest ../libebl/libebl_x86_64.so
-
-