[elfutils] 0.159-5 aarch64-bool-ret, elf.h update and ppc64le-elfv2-abi patch.

Mark Wielaard mjw at fedoraproject.org
Fri Jul 4 13:17:44 UTC 2014


commit 16224b3d3228b1c47ee18213e02cff3b88b03e07
Author: Mark Wielaard <mjw at redhat.com>
Date:   Fri Jul 4 15:14:59 2014 +0200

    0.159-5 aarch64-bool-ret, elf.h update and ppc64le-elfv2-abi patch.
    
    Resolves: #1110249

 elfutils-0.159-aarch64-bool-ret.patch  |   23 +++++++
 elfutils-0.159-elf-h.patch             |   70 ++++++++++++++++++++++
 elfutils-0.159-ppc64le-elfv2-abi.patch |   99 ++++++++++++++++++++++++++++++++
 elfutils.spec                          |   13 ++++-
 4 files changed, 204 insertions(+), 1 deletions(-)
---
diff --git a/elfutils-0.159-aarch64-bool-ret.patch b/elfutils-0.159-aarch64-bool-ret.patch
new file mode 100644
index 0000000..959baee
--- /dev/null
+++ b/elfutils-0.159-aarch64-bool-ret.patch
@@ -0,0 +1,23 @@
+commit 5e9668ccaf3d34567b313b13327ff9b31e4e5ba6
+Author: Mark Wielaard <mjw at redhat.com>
+Date:   Fri Jul 4 13:26:12 2014 +0200
+
+    backends: aarch64_return_value_location should handle DW_ATE_boolean.
+    
+    Found with run-native-test.sh om debian arm64.
+    http://bugs.debian.org/753552
+    
+    Signed-off-by: Mark Wielaard <mjw at redhat.com>
+
+diff --git a/backends/aarch64_retval.c b/backends/aarch64_retval.c
+index 0ed7d56..68de307 100644
+--- a/backends/aarch64_retval.c
++++ b/backends/aarch64_retval.c
+@@ -357,6 +357,7 @@ aarch64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ 		 size of the argument is less than or equal to 8 bytes
+ 		 [...] the argument is copied to the least significant
+ 		 bits in x[NGRN].  */
++	    case DW_ATE_boolean:
+ 	    case DW_ATE_signed:
+ 	    case DW_ATE_unsigned:
+ 	    case DW_ATE_unsigned_char:
diff --git a/elfutils-0.159-elf-h.patch b/elfutils-0.159-elf-h.patch
new file mode 100644
index 0000000..7376d87
--- /dev/null
+++ b/elfutils-0.159-elf-h.patch
@@ -0,0 +1,70 @@
+commit 16e2d351bf31d0ce09ce9632ff196cbd973b656b
+Author: Mark Wielaard <mjw at redhat.com>
+Date:   Fri Jul 4 13:39:18 2014 +0200
+
+    Update elf.h from glibc.
+    
+    Includes new bits needed for ppc64le ELFv2 abi.
+    https://bugzilla.redhat.com/show_bug.cgi?id=1110249
+    
+    Signed-off-by: Mark Wielaard <mjw at redhat.com>
+
+diff --git a/libelf/elf.h b/libelf/elf.h
+index a05ea3b..40e87b2 100644
+--- a/libelf/elf.h
++++ b/libelf/elf.h
+@@ -1,5 +1,5 @@
+ /* This file defines standard ELF types, structures, and macros.
+-   Copyright (C) 1995-2013 Free Software Foundation, Inc.
++   Copyright (C) 1995-2014 Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+    The GNU C Library is free software; you can redistribute it and/or
+@@ -2252,6 +2252,17 @@ typedef Elf32_Addr Elf32_Conflict;
+ #define R_PPC64_DTPREL16_HIGHERA 104 /* half16	(sym+add)@dtprel at highera */
+ #define R_PPC64_DTPREL16_HIGHEST 105 /* half16	(sym+add)@dtprel at highest */
+ #define R_PPC64_DTPREL16_HIGHESTA 106 /* half16	(sym+add)@dtprel at highesta */
++#define R_PPC64_TLSGD		107 /* none	(sym+add)@tlsgd */
++#define R_PPC64_TLSLD		108 /* none	(sym+add)@tlsld */
++#define R_PPC64_TOCSAVE		109 /* none */
++
++/* Added when HA and HI relocs were changed to report overflows.  */
++#define R_PPC64_ADDR16_HIGH	110
++#define R_PPC64_ADDR16_HIGHA	111
++#define R_PPC64_TPREL16_HIGH	112
++#define R_PPC64_TPREL16_HIGHA	113
++#define R_PPC64_DTPREL16_HIGH	114
++#define R_PPC64_DTPREL16_HIGHA	115
+ 
+ /* GNU extension to support local ifunc.  */
+ #define R_PPC64_JMP_IREL	247
+@@ -2261,12 +2272,29 @@ typedef Elf32_Addr Elf32_Conflict;
+ #define R_PPC64_REL16_HI	251	/* half16   (sym+add-.)@h */
+ #define R_PPC64_REL16_HA	252	/* half16   (sym+add-.)@ha */
+ 
++/* e_flags bits specifying ABI.
++   1 for original function descriptor using ABI,
++   2 for revised ABI without function descriptors,
++   0 for unspecified or not using any features affected by the differences.  */
++#define EF_PPC64_ABI	3
++
+ /* PowerPC64 specific values for the Dyn d_tag field.  */
+ #define DT_PPC64_GLINK  (DT_LOPROC + 0)
+ #define DT_PPC64_OPD	(DT_LOPROC + 1)
+ #define DT_PPC64_OPDSZ	(DT_LOPROC + 2)
++#define DT_PPC64_OPT	(DT_LOPROC + 3)
+ #define DT_PPC64_NUM    3
+ 
++/* PowerPC64 specific values for the DT_PPC64_OPT Dyn entry.  */
++#define PPC64_OPT_TLS		1
++#define PPC64_OPT_MULTI_TOC	2
++
++/* PowerPC64 specific values for the Elf64_Sym st_other field.  */
++#define STO_PPC64_LOCAL_BIT	5
++#define STO_PPC64_LOCAL_MASK	(7 << STO_PPC64_LOCAL_BIT)
++#define PPC64_LOCAL_ENTRY_OFFSET(other)				\
++ (((1 << (((other) & STO_PPC64_LOCAL_MASK) >> STO_PPC64_LOCAL_BIT)) >> 2) << 2)
++
+ 
+ /* ARM specific declarations */
+ 
diff --git a/elfutils-0.159-ppc64le-elfv2-abi.patch b/elfutils-0.159-ppc64le-elfv2-abi.patch
new file mode 100644
index 0000000..2bf1b06
--- /dev/null
+++ b/elfutils-0.159-ppc64le-elfv2-abi.patch
@@ -0,0 +1,99 @@
+commit a95c4ad24cf83b2b0273fee73162bf476cebec8f
+Author: Mark Wielaard <mjw at redhat.com>
+Date:   Fri Jul 4 14:30:48 2014 +0200
+
+    Add ppc64le ELFv2 abi support to backends and elflint.
+    
+    The big endian vs little endian changes are already handled by detecting
+    the EI_DATA data encoding. And the function descriptors are already not
+    used when we see there is no .opd section. This change adds new checks
+    for st_other bits, new relocations and recognizes DT_PPC64_OPT.
+    
+    Signed-off-by: Menanteau Guy <menantea at linux.vnet.ibm.com>
+    Signed-off-by: Mark Wielaard <mjw at redhat.com>
+
+diff --git a/backends/ppc64_init.c b/backends/ppc64_init.c
+index e52231c..7ea2b23 100644
+--- a/backends/ppc64_init.c
++++ b/backends/ppc64_init.c
+@@ -61,6 +61,7 @@ ppc64_init (elf, machine, eh, ehlen)
+   HOOK (eh, machine_flag_check);
+   HOOK (eh, copy_reloc_p);
+   HOOK (eh, check_special_symbol);
++  HOOK (eh, check_st_other_bits);
+   HOOK (eh, bss_plt_p);
+   HOOK (eh, return_value_location);
+   HOOK (eh, register_info);
+diff --git a/backends/ppc64_reloc.def b/backends/ppc64_reloc.def
+index 6366f46..3a693cf 100644
+--- a/backends/ppc64_reloc.def
++++ b/backends/ppc64_reloc.def
+@@ -132,6 +132,21 @@ RELOC_TYPE (DTPREL16_HIGHER,	REL)
+ RELOC_TYPE (DTPREL16_HIGHERA,	REL)
+ RELOC_TYPE (DTPREL16_HIGHEST,	REL)
+ RELOC_TYPE (DTPREL16_HIGHESTA,	REL)
++RELOC_TYPE (TLSGD,		REL)
++RELOC_TYPE (TLSLD,		REL)
++RELOC_TYPE (TOCSAVE,		REL)
++RELOC_TYPE (ADDR16_HIGH,	REL)
++RELOC_TYPE (ADDR16_HIGHA,	REL)
++RELOC_TYPE (TPREL16_HIGH,	REL)
++RELOC_TYPE (TPREL16_HIGHA,	REL)
++RELOC_TYPE (DTPREL16_HIGH,	REL)
++RELOC_TYPE (DTPREL16_HIGHA,	REL)
++RELOC_TYPE (JMP_IREL,		REL)
++RELOC_TYPE (IRELATIVE,		REL)
++RELOC_TYPE (REL16,		REL)
++RELOC_TYPE (REL16_LO,		REL)
++RELOC_TYPE (REL16_HI,		REL)
++RELOC_TYPE (REL16_HA,		REL)
+ 
+ /* Notes from Alan Modra:
+ 
+diff --git a/backends/ppc64_symbol.c b/backends/ppc64_symbol.c
+index 212d414..5a020d8 100644
+--- a/backends/ppc64_symbol.c
++++ b/backends/ppc64_symbol.c
+@@ -72,6 +72,8 @@ ppc64_dynamic_tag_name (int64_t tag, char *buf __attribute__ ((unused)),
+       return "PPC64_OPD";
+     case DT_PPC64_OPDSZ:
+       return "PPC64_OPDSZ";
++    case DT_PPC64_OPT:
++      return "PPC64_OPT";
+     default:
+       break;
+     }
+@@ -84,7 +86,8 @@ ppc64_dynamic_tag_check (int64_t tag)
+ {
+   return (tag == DT_PPC64_GLINK
+ 	  || tag == DT_PPC64_OPD
+-	  || tag == DT_PPC64_OPDSZ);
++	  || tag == DT_PPC64_OPDSZ
++	  || tag == DT_PPC64_OPT);
+ }
+ 
+ 
+@@ -120,3 +123,9 @@ ppc64_machine_flag_check (GElf_Word flags)
+ {
+   return flags == 0 || flags == 1 || flags == 2;
+ }
++
++bool
++ppc64_check_st_other_bits (unsigned char st_other)
++{
++  return (PPC64_LOCAL_ENTRY_OFFSET (st_other) != 0);
++}
+diff --git a/src/elflint.c b/src/elflint.c
+index 5568c65..d6a4774 100644
+--- a/src/elflint.c
++++ b/src/elflint.c
+@@ -799,7 +799,8 @@ section [%2d] '%s': symbol %zu: function in COMMON section is nonsense\n"),
+ 				  && strcmp (name, "__fini_array_end") != 0
+ 				  && strcmp (name, "__bss_start") != 0
+ 				  && strcmp (name, "__bss_start__") != 0
+-				  && strcmp (name, "__TMC_END__") != 0))
++				  && strcmp (name, "__TMC_END__") != 0
++				  && strcmp (name, ".TOC.") != 0))
+ 			    ERROR (gettext ("\
+ section [%2d] '%s': symbol %zu: st_value out of bounds\n"),
+ 				   idx, section_name (ebl, idx), cnt);
diff --git a/elfutils.spec b/elfutils.spec
index d7fad74..9790611 100644
--- a/elfutils.spec
+++ b/elfutils.spec
@@ -1,7 +1,7 @@
 Name: elfutils
 Summary: A collection of utilities and DSOs to handle compiled objects
 Version: 0.159
-%global baserelease 4
+%global baserelease 5
 URL: https://fedorahosted.org/elfutils/
 %global source_url http://fedorahosted.org/releases/e/l/elfutils/%{version}/
 License: GPLv3+ and (GPLv2+ or LGPLv3+)
@@ -47,6 +47,9 @@ Source: %{?source_url}%{name}-%{version}.tar.bz2
 Patch1: %{?source_url}elfutils-portability.patch
 Patch2: elfutils-aarch64-user_regs_struct.patch
 Patch3: elfutils-0.159-argp-attach.patch
+Patch4: elfutils-0.159-aarch64-bool-ret.patch
+Patch5: elfutils-0.159-elf-h.patch
+Patch6: elfutils-0.159-ppc64le-elfv2-abi.patch
 
 %if !%{compat}
 Release: %{baserelease}%{?dist}
@@ -211,6 +214,9 @@ sed -i.scanf-m -e 's/%m/%a/g' src/addr2line.c tests/line2addr.c
 
 %patch2 -p1 -b .aa64~1
 %patch3 -p1 -b .argp-attach
+%patch4 -p1 -b .aarch64-ret-bool
+%patch5 -p1 -b .elf-h
+%patch6 -p1 -b .ppc64le-elfv2-abi
 
 find . -name \*.sh ! -perm -0100 -print | xargs chmod +x
 
@@ -333,6 +339,11 @@ rm -rf ${RPM_BUILD_ROOT}
 %{_libdir}/libelf.a
 
 %changelog
+* Fri Jul  4 2014 Mark Wielaard <mjw at redhat.com> - 0.159-5
+- Add elfutils-0.159-aarch64-bool-ret.patch
+- Add elfutils-0.159-elf-h.patch
+- Add elfutils-0.159-ppc64le-elfv2-abi.patch (#1110249)
+
 * Tue Jun 10 2014 Mark Wielaard <mjw at redhat.com> - 0.159-4
 - Add elfutils-0.159-argp-attach.patch (#1107654)
 


More information about the scm-commits mailing list