From 84a08e7aa8facbf76a058637c88cc8b513f96a00a145a40a03e2fa392d4790b9 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Thu, 19 Feb 2009 17:07:55 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/elfutils?expand=0&rev=7 --- elfutils-0.137-dwfl_getmodules-fixes.diff | 553 ---------------------- elfutils-0.137-fixes.patch | 174 ------- elfutils-0.137-i386-rel-types.diff | 19 - elfutils-0.137-main-bias-fix.diff | 23 - elfutils-0.137-main-bias-fix2.diff | 54 --- elfutils-0.137-nm-crash-fix.diff | 121 ----- elfutils-0.137-no-osl.tar.bz2 | 3 - elfutils-0.137-readelf-crash-fix.diff | 49 -- elfutils-0.140-no-osl.tar.bz2 | 3 + elfutils-old-scanf-fix.diff | 30 ++ elfutils-portability.patch | 476 +++++++++++++------ elfutils-robustify.patch | 372 ++++++++------- elfutils-suse-10.3-fixes.diff | 154 ++++++ elfutils.changes | 15 + elfutils.spec | 58 ++- 15 files changed, 763 insertions(+), 1341 deletions(-) delete mode 100644 elfutils-0.137-dwfl_getmodules-fixes.diff delete mode 100644 elfutils-0.137-fixes.patch delete mode 100644 elfutils-0.137-i386-rel-types.diff delete mode 100644 elfutils-0.137-main-bias-fix.diff delete mode 100644 elfutils-0.137-main-bias-fix2.diff delete mode 100644 elfutils-0.137-nm-crash-fix.diff delete mode 100644 elfutils-0.137-no-osl.tar.bz2 delete mode 100644 elfutils-0.137-readelf-crash-fix.diff create mode 100644 elfutils-0.140-no-osl.tar.bz2 create mode 100644 elfutils-old-scanf-fix.diff create mode 100644 elfutils-suse-10.3-fixes.diff diff --git a/elfutils-0.137-dwfl_getmodules-fixes.diff b/elfutils-0.137-dwfl_getmodules-fixes.diff deleted file mode 100644 index 67a4a4a..0000000 --- a/elfutils-0.137-dwfl_getmodules-fixes.diff +++ /dev/null @@ -1,553 +0,0 @@ -From: Roland McGrath -Date: Wed, 3 Dec 2008 03:41:58 +0000 (+0000) -Subject: src/ -X-Git-Url: http://git.fedorahosted.org/git/elfutils.git?p=elfutils.git;a=commitdiff_plain;h=a845f68bf43f90e0670ed6b33154f2aff98ad46b - -src/ -2008-12-02 Roland McGrath - - * readelf.c (count_dwflmod, process_file): Don't presume encoding of - nonzero OFFSET argument to dwfl_getmodules. ---- - -diff --git a/backends/Makefile.am b/backends/Makefile.am -index ebf6b09..5b55294 100644 ---- a/backends/Makefile.am -+++ b/backends/Makefile.am -@@ -146,7 +146,7 @@ uninstall: uninstall-am - done - rmdir --ignore-fail-on-non-empty $(DESTDIR)$(libdir)/$(LIBEBL_SUBDIR) - --noinst_HEADERS = libebl_CPU.h common-reloc.c linux-core-note.c -+noinst_HEADERS = libebl_CPU.h common-reloc.c linux-core-note.c x86_corenote.c - EXTRA_DIST = $(foreach m,$(modules),$($(m)_SRCS)) $(modules:=_reloc.def) - - CLEANFILES = *.gcno *.gcda \ -diff --git a/backends/i386_corenote.c b/backends/i386_corenote.c -index 02d8ec3..c371c4c 100644 ---- a/backends/i386_corenote.c -+++ b/backends/i386_corenote.c -@@ -103,9 +103,8 @@ static const Ebl_Register_Location prxfpreg_regs[] = - #define EXTRA_NOTES \ - EXTRA_REGSET (NT_PRFPXREG, 512, prxfpreg_regs) \ - case NT_386_TLS: \ -- return tls_info (descsz, regs_offset, nregloc, reglocs, nitems, items); -- --#define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ -+ return tls_info (descsz, regs_offset, nregloc, reglocs, nitems, items); \ -+ EXTRA_NOTES_IOPERM - - static const Ebl_Core_Item tls_items[] = - { -@@ -131,4 +130,5 @@ tls_info (GElf_Word descsz, GElf_Word *regs_offset, - return 1; - } - -+#include "x86_corenote.c" - #include "linux-core-note.c" -diff --git a/backends/x86_64_corenote.c b/backends/x86_64_corenote.c -index c2bc72e..552ac88 100644 ---- a/backends/x86_64_corenote.c -+++ b/backends/x86_64_corenote.c -@@ -1,5 +1,5 @@ - /* x86-64 specific core note handling. -- Copyright (C) 2005, 2007 Red Hat, Inc. -+ Copyright (C) 2005, 2007, 2008 Red Hat, Inc. - This file is part of Red Hat elfutils. - - Red Hat elfutils is free software; you can redistribute it and/or modify -@@ -103,4 +103,7 @@ static const Ebl_Register_Location fpregset_regs[] = - }; - #define FPREGSET_SIZE 512 - -+#define EXTRA_NOTES EXTRA_NOTES_IOPERM -+ -+#include "x86_corenote.c" - #include "linux-core-note.c" -diff --git a/backends/x86_corenote.c b/backends/x86_corenote.c -new file mode 100644 -index 0000000..7d55067 ---- /dev/null -+++ b/backends/x86_corenote.c -@@ -0,0 +1,47 @@ -+/* x86-specific core note handling, pieces common to x86-64 and i386. -+ Copyright (C) 2005, 2008 Red Hat, Inc. -+ This file is part of Red Hat elfutils. -+ -+ Red Hat elfutils 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; version 2 of the License. -+ -+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation, -+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. -+ -+ Red Hat elfutils is an included package of the Open Invention Network. -+ An included package of the Open Invention Network is a package for which -+ Open Invention Network licensees cross-license their patents. No patent -+ license is granted, either expressly or impliedly, by designation as an -+ included package. Should you wish to participate in the Open Invention -+ Network licensing program, please visit www.openinventionnetwork.com -+ . */ -+ -+#define EXTRA_NOTES_IOPERM \ -+ case NT_386_IOPERM: \ -+ return ioperm_info (descsz, regs_offset, nregloc, reglocs, nitems, items); -+ -+static int -+ioperm_info (GElf_Word descsz, GElf_Word *regs_offset, -+ size_t *nregloc, const Ebl_Register_Location **reglocs, -+ size_t *nitems, const Ebl_Core_Item **items) -+{ -+ static const Ebl_Core_Item ioperm_item = -+ { .type = ELF_T_WORD, .format = 'b', .name = "ioperm" }; -+ -+ if (descsz % 4 != 0) -+ return 0; -+ -+ *regs_offset = 0; -+ *nregloc = 0; -+ *reglocs = NULL; -+ *nitems = 1; -+ *items = &ioperm_item; -+ return 1; -+} -diff --git a/libdwfl/dwfl_getmodules.c b/libdwfl/dwfl_getmodules.c -index f205b89..7c6ab97 100644 ---- a/libdwfl/dwfl_getmodules.c -+++ b/libdwfl/dwfl_getmodules.c -@@ -59,49 +59,55 @@ dwfl_getmodules (Dwfl *dwfl, - if (dwfl == NULL) - return -1; - -+ /* We iterate through the linked list when it's all we have. -+ But continuing from an offset is slow that way. So when -+ DWFL->lookup_module is populated, we can instead keep our -+ place by jumping directly into the array. Since the actions -+ of a callback could cause it to get populated, we must -+ choose the style of place-holder when we return an offset, -+ and we encode the choice in the low bits of that value. */ -+ - Dwfl_Module *m = dwfl->modulelist; - -- if (unlikely (dwfl->lookup_module == NULL)) -+ if ((offset & 3) == 1) - { -+ offset >>= 2; - for (ptrdiff_t pos = 0; pos < offset; ++pos) - if (m == NULL) - return -1; - else - m = m->next; -- while (m != NULL) -- { -- ++offset; -- if ((*callback) (MODCB_ARGS (m), arg) != DWARF_CB_OK) -- return offset; -- m = m->next; -- } - } -- else -+ else if (((offset & 3) == 2) && likely (dwfl->lookup_module != NULL)) - { -- if (offset > 0) -- { -- if ((size_t) offset - 1 == dwfl->lookup_elts) -- return 0; -+ offset >>= 2; - -- if (unlikely ((size_t) offset - 1 > dwfl->lookup_elts)) -- return -1; -+ if ((size_t) offset - 1 == dwfl->lookup_elts) -+ return 0; - -- m = dwfl->lookup_module[offset - 1]; -- if (unlikely (m == NULL)) -- return -1; -- } -+ if (unlikely ((size_t) offset - 1 > dwfl->lookup_elts)) -+ return -1; - -- while (m != NULL) -- { -- int ok = (*callback) (MODCB_ARGS (m), arg); -- m = m->next; -- if (ok != DWARF_CB_OK) -- return (m == NULL -- ? (ptrdiff_t) dwfl->lookup_elts + 1 -- : m->segment + 1); -- } -+ m = dwfl->lookup_module[offset - 1]; -+ if (unlikely (m == NULL)) -+ return -1; -+ } -+ else if (offset != 0) -+ { -+ __libdwfl_seterrno (DWFL_E_BADSTROFF); -+ return -1; - } - -+ while (m != NULL) -+ { -+ int ok = (*callback) (MODCB_ARGS (m), arg); -+ ++offset; -+ m = m->next; -+ if (ok != DWARF_CB_OK) -+ return ((dwfl->lookup_module == NULL) ? ((offset << 2) | 1) -+ : (((m == NULL ? (ptrdiff_t) dwfl->lookup_elts + 1 -+ : m->segment + 1) << 2) | 2)); -+ } - return 0; - } - INTDEF (dwfl_getmodules) -diff --git a/libdwfl/dwfl_module_build_id.c b/libdwfl/dwfl_module_build_id.c -index 903b79c..8725afb 100644 ---- a/libdwfl/dwfl_module_build_id.c -+++ b/libdwfl/dwfl_module_build_id.c -@@ -1,5 +1,5 @@ - /* Return build ID information for a module. -- Copyright (C) 2007 Red Hat, Inc. -+ Copyright (C) 2007, 2008 Red Hat, Inc. - This file is part of Red Hat elfutils. - - Red Hat elfutils is free software; you can redistribute it and/or modify -@@ -88,7 +88,8 @@ check_notes (Dwfl_Module *mod, bool set, Elf_Data *data, GElf_Addr data_vaddr) - "GNU", sizeof "GNU")) - return found_build_id (mod, set, - data->d_buf + desc_pos, nhdr.n_descsz, -- data_vaddr == NO_VADDR ? 0 : data_vaddr + pos); -+ data_vaddr == NO_VADDR ? 0 -+ : data_vaddr + desc_pos); - return 0; - } - -diff --git a/libebl/eblcorenotetypename.c b/libebl/eblcorenotetypename.c -index d01932f..9376cf5 100644 ---- a/libebl/eblcorenotetypename.c -+++ b/libebl/eblcorenotetypename.c -@@ -56,7 +56,6 @@ - #include - #include - -- - const char * - ebl_core_note_type_name (ebl, type, buf, len) - Ebl *ebl; -@@ -101,6 +100,7 @@ ebl_core_note_type_name (ebl, type, buf, len) - KNOWNSTYPE (PPC_VMX); - KNOWNSTYPE (PPC_SPE); - KNOWNSTYPE (386_TLS); -+ KNOWNSTYPE (386_IOPERM); - #undef KNOWNSTYPE - - default: -diff --git a/libelf/elf.h b/libelf/elf.h -index a413446..b4d3475 100644 ---- a/libelf/elf.h -+++ b/libelf/elf.h -@@ -608,7 +608,9 @@ typedef struct - #define NT_PRXFPREG 0x46e62b7f /* Contains copy of user_fxsr_struct */ - #define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */ - #define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */ -+#define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ - #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ -+#define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ - - /* Legal values for the note segment descriptor types for object files. */ - -@@ -1397,6 +1399,7 @@ typedef struct - #define STO_MIPS_INTERNAL 0x1 - #define STO_MIPS_HIDDEN 0x2 - #define STO_MIPS_PROTECTED 0x3 -+#define STO_MIPS_PLT 0x8 - #define STO_MIPS_SC_ALIGN_UNUSED 0xff - - /* MIPS specific values for `st_info'. */ -@@ -1543,8 +1546,10 @@ typedef struct - #define R_MIPS_TLS_TPREL_HI16 49 /* TP-relative offset, high 16 bits */ - #define R_MIPS_TLS_TPREL_LO16 50 /* TP-relative offset, low 16 bits */ - #define R_MIPS_GLOB_DAT 51 -+#define R_MIPS_COPY 126 -+#define R_MIPS_JUMP_SLOT 127 - /* Keep this the last entry. */ --#define R_MIPS_NUM 52 -+#define R_MIPS_NUM 128 - - /* Legal values for p_type field of Elf32_Phdr. */ - -@@ -1610,7 +1615,13 @@ typedef struct - #define DT_MIPS_COMPACT_SIZE 0x7000002f /* (O32)Size of compact rel section. */ - #define DT_MIPS_GP_VALUE 0x70000030 /* GP value for aux GOTs. */ - #define DT_MIPS_AUX_DYNAMIC 0x70000031 /* Address of aux .dynamic. */ --#define DT_MIPS_NUM 0x32 -+/* The address of .got.plt in an executable using the new non-PIC ABI. */ -+#define DT_MIPS_PLTGOT 0x70000032 -+/* The base of the PLT in an executable using the new non-PIC ABI if that -+ PLT is writable. For a non-writable PLT, this is omitted or has a zero -+ value. */ -+#define DT_MIPS_RWPLT 0x70000034 -+#define DT_MIPS_NUM 0x35 - - /* Legal values for DT_MIPS_FLAGS Elf32_Dyn entry. */ - -diff --git a/libelf/elf_getarhdr.c b/libelf/elf_getarhdr.c -index deeb56d..875b2a1 100644 ---- a/libelf/elf_getarhdr.c -+++ b/libelf/elf_getarhdr.c -@@ -1,5 +1,5 @@ - /* Read header of next archive member. -- Copyright (C) 1998, 1999, 2000, 2002 Red Hat, Inc. -+ Copyright (C) 1998, 1999, 2000, 2002, 2008 Red Hat, Inc. - This file is part of Red Hat elfutils. - Written by Ulrich Drepper , 1998. - -@@ -63,6 +63,9 @@ Elf_Arhdr * - elf_getarhdr (elf) - Elf *elf; - { -+ if (elf == NULL) -+ return NULL; -+ - Elf *parent = elf->parent; - - /* Calling this function is not ok for any file type but archives. */ -@@ -78,7 +81,6 @@ elf_getarhdr (elf) - /* Something went wrong. Maybe there is no member left. */ - return NULL; - -- - /* We can be sure the parent is an archive. */ - assert (parent->kind == ELF_K_AR); - -diff --git a/src/ChangeLog b/src/ChangeLog -index 4ef23a2..fb17835 100644 ---- a/src/ChangeLog -+++ b/src/ChangeLog -@@ -1,3 +1,8 @@ -+2008-12-02 Roland McGrath -+ -+ * readelf.c (count_dwflmod, process_file): Don't presume encoding of -+ nonzero OFFSET argument to dwfl_getmodules. -+ - 2008-08-07 Roland McGrath - - * addr2line.c (main): Pass string to handle_address. -diff --git a/src/readelf.c b/src/readelf.c -index 7b599ec..2797a84 100644 ---- a/src/readelf.c -+++ b/src/readelf.c -@@ -459,8 +459,10 @@ count_dwflmod (Dwfl_Module *dwflmod __attribute__ ((unused)), - Dwarf_Addr base __attribute__ ((unused)), - void *arg) - { -- *(bool *) arg = false; -- return DWARF_CB_ABORT; -+ if (*(bool *) arg) -+ return DWARF_CB_ABORT; -+ *(bool *) arg = true; -+ return DWARF_CB_OK; - } - - struct process_dwflmod_args -@@ -548,8 +550,11 @@ process_file (int fd, const char *fname, bool only_one) - dwfl_report_end (dwfl, NULL, NULL); - - if (only_one) -- /* Clear ONLY_ONE if we have multiple modules, from an archive. */ -- dwfl_getmodules (dwfl, &count_dwflmod, &only_one, 1); -+ { -+ /* Clear ONLY_ONE if we have multiple modules, from an archive. */ -+ bool seen = false; -+ only_one = dwfl_getmodules (dwfl, &count_dwflmod, &seen, 0) == 0; -+ } - - /* Process the one or more modules gleaned from this file. */ - struct process_dwflmod_args a = { .fd = fd, .only_one = only_one }; -diff --git a/tests/ChangeLog b/tests/ChangeLog -index 15e3818..b1471c1 100644 ---- a/tests/ChangeLog -+++ b/tests/ChangeLog -@@ -1,3 +1,15 @@ -+2008-11-26 Roland McGrath -+ -+ * dwfl-bug-getmodules.c: New file. -+ * Makefile.am (noinst_PROGRAMS): Add it. -+ (dwfl_bug_getmodules_LDADD): New variable. -+ -+2008-09-10 Roland McGrath -+ -+ * test-subr.sh (LC_ALL): Export it set to "C". -+ * run-dwfl-addr-sect.sh: Don't do it here. -+ * run-strings-test.sh: Likewise. -+ - 2008-08-21 Denys Vlasenko - - * run-addrname-test.sh: Add a new case. -diff --git a/tests/Makefile.am b/tests/Makefile.am -index f57e432..b533521 100644 ---- a/tests/Makefile.am -+++ b/tests/Makefile.am -@@ -59,7 +59,8 @@ noinst_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \ - show-abbrev hash newscn ecp dwflmodtest \ - find-prologues funcretval allregs rdwrmmap \ - dwfl-bug-addr-overflow arls dwfl-bug-fd-leak \ -- dwfl-addr-sect dwfl-bug-report early-offscn -+ dwfl-addr-sect dwfl-bug-report early-offscn \ -+ dwfl-bug-getmodules - # get-ciefde - asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \ - asm-tst6 asm-tst7 asm-tst8 asm-tst9 -@@ -229,6 +230,7 @@ dwfl_bug_addr_overflow_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl - arls_LDADD = $(libelf) $(libmudflap) - dwfl_bug_fd_leak_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl - dwfl_bug_report_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl -+dwfl_bug_getmodules_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl - dwfl_addr_sect_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl - sha1_tst_LDADD = $(libeu) $(libmudflap) - -diff --git a/tests/dwfl-bug-getmodules.c b/tests/dwfl-bug-getmodules.c -new file mode 100644 -index 0000000..f7042c0 ---- /dev/null -+++ b/tests/dwfl-bug-getmodules.c -@@ -0,0 +1,74 @@ -+/* Test program for dwfl_getmodules bug. -+ Copyright (C) 2008 Red Hat, Inc. -+ This file is part of Red Hat elfutils. -+ -+ Red Hat elfutils 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; version 2 of the License. -+ -+ Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation, -+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. -+ -+ Red Hat elfutils is an included package of the Open Invention Network. -+ An included package of the Open Invention Network is a package for which -+ Open Invention Network licensees cross-license their patents. No patent -+ license is granted, either expressly or impliedly, by designation as an -+ included package. Should you wish to participate in the Open Invention -+ Network licensing program, please visit www.openinventionnetwork.com -+ . */ -+ -+#include -+#include ELFUTILS_HEADER(dwfl) -+ -+#include -+ -+static const Dwfl_Callbacks callbacks = -+ { -+ .find_elf = dwfl_linux_proc_find_elf, -+ .find_debuginfo = dwfl_standard_find_debuginfo, -+ }; -+ -+static int -+iterate (Dwfl_Module *mod __attribute__ ((unused)), -+ void **userdata __attribute__ ((unused)), -+ const char *name __attribute__ ((unused)), -+ Dwarf_Addr base, void *arg) -+{ -+ if (base != 0x2000) -+ return DWARF_CB_OK; -+ -+ if (dwfl_addrmodule (arg, 0x2100) == NULL) -+ error (1, 0, "dwfl_addrmodule: %s", dwfl_errmsg (-1)); -+ -+ return DWARF_CB_ABORT; -+} -+ -+int -+main (void) -+{ -+ Dwfl *dwfl = dwfl_begin (&callbacks); -+ -+ dwfl_report_module (dwfl, "m1", 0, 0x1000); -+ dwfl_report_module (dwfl, "m2", 0x2000, 0x3000); -+ dwfl_report_module (dwfl, "m3", 0x4000, 0x5000); -+ -+ dwfl_report_end (dwfl, NULL, NULL); -+ -+ ptrdiff_t offset = dwfl_getmodules (dwfl, &iterate, dwfl, 0); -+ if (offset <= 0) -+ error (1, 0, "dwfl_getmodules: %s", dwfl_errmsg (-1)); -+ -+ offset = dwfl_getmodules (dwfl, &iterate, NULL, offset); -+ if (offset != 0) -+ error (1, 0, "dwfl_getmodules (%d): %s", (int) offset, dwfl_errmsg (-1)); -+ -+ dwfl_end (dwfl); -+ -+ return 0; -+} -diff --git a/tests/run-dwfl-addr-sect.sh b/tests/run-dwfl-addr-sect.sh -index 69280f5..98666f3 100755 ---- a/tests/run-dwfl-addr-sect.sh -+++ b/tests/run-dwfl-addr-sect.sh -@@ -1,5 +1,5 @@ - #! /bin/sh --# Copyright (C) 2007 Red Hat, Inc. -+# Copyright (C) 2007, 2008 Red Hat, Inc. - # This file is part of Red Hat elfutils. - # - # Red Hat elfutils is free software; you can redistribute it and/or modify -@@ -27,7 +27,6 @@ - - testfiles testfile43 - --export LC_ALL=C - testrun_compare ./dwfl-addr-sect -e testfile43 0x64 0x8 0x98 <<\EOF - address 0x64 => module "" section 4 + 0 - address 0x8 => module "" section 1 + 0x8 -diff --git a/tests/run-strings-test.sh b/tests/run-strings-test.sh -index cfd9d23..a5dac63 100755 ---- a/tests/run-strings-test.sh -+++ b/tests/run-strings-test.sh -@@ -1,5 +1,5 @@ - #! /bin/sh --# Copyright (C) 2005, 2006 Red Hat, Inc. -+# Copyright (C) 2005, 2006, 2008 Red Hat, Inc. - # This file is part of Red Hat elfutils. - # Written by Ulrich Drepper , 2005. - # -@@ -29,9 +29,6 @@ - files="testfile `seq 2 9 | while read n; do echo testfile$n; done`" - testfiles $files - --LC_ALL=C --export LC_ALL -- - testrun_compare ../src/strings -tx -f $files <<\EOF - testfile: f4 /lib/ld-linux.so.2 - testfile: 1c9 __gmon_start__ -diff --git a/tests/test-subr.sh b/tests/test-subr.sh -index 7fda05a..cb34b93 100644 ---- a/tests/test-subr.sh -+++ b/tests/test-subr.sh -@@ -1,5 +1,5 @@ - #! /bin/sh --# Copyright (C) 2005, 2007 Red Hat, Inc. -+# Copyright (C) 2005, 2007, 2008 Red Hat, Inc. - # This file is part of Red Hat elfutils. - # - # Red Hat elfutils is free software; you can redistribute it and/or modify -@@ -30,6 +30,9 @@ - - set -e - -+#LC_ALL=C -+#export LC_ALL -+ - remove_files= - trap 'rm -f $remove_files' 0 - diff --git a/elfutils-0.137-fixes.patch b/elfutils-0.137-fixes.patch deleted file mode 100644 index 5e1095b..0000000 --- a/elfutils-0.137-fixes.patch +++ /dev/null @@ -1,174 +0,0 @@ ---- elfutils-0.137/libdwfl/ChangeLog -+++ elfutils-0.137/libdwfl/ChangeLog -@@ -1,3 +1,17 @@ -+2008-09-29 Roland McGrath -+ -+ * segment.c (insert): Must realloc DWFL->lookup_module here too. -+ (dwfl_report_segment): Clear DWFL->lookup_module before insert calls. -+ -+2008-08-28 Roland McGrath -+ -+ * segment.c (reify_segments): Fix last change. -+ -+2008-08-27 Roland McGrath -+ -+ * linux-proc-maps.c (read_proc_memory): Return 0 for EINVAL or EPERM -+ failure from pread64. -+ - 2008-08-26 Roland McGrath - - * segment.c (reify_segments): Insert a trailing segment for a module ---- elfutils-0.137/libdwfl/linux-proc-maps.c -+++ elfutils-0.137/libdwfl/linux-proc-maps.c -@@ -267,6 +267,9 @@ read_proc_memory (void *arg, void *data, - { - const int fd = *(const int *) arg; - ssize_t nread = pread64 (fd, data, maxread, (off64_t) address); -+ /* Some kernels don't actually let us do this read, ignore those errors. */ -+ if (nread < 0 && (errno == EINVAL || errno == EPERM)) -+ return 0; - if (nread > 0 && (size_t) nread < minread) - nread = 0; - return nread; ---- elfutils-0.137/libdwfl/segment.c -+++ elfutils-0.137/libdwfl/segment.c -@@ -83,12 +83,26 @@ insert (Dwfl *dwfl, size_t i, GElf_Addr - int *nsegndx = realloc (dwfl->lookup_segndx, sizeof nsegndx[0] * n); - if (unlikely (nsegndx == NULL)) - { -- free (naddr); -+ if (naddr != dwfl->lookup_addr) -+ free (naddr); - return true; - } - dwfl->lookup_alloc = n; - dwfl->lookup_addr = naddr; - dwfl->lookup_segndx = nsegndx; -+ -+ if (dwfl->lookup_module != NULL) -+ { -+ /* Make sure this array is big enough too. */ -+ Dwfl_Module **old = dwfl->lookup_module; -+ dwfl->lookup_module = realloc (dwfl->lookup_module, -+ sizeof dwfl->lookup_module[0] * n); -+ if (unlikely (dwfl->lookup_module == NULL)) -+ { -+ free (old); -+ return true; -+ } -+ } - } - - if (unlikely (i < dwfl->lookup_elts)) -@@ -175,9 +189,17 @@ reify_segments (Dwfl *dwfl) - return true; - ++idx; - } -+ else if (dwfl->lookup_addr[idx] < start) -+ { -+ /* The module starts past the end of this segment. -+ Add a new one. */ -+ if (unlikely (insert (dwfl, idx + 1, start, end, -1))) -+ return true; -+ ++idx; -+ } - -- if (((size_t) idx + 1 == dwfl->lookup_elts -- || end < dwfl->lookup_addr[idx + 1]) -+ if ((size_t) idx + 1 < dwfl->lookup_elts -+ && end < dwfl->lookup_addr[idx + 1] - /* The module ends in the middle of this segment. Split it. */ - && unlikely (insert (dwfl, idx + 1, - end, dwfl->lookup_addr[idx + 1], -1))) -@@ -261,6 +283,12 @@ dwfl_report_segment (Dwfl *dwfl, int ndx - phdr->p_align < dwfl->segment_align)) - dwfl->segment_align = phdr->p_align; - -+ if (unlikely (dwfl->lookup_module != NULL)) -+ { -+ free (dwfl->lookup_module); -+ dwfl->lookup_module = NULL; -+ } -+ - GElf_Addr start = segment_start (dwfl, bias + phdr->p_vaddr); - GElf_Addr end = segment_end (dwfl, bias + phdr->p_vaddr + phdr->p_memsz); - -@@ -289,12 +317,6 @@ dwfl_report_segment (Dwfl *dwfl, int ndx - dwfl->lookup_tail_offset = end - bias - phdr->p_vaddr + phdr->p_offset; - dwfl->lookup_tail_ndx = ndx + 1; - -- if (unlikely (dwfl->lookup_module != NULL)) -- { -- free (dwfl->lookup_module); -- dwfl->lookup_module = NULL; -- } -- - return ndx; - } - INTDEF (dwfl_report_segment) ---- elfutils-0.137/libelf/ChangeLog -+++ elfutils-0.137/libelf/ChangeLog -@@ -1,3 +1,9 @@ -+2008-08-27 Roland McGrath -+ -+ * elf_begin.c (get_shnum): Avoid misaligned reads for matching endian. -+ -+ * libelfP.h [!ALLOW_UNALIGNED] (__libelf_type_align): Fix CLASS index. -+ - 2008-08-25 Roland McGrath - - * Makefile.am (libelf_so_LDLIBS): New variable. ---- elfutils-0.137/libelf/elf_begin.c -+++ elfutils-0.137/libelf/elf_begin.c -@@ -111,7 +111,11 @@ get_shnum (void *map_address, unsigned c - bool is32 = e_ident[EI_CLASS] == ELFCLASS32; - - /* Make the ELF header available. */ -- if (e_ident[EI_DATA] == MY_ELFDATA) -+ if (e_ident[EI_DATA] == MY_ELFDATA -+ && (ALLOW_UNALIGNED -+ || (((size_t) e_ident -+ & ((is32 ? __alignof__ (Elf32_Ehdr) : __alignof__ (Elf64_Ehdr)) -+ - 1)) == 0))) - ehdr.p = e_ident; - else - { -@@ -130,8 +134,11 @@ get_shnum (void *map_address, unsigned c - else - memcpy (&ehdr_mem, e_ident, sizeof (Elf32_Ehdr)); - -- CONVERT (ehdr_mem.e32.e_shnum); -- CONVERT (ehdr_mem.e32.e_shoff); -+ if (e_ident[EI_DATA] != MY_ELFDATA) -+ { -+ CONVERT (ehdr_mem.e32.e_shnum); -+ CONVERT (ehdr_mem.e32.e_shoff); -+ } - } - else - { -@@ -143,8 +150,11 @@ get_shnum (void *map_address, unsigned c - else - memcpy (&ehdr_mem, e_ident, sizeof (Elf64_Ehdr)); - -- CONVERT (ehdr_mem.e64.e_shnum); -- CONVERT (ehdr_mem.e64.e_shoff); -+ if (e_ident[EI_DATA] != MY_ELFDATA) -+ { -+ CONVERT (ehdr_mem.e64.e_shnum); -+ CONVERT (ehdr_mem.e64.e_shoff); -+ } - } - } - ---- elfutils-0.137/libelf/libelfP.h -+++ elfutils-0.137/libelf/libelfP.h -@@ -460,7 +460,7 @@ extern const uint_fast8_t __libelf_type_ - version, binary class, and type. */ - extern const uint_fast8_t __libelf_type_aligns[EV_NUM - 1][ELFCLASSNUM - 1][ELF_T_NUM] attribute_hidden; - # define __libelf_type_align(class, type) \ -- (__libelf_type_aligns[LIBELF_EV_IDX][class][type] ?: 1) -+ (__libelf_type_aligns[LIBELF_EV_IDX][class - 1][type] ?: 1) - #else - # define __libelf_type_align(class, type) 1 - #endif diff --git a/elfutils-0.137-i386-rel-types.diff b/elfutils-0.137-i386-rel-types.diff deleted file mode 100644 index 9d1d436..0000000 --- a/elfutils-0.137-i386-rel-types.diff +++ /dev/null @@ -1,19 +0,0 @@ -From: Ulrich Drepper -Date: Sat, 4 Oct 2008 20:39:55 +0000 (+0000) -Subject: Fix some entries in i386_reloc.def. -X-Git-Url: http://git.fedorahosted.org/git/elfutils.git?p=elfutils.git;a=commitdiff_plain;h=a4c9d281616090c46ffc4fc3234d64e915008e1a - -Fix some entries in i386_reloc.def. ---- - -diff --git a/backends/i386_reloc.def b/backends/i386_reloc.def -index d8116f3..bc1b835 100644 ---- a/backends/i386_reloc.def -+++ b/backends/i386_reloc.def -@@ -61,3 +61,6 @@ RELOC_TYPE (TLS_LE_32, REL) - RELOC_TYPE (TLS_DTPMOD32, EXEC|DYN) - RELOC_TYPE (TLS_DTPOFF32, EXEC|DYN) - RELOC_TYPE (TLS_TPOFF32, EXEC|DYN) -+RELOC_TYPE (TLS_GOTDESC, REL) -+RELOC_TYPE (TLS_DESC_CALL, REL) -+RELOC_TYPE (TLS_DESC, EXEC) diff --git a/elfutils-0.137-main-bias-fix.diff b/elfutils-0.137-main-bias-fix.diff deleted file mode 100644 index 0adc4a6..0000000 --- a/elfutils-0.137-main-bias-fix.diff +++ /dev/null @@ -1,23 +0,0 @@ -From 74825c4d9d21ff8ba0828d1790879965764ddb01 Mon Sep 17 00:00:00 2001 -From: Roland McGrath -Date: Mon, 15 Dec 2008 19:33:33 -0800 -Subject: [PATCH] (dwfl_module_relocate_address): Apply main.bias, not debug.bias. - ---- - -diff --git a/libdwfl/derelocate.c b/libdwfl/derelocate.c -index 402bc06..7f390c7 100644 ---- a/libdwfl/derelocate.c -+++ b/libdwfl/derelocate.c -@@ -358,7 +358,7 @@ dwfl_module_relocate_address (Dwfl_Module *mod, Dwarf_Addr *addr) - - if (mod->e_type != ET_REL) - { -- *addr -= mod->debug.bias; -+ *addr -= mod->main.bias; - return 0; - } - --- -1.6.0.5 - diff --git a/elfutils-0.137-main-bias-fix2.diff b/elfutils-0.137-main-bias-fix2.diff deleted file mode 100644 index 3146b28..0000000 --- a/elfutils-0.137-main-bias-fix2.diff +++ /dev/null @@ -1,54 +0,0 @@ -commit 7d9b821db6bc494417a57321b419c6b9481a2128 -Author: Roland McGrath -Date: Thu Dec 18 15:08:09 2008 -0800 - - Fix last fix: ET_DYN addresses are taken as relative to MOD->low_addr. - - * derelocate.c (dwfl_module_relocate_address): Fix last fix: ET_DYN - addresses are taken as relative to MOD->low_addr. - ---- -diff --git a/libdwfl/derelocate.c b/libdwfl/derelocate.c -index 7f390c7..f2a6467 100644 ---- a/libdwfl/derelocate.c -+++ b/libdwfl/derelocate.c -@@ -238,6 +238,7 @@ dwfl_module_relocations (Dwfl_Module *mod) - return 1; - - case ET_EXEC: -+ assert (mod->main.bias == 0); - assert (mod->debug.bias == 0); - break; - } -@@ -353,16 +354,26 @@ find_section (Dwfl_Module *mod, Dwarf_Addr *addr) - int - dwfl_module_relocate_address (Dwfl_Module *mod, Dwarf_Addr *addr) - { -- if (check_module (mod)) -+ if (unlikely (check_module (mod))) - return -1; - -- if (mod->e_type != ET_REL) -+ switch (mod->e_type) - { -- *addr -= mod->main.bias; -- return 0; -+ case ET_REL: -+ return find_section (mod, addr); -+ -+ case ET_DYN: -+ /* All relative to first and only relocation base: module start. */ -+ *addr -= mod->low_addr; -+ break; -+ -+ default: -+ /* Already absolute, dwfl_module_relocations returned zero. We -+ shouldn't really have been called, but it's a harmless no-op. */ -+ break; - } - -- return find_section (mod, addr); -+ return 0; - } - INTDEF (dwfl_module_relocate_address) - diff --git a/elfutils-0.137-nm-crash-fix.diff b/elfutils-0.137-nm-crash-fix.diff deleted file mode 100644 index 92cee3b..0000000 --- a/elfutils-0.137-nm-crash-fix.diff +++ /dev/null @@ -1,121 +0,0 @@ -From 468fe4d81a3e92157f4c0446675487dc230b2ec6 Mon Sep 17 00:00:00 2001 -From: Roland McGrath -Date: Thu, 11 Dec 2008 21:00:12 -0800 -Subject: [PATCH] Fix crashes on bad sh_name/st_name offsets. - ---- - -diff --git a/src/nm.c b/src/nm.c -index 1bef49f..9fdf0cc 100644 ---- a/src/nm.c -+++ b/src/nm.c -@@ -1,5 +1,5 @@ - /* Print symbol information from ELF file in human-readable form. -- Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc. -+ Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007,2008 Red Hat, Inc. - This file is part of Red Hat elfutils. - Written by Ulrich Drepper , 2000. - -@@ -703,6 +703,18 @@ get_local_names (Dwarf *dbg) - } - } - -+/* Do elf_strptr, but return a backup string and never NULL. */ -+static const char * -+sym_name (Elf *elf, GElf_Word strndx, GElf_Word st_name, char buf[], size_t n) -+{ -+ const char *symstr = elf_strptr (elf, strndx, st_name); -+ if (symstr == NULL) -+ { -+ snprintf (buf, n, "[invalid st_name %#" PRIx32 "]", st_name); -+ symstr = buf; -+ } -+ return symstr; -+} - - /* Show symbols in SysV format. */ - static void -@@ -736,9 +748,15 @@ show_symbols_sysv (Ebl *ebl, GElf_Word strndx, - - assert (elf_ndxscn (scn) == cnt++); - -- scnnames[elf_ndxscn (scn)] -- = elf_strptr (ebl->elf, shstrndx, -- gelf_getshdr (scn, &shdr_mem)->sh_name); -+ char *name = elf_strptr (ebl->elf, shstrndx, -+ gelf_getshdr (scn, &shdr_mem)->sh_name); -+ if (unlikely (name == NULL)) -+ { -+ name = alloca (sizeof "[invalid sh_name 0x12345678]"); -+ snprintf (name, sizeof name, "[invalid sh_name %#" PRIx32 "]", -+ gelf_getshdr (scn, &shdr_mem)->sh_name); -+ } -+ scnnames[elf_ndxscn (scn)] = name; - } - - int digits = length_map[gelf_getclass (ebl->elf) - 1][radix]; -@@ -772,8 +790,10 @@ show_symbols_sysv (Ebl *ebl, GElf_Word strndx, - /* Iterate over all symbols. */ - for (cnt = 0; cnt < nsyms; ++cnt) - { -- const char *symstr = elf_strptr (ebl->elf, strndx, -- syms[cnt].sym.st_name); -+ char symstrbuf[50]; -+ const char *symstr = sym_name (ebl->elf, strndx, syms[cnt].sym.st_name, -+ symstrbuf, sizeof symstrbuf); -+ - char symbindbuf[50]; - char symtypebuf[50]; - char secnamebuf[1024]; -@@ -850,7 +870,9 @@ show_symbols_bsd (Elf *elf, GElf_Word strndx, - /* Iterate over all symbols. */ - for (size_t cnt = 0; cnt < nsyms; ++cnt) - { -- const char *symstr = elf_strptr (elf, strndx, syms[cnt].sym.st_name); -+ char symstrbuf[50]; -+ const char *symstr = sym_name (elf, strndx, syms[cnt].sym.st_name, -+ symstrbuf, sizeof symstrbuf); - - /* Printing entries with a zero-length name makes the output - not very well parseable. Since these entries don't carry -@@ -872,7 +894,7 @@ show_symbols_bsd (Elf *elf, GElf_Word strndx, - ? (GELF_ST_BIND (syms[cnt].sym.st_info) == STB_WEAK - ? "*" : " ") - : "", -- elf_strptr (elf, strndx, syms[cnt].sym.st_name)); -+ symstr); - else - printf (print_size ? sfmtstrs[radix] : fmtstrs[radix], - digits, syms[cnt].sym.st_value, -@@ -881,7 +903,7 @@ show_symbols_bsd (Elf *elf, GElf_Word strndx, - ? (GELF_ST_BIND (syms[cnt].sym.st_info) == STB_WEAK - ? "*" : " ") - : "", -- elf_strptr (elf, strndx, syms[cnt].sym.st_name), -+ symstr, - digits, (uint64_t) syms[cnt].sym.st_size); - } - } -@@ -907,7 +929,9 @@ show_symbols_posix (Elf *elf, GElf_Word strndx, const char *prefix, - /* Iterate over all symbols. */ - for (size_t cnt = 0; cnt < nsyms; ++cnt) - { -- const char *symstr = elf_strptr (elf, strndx, syms[cnt].sym.st_name); -+ char symstrbuf[50]; -+ const char *symstr = sym_name (elf, strndx, syms[cnt].sym.st_name, -+ symstrbuf, sizeof symstrbuf); - - /* Printing entries with a zero-length name makes the output - not very well parseable. Since these entries don't carry -@@ -1056,6 +1080,8 @@ show_symbols (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, Elf_Scn *xndxscn, - { - const char *symstr = elf_strptr (ebl->elf, shdr->sh_link, - sym->st_name); -+ if (symstr == NULL) -+ continue; - - longest_name = MAX ((size_t) longest_name, strlen (symstr)); - --- -1.6.0.5 - diff --git a/elfutils-0.137-no-osl.tar.bz2 b/elfutils-0.137-no-osl.tar.bz2 deleted file mode 100644 index 107d109..0000000 --- a/elfutils-0.137-no-osl.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:31018476df6ebcb9b52af698c62c6e626992555fa3e81e24d9b8c59400225d88 -size 1436096 diff --git a/elfutils-0.137-readelf-crash-fix.diff b/elfutils-0.137-readelf-crash-fix.diff deleted file mode 100644 index 314d5e9..0000000 --- a/elfutils-0.137-readelf-crash-fix.diff +++ /dev/null @@ -1,49 +0,0 @@ -From b28a894209451b93ba830f56e40871e44e9c7c28 Mon Sep 17 00:00:00 2001 -From: Roland McGrath -Date: Thu, 11 Dec 2008 02:09:28 -0800 -Subject: [PATCH] Fixes RHBZ#465878: eu-readelf crash on empty archive - ---- - -diff --git a/libdwfl/offline.c b/libdwfl/offline.c -index ff7b793..b3a95dd 100644 ---- a/libdwfl/offline.c -+++ b/libdwfl/offline.c -@@ -1,5 +1,5 @@ - /* Recover relocatibility for addresses computed from debug information. -- Copyright (C) 2005, 2006, 2007 Red Hat, Inc. -+ Copyright (C) 2005, 2006, 2007, 2008 Red Hat, Inc. - This file is part of Red Hat elfutils. - - Red Hat elfutils is free software; you can redistribute it and/or modify -@@ -259,16 +259,23 @@ process_archive (Dwfl *dwfl, const char *name, const char *file_name, int fd, - - { - Dwfl_Module *mod = NULL; -+ Elf *member = elf_begin (fd, ELF_C_READ_MMAP_PRIVATE, archive); -+ if (unlikely (member == NULL)) /* Empty archive. */ -+ { -+ __libdwfl_seterrno (DWFL_E_BADELF); -+ return NULL; -+ } -+ - while (process_archive_member (dwfl, name, file_name, predicate, -- fd, elf_begin (fd, ELF_C_READ_MMAP_PRIVATE, -- archive), &mod) != ELF_C_NULL) -- ; -+ fd, member, &mod) != ELF_C_NULL) -+ member = elf_begin (fd, ELF_C_READ_MMAP_PRIVATE, archive); - - /* We can drop the archive Elf handle even if we're still using members - in live modules. When the last module's elf_end on a member returns - zero, that module will close FD. If no modules survived the predicate, - we are all done with the file right here. */ -- if (elf_end (archive) == 0) -+ if (mod != NULL /* If no modules, caller will clean up. */ -+ && elf_end (archive) == 0) - close (fd); - - return mod; --- -1.6.0.5 - diff --git a/elfutils-0.140-no-osl.tar.bz2 b/elfutils-0.140-no-osl.tar.bz2 new file mode 100644 index 0000000..f75d1ff --- /dev/null +++ b/elfutils-0.140-no-osl.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ffff6bf5431e609f647ffa48e26a3972a5335bf614ca9019480d9a7f9754c515 +size 1476584 diff --git a/elfutils-old-scanf-fix.diff b/elfutils-old-scanf-fix.diff new file mode 100644 index 0000000..28dfd35 --- /dev/null +++ b/elfutils-old-scanf-fix.diff @@ -0,0 +1,30 @@ +--- src/addr2line.c-dist 2008-12-05 08:42:12.000000000 +0100 ++++ src/addr2line.c 2008-12-05 08:45:22.000000000 +0100 +@@ -373,8 +373,8 @@ handle_address (const char *string, Dwfl + { + bool parsed = false; + int n; +- char *name = NULL; +- if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &n) == 2 ++ char name[4096]; /* FIXME */ ++ if (sscanf (string, "(%[^)])%" PRIiMAX "%n", name, &addr, &n) == 2 + && string[n] == '\0') + { + /* It was (section)+offset. This makes sense if there is +@@ -415,7 +415,7 @@ handle_address (const char *string, Dwfl + } + } + } +- else if (sscanf (string, "%m[^-+]%" PRIiMAX "%n", &name, &addr, &n) == 2 ++ else if (sscanf (string, "%[^-+]%" PRIiMAX "%n", name, &addr, &n) == 2 + && string[n] == '\0') + { + /* It was symbol+offset. */ +@@ -436,7 +436,6 @@ handle_address (const char *string, Dwfl + } + } + +- free (name); + if (!parsed) + return 1; + } diff --git a/elfutils-portability.patch b/elfutils-portability.patch index 3aabe2a..6b37848 100644 --- a/elfutils-portability.patch +++ b/elfutils-portability.patch @@ -1,6 +1,17 @@ --- elfutils/backends/ChangeLog +++ elfutils/backends/ChangeLog -@@ -315,6 +315,11 @@ +@@ -3,6 +3,10 @@ + * ppc_attrs.c (ppc_check_object_attribute): Handle tag + GNU_Power_ABI_Struct_Return. + ++2009-01-23 Roland McGrath ++ ++ * Makefile.am (libebl_%.so): Use $(LD_AS_NEEDED). ++ + 2008-10-04 Ulrich Drepper + + * i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and +@@ -330,6 +334,11 @@ * sparc_init.c: Likewise. * x86_64_init.c: Likewise. @@ -12,7 +23,7 @@ 2005-11-19 Roland McGrath * ppc64_reloc.def: REL30 -> ADDR30. -@@ -337,6 +342,9 @@ +@@ -352,6 +361,9 @@ * Makefile.am (uninstall): Don't try to remove $(pkgincludedir). (CLEANFILES): Add libebl_$(m).so. @@ -24,6 +35,14 @@ --- elfutils/backends/Makefile.am +++ elfutils/backends/Makefile.am +@@ -1,6 +1,6 @@ + ## Process this file with automake to create Makefile.in + ## +-## Copyright (C) 2000-2006, 2007, 2008 Red Hat, Inc. ++## Copyright (C) 2000-2006, 2007, 2008, 2009 Red Hat, Inc. + ## This file is part of Red Hat elfutils. + ## + ## Red Hat elfutils is free software; you can redistribute it and/or modify @@ -25,12 +25,14 @@ ## . ## @@ -48,9 +67,18 @@ i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c \ i386_retval.c i386_regs.c i386_auxv.c i386_syscall.c cpu_i386 = ../libcpu/libcpu_i386.a +@@ -114,7 +115,7 @@ libebl_%.so: libebl_%_pic.a libebl_%.map + $(LINK) -shared -o $@ -Wl,--whole-archive,$<\ + $(cpu_$(@:libebl_%.so=%)) -Wl,--no-whole-archive \ + -Wl,--version-script,$(word 2,$^) \ +- -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap) ++ -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap) + $(textrel_check) + + # XXX Should not be needed... --- elfutils/backends/Makefile.in +++ elfutils/backends/Makefile.in -@@ -155,6 +155,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -156,6 +156,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -58,7 +86,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -184,6 +185,7 @@ SHELL = @SHELL@ +@@ -185,6 +186,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -66,9 +94,9 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -239,9 +241,9 @@ target_alias = @target_alias@ - top_builddir = @top_builddir@ +@@ -243,9 +245,9 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ + zip_LIBS = @zip_LIBS@ @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \ -@MUDFLAP_FALSE@ -Wextra -Wformat=2 -std=gnu99 +@MUDFLAP_FALSE@ $(WEXTRA) -Wformat=2 -std=gnu99 @@ -78,9 +106,26 @@ INCLUDES = -I$(srcdir) -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \ -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \ -I$(top_srcdir)/lib -I.. +@@ -641,7 +643,7 @@ libebl_%.so: libebl_%_pic.a libebl_%.map + $(LINK) -shared -o $@ -Wl,--whole-archive,$<\ + $(cpu_$(@:libebl_%.so=%)) -Wl,--no-whole-archive \ + -Wl,--version-script,$(word 2,$^) \ +- -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap) ++ -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap) + $(textrel_check) + + # XXX Should not be needed... --- elfutils/ChangeLog +++ elfutils/ChangeLog -@@ -39,6 +39,10 @@ +@@ -1,5 +1,7 @@ + 2009-01-23 Roland McGrath + ++ * configure.ac: Check for __builtin_popcount. ++ + * configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3. + + * configure.ac (__thread check): Use AC_LINK_IFELSE, in case of +@@ -80,6 +82,10 @@ * configure.ac: Add dummy automake conditional to get dependencies for non-generic linker right. See src/Makefile.am. @@ -91,7 +136,7 @@ 2005-11-18 Roland McGrath * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable. -@@ -86,6 +90,17 @@ +@@ -127,6 +133,17 @@ * Makefile.am (all_SUBDIRS): Add libdwfl. * configure.ac: Write libdwfl/Makefile. @@ -99,19 +144,19 @@ + + * configure.ac (WEXTRA): Check for -Wextra and set this substitution. + -+ * configure.ac: Check for struct stat st_?tim members. -+ * src/strip.c (process_file): Use st_?time if st_?tim are not there. ++ * configure.ac: Check for struct stat st_?tim members. ++ * src/strip.c (process_file): Use st_?time if st_?tim are not there. + -+ * configure.ac: Check for futimes function. -+ * src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead. -+ (handle_ar) [! HAVE_FUTIMES]: Likewise. ++ * configure.ac: Check for futimes function. ++ * src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead. ++ (handle_ar) [! HAVE_FUTIMES]: Likewise. + 2005-05-19 Roland McGrath * configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros. --- elfutils/config/Makefile.in +++ elfutils/config/Makefile.in -@@ -72,6 +72,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -73,6 +73,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -119,7 +164,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -101,6 +102,7 @@ SHELL = @SHELL@ +@@ -102,6 +103,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -127,25 +172,44 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ +--- elfutils/config.h.in ++++ elfutils/config.h.in +@@ -1,5 +1,8 @@ + /* config.h.in. Generated from configure.ac by autoheader. */ + ++/* Have __builtin_popcount. */ ++#undef HAVE_BUILTIN_POPCOUNT ++ + /* $libdir subdirectory containing libebl modules. */ + #undef LIBEBL_SUBDIR + +@@ -52,4 +55,7 @@ + /* Define for large files, on AIX-style hosts. */ + #undef _LARGE_FILES + ++/* Stubbed out if missing compiler support. */ ++#undef __thread ++ + #include --- elfutils/configure +++ elfutils/configure -@@ -676,6 +676,8 @@ YFLAGS - LEX - LEX_OUTPUT_ROOT - LEXLIB -+WEXTRA -+LD_AS_NEEDED - LOCALEDIR - DATADIRNAME +@@ -642,6 +642,8 @@ NATIVE_LD_FALSE NATIVE_LD_TRUE -@@ -3894,6 +3896,88 @@ echo "$as_me: error: gcc with C99 suppor + DATADIRNAME + LOCALEDIR ++LD_AS_NEEDED ++WEXTRA + LEXLIB + LEX_OUTPUT_ROOT + LEX +@@ -4041,6 +4043,152 @@ $as_echo "$as_me: error: gcc with C99 su fi -+{ echo "$as_me:$LINENO: checking for -Wextra option to $CC" >&5 -+echo $ECHO_N "checking for -Wextra option to $CC... $ECHO_C" >&6; } ++{ $as_echo "$as_me:$LINENO: checking for -Wextra option to $CC" >&5 ++$as_echo_n "checking for -Wextra option to $CC... " >&6; } +if test "${ac_cv_cc_wextra+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 ++ $as_echo_n "(cached) " >&6 +else + old_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wextra" @@ -158,20 +222,21 @@ + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac -+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" ++$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_cc_wextra=yes +else -+ echo "$as_me: failed program was:" >&5 ++ $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_cc_wextra=no @@ -180,8 +245,8 @@ +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CFLAGS="$old_CFLAGS" +fi -+{ echo "$as_me:$LINENO: result: $ac_cv_cc_wextra" >&5 -+echo "${ECHO_T}$ac_cv_cc_wextra" >&6; } ++{ $as_echo "$as_me:$LINENO: result: $ac_cv_cc_wextra" >&5 ++$as_echo "$ac_cv_cc_wextra" >&6; } + +if test "x$ac_cv_cc_wextra" = xyes; then + WEXTRA=-Wextra @@ -190,10 +255,10 @@ +fi + + -+{ echo "$as_me:$LINENO: checking for --as-needed linker option" >&5 -+echo $ECHO_N "checking for --as-needed linker option... $ECHO_C" >&6; } ++{ $as_echo "$as_me:$LINENO: checking for --as-needed linker option" >&5 ++$as_echo_n "checking for --as-needed linker option... " >&6; } +if test "${ac_cv_as_needed+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 ++ $as_echo_n "(cached) " >&6 +else + cat > conftest.c <&5 + (eval $ac_try) 2>&5 + ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } +then + ac_cv_as_needed=yes @@ -213,8 +278,8 @@ +fi +rm -f conftest* +fi -+{ echo "$as_me:$LINENO: result: $ac_cv_as_needed" >&5 -+echo "${ECHO_T}$ac_cv_as_needed" >&6; } ++{ $as_echo "$as_me:$LINENO: result: $ac_cv_as_needed" >&5 ++$as_echo "$ac_cv_as_needed" >&6; } +if test "x$ac_cv_as_needed" = xyes; then + LD_AS_NEEDED=-Wl,--as-needed +else @@ -223,42 +288,97 @@ + + + ++{ $as_echo "$as_me:$LINENO: checking for __builtin_popcount" >&5 ++$as_echo_n "checking for __builtin_popcount... " >&6; } ++if test "${ac_cv_popcount+set}" = set; then ++ $as_echo_n "(cached) " >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ + - LOCALEDIR=$datadir ++int ++main () ++{ ++exit (__builtin_popcount (127)); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (ac_try="$ac_link" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" ++$as_echo "$ac_try_echo") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && { ++ test "$cross_compiling" = yes || ++ $as_test_x conftest$ac_exeext ++ }; then ++ ac_cv_popcount=yes ++else ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_popcount=no ++fi ++ ++rm -rf conftest.dSYM ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:$LINENO: result: $ac_cv_popcount" >&5 ++$as_echo "$ac_cv_popcount" >&6; } ++if test "x$ac_cv_popcount" = xyes; then ++ ++cat >>confdefs.h <<\_ACEOF ++#define HAVE_BUILTIN_POPCOUNT 1 ++_ACEOF ++ ++fi ++ ++ + { $as_echo "$as_me:$LINENO: checking for __thread support" >&5 + $as_echo_n "checking for __thread support... " >&6; } + if test "${ac_cv_tls+set}" = set; then +@@ -4106,9 +4254,18 @@ fi + { $as_echo "$as_me:$LINENO: result: $ac_cv_tls" >&5 + $as_echo "$ac_cv_tls" >&6; } + if test "x$ac_cv_tls" != xyes; then +- { { $as_echo "$as_me:$LINENO: error: __thread support required" >&5 +-$as_echo "$as_me: error: __thread support required" >&2;} ++ if test "$use_locks" = yes; then ++ { { $as_echo "$as_me:$LINENO: error: --enable-thread-safety requires __thread support" >&5 ++$as_echo "$as_me: error: --enable-thread-safety requires __thread support" >&2;} + { (exit 1); exit 1; }; } ++else ++ ++cat >>confdefs.h <<\_ACEOF ++#define __thread /* empty: no multi-thread support */ ++_ACEOF ++ ++fi ++ + fi - cat >>confdefs.h <<_ACEOF -@@ -5646,8 +5730,8 @@ YFLAGS!$YFLAGS$ac_delim - LEX!$LEX$ac_delim - LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim - LEXLIB!$LEXLIB$ac_delim --LOCALEDIR!$LOCALEDIR$ac_delim --DATADIRNAME!$DATADIRNAME$ac_delim -+WEXTRA!$WEXTRA$ac_delim -+LD_AS_NEEDED!$LD_AS_NEEDED$ac_delim - _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then -@@ -5689,6 +5773,8 @@ _ACEOF - ac_delim='%!_!# ' - for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -+LOCALEDIR!$LOCALEDIR$ac_delim -+DATADIRNAME!$DATADIRNAME$ac_delim - NATIVE_LD_TRUE!$NATIVE_LD_TRUE$ac_delim - NATIVE_LD_FALSE!$NATIVE_LD_FALSE$ac_delim - base_cpu!$base_cpu$ac_delim -@@ -5722,7 +5808,7 @@ LIBOBJS!$LIBOBJS$ac_delim - LTLIBOBJS!$LTLIBOBJS$ac_delim - _ACEOF - -- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 31; then -+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 33; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 --- elfutils/configure.ac +++ elfutils/configure.ac -@@ -74,6 +74,34 @@ CFLAGS="$old_CFLAGS"]) +@@ -74,6 +74,39 @@ CFLAGS="$old_CFLAGS"]) AS_IF([test "x$ac_cv_c99" != xyes], AC_MSG_ERROR([gcc with C99 support required])) @@ -289,13 +409,39 @@ + [LD_AS_NEEDED=-Wl,--as-needed], [LD_AS_NEEDED=]) +AC_SUBST(LD_AS_NEEDED) + ++AC_CACHE_CHECK([for __builtin_popcount], ac_cv_popcount, [dnl ++AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[exit (__builtin_popcount (127));]])], ++ ac_cv_popcount=yes, ac_cv_popcount=no)]) ++AS_IF([test "x$ac_cv_popcount" = xyes], ++ [AC_DEFINE([HAVE_BUILTIN_POPCOUNT], [1], [Have __builtin_popcount.])]) + + AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl + # Use the same flags that we use for our DSOs, so the test is representative. + # Some old compiler/linker/libc combinations fail some ways and not others. +@@ -89,7 +122,10 @@ static __thread int a; int foo (int b) { + CFLAGS="$save_CFLAGS" + LDFLAGS="$save_LDFLAGS"]) + AS_IF([test "x$ac_cv_tls" != xyes], +- AC_MSG_ERROR([__thread support required])) ++ [AS_IF([test "$use_locks" = yes], ++ [AC_MSG_ERROR([--enable-thread-safety requires __thread support])], ++ [AC_DEFINE([__thread], [/* empty: no multi-thread support */], ++ [Stubbed out if missing compiler support.])])]) + LOCALEDIR=$datadir AC_SUBST(LOCALEDIR) - AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR") --- elfutils/lib/ChangeLog +++ elfutils/lib/ChangeLog -@@ -41,6 +41,11 @@ +@@ -1,5 +1,8 @@ + 2009-01-23 Roland McGrath + ++ * eu-config.h [! HAVE_BUILTIN_POPCOUNT] ++ (__builtin_popcount): New inline function. ++ + * eu-config.h: Add multiple inclusion protection. + + 2009-01-17 Ulrich Drepper +@@ -56,6 +59,11 @@ * Makefile.am (libeu_a_SOURCES): Add it. * system.h: Declare crc32_file. @@ -307,6 +453,25 @@ 2005-04-30 Ulrich Drepper * Makefile.am: Use -ffunction-sections for xmalloc.c. +--- elfutils/lib/eu-config.h ++++ elfutils/lib/eu-config.h +@@ -182,5 +182,16 @@ asm (".section predict_data, \"aw\"; .pr + /* This macro is used by the tests conditionalize for standalone building. */ + #define ELFUTILS_HEADER(name) + ++#ifndef HAVE_BUILTIN_POPCOUNT ++# define __builtin_popcount hakmem_popcount ++static inline unsigned int __attribute__ ((unused)) ++hakmem_popcount (unsigned int x) ++{ ++ /* HAKMEM 169 */ ++ unsigned int n = x - ((x >> 1) & 033333333333) - ((x >> 2) & 011111111111); ++ return ((n + (n >> 3)) & 030707070707) % 63; ++} ++#endif /* HAVE_BUILTIN_POPCOUNT */ ++ + + #endif /* eu-config.h */ --- elfutils/lib/Makefile.am +++ elfutils/lib/Makefile.am @@ -25,12 +25,13 @@ @@ -326,7 +491,7 @@ noinst_LIBRARIES = libeu.a --- elfutils/lib/Makefile.in +++ elfutils/lib/Makefile.in -@@ -93,6 +93,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -94,6 +94,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -334,7 +499,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -122,6 +123,7 @@ SHELL = @SHELL@ +@@ -123,6 +124,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -342,9 +507,9 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -177,9 +179,9 @@ target_alias = @target_alias@ - top_builddir = @top_builddir@ +@@ -181,9 +183,9 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ + zip_LIBS = @zip_LIBS@ @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \ -@MUDFLAP_FALSE@ -Wextra $($(*F)_CFLAGS) +@MUDFLAP_FALSE@ $(WEXTRA) $($(*F)_CFLAGS) @@ -356,7 +521,7 @@ libeu_a_SOURCES = xstrndup.c xmalloc.c next_prime.c \ --- elfutils/libasm/ChangeLog +++ elfutils/libasm/ChangeLog -@@ -54,6 +54,11 @@ +@@ -63,6 +63,11 @@ * asm_error.c: Add new error ASM_E_IOERROR. * libasmP.h: Add ASM_E_IOERROR definition. @@ -387,7 +552,7 @@ -I$(top_srcdir)/lib --- elfutils/libasm/Makefile.in +++ elfutils/libasm/Makefile.in -@@ -126,6 +126,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -128,6 +128,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -395,7 +560,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -155,6 +156,7 @@ SHELL = @SHELL@ +@@ -157,6 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = 1 @@ -403,9 +568,9 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -210,9 +212,9 @@ target_alias = @target_alias@ - top_builddir = @top_builddir@ +@@ -215,9 +217,9 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ + zip_LIBS = @zip_LIBS@ @MUDFLAP_FALSE@AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Werror -Wunused \ -@MUDFLAP_FALSE@ -Wextra -Wformat=2 +@MUDFLAP_FALSE@ $(WEXTRA) -Wformat=2 @@ -417,7 +582,16 @@ -I$(top_srcdir)/lib --- elfutils/libcpu/ChangeLog +++ elfutils/libcpu/ChangeLog -@@ -265,6 +265,11 @@ +@@ -1,5 +1,8 @@ + 2009-01-23 Roland McGrath + ++ * i386_disasm.c (i386_disasm): Add abort after assert-constant for old ++ compilers that don't realize it's noreturn. ++ + * Makefile.am (i386_parse_CFLAGS): Use quotes around command + substitution that can produce leading whitespace. + +@@ -329,6 +332,11 @@ * defs/i386.doc: New file. * defs/x86_64: New file. @@ -429,6 +603,16 @@ 2005-02-15 Ulrich Drepper * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2. +--- elfutils/libcpu/i386_disasm.c ++++ elfutils/libcpu/i386_disasm.c +@@ -791,6 +791,7 @@ i386_disasm (const uint8_t **startp, con + + default: + assert (! "INVALID not handled"); ++ abort (); + } + } + else --- elfutils/libcpu/Makefile.am +++ elfutils/libcpu/Makefile.am @@ -30,7 +30,8 @@ AM_CFLAGS = -fmudflap @@ -443,7 +627,7 @@ INCLUDES = -I$(srcdir) -I$(srcdir)/../lib -I$(srcdir)/../libelf \ --- elfutils/libcpu/Makefile.in +++ elfutils/libcpu/Makefile.in -@@ -109,6 +109,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -110,6 +110,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -451,7 +635,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = lex.$( @@ -508,7 +692,7 @@ --- elfutils/libdw/Makefile.in +++ elfutils/libdw/Makefile.in -@@ -164,6 +164,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -165,6 +165,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -516,7 +700,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -193,6 +194,7 @@ SHELL = @SHELL@ +@@ -194,6 +195,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = 1 @@ -524,9 +708,9 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -248,9 +250,10 @@ target_alias = @target_alias@ - top_builddir = @top_builddir@ +@@ -252,9 +254,10 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ + zip_LIBS = @zip_LIBS@ @MUDFLAP_FALSE@AM_CFLAGS = $(am__append_1) -Wall -Werror -Wshadow \ -@MUDFLAP_FALSE@ -Wunused -Wformat=2 -Wextra -std=gnu99 +@MUDFLAP_FALSE@ -Wunused -Wformat=2 $(WEXTRA) -std=gnu99 @@ -539,7 +723,7 @@ $(COMPILE))) --- elfutils/libdwfl/ChangeLog +++ elfutils/libdwfl/ChangeLog -@@ -885,6 +885,11 @@ +@@ -1013,6 +1013,11 @@ 2005-07-21 Roland McGrath @@ -570,7 +754,7 @@ VERSION = 1 --- elfutils/libdwfl/Makefile.in +++ elfutils/libdwfl/Makefile.in -@@ -131,6 +131,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -155,6 +155,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -578,7 +762,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -160,6 +161,7 @@ SHELL = @SHELL@ +@@ -184,6 +185,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = 1 @@ -586,9 +770,9 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -215,9 +217,9 @@ target_alias = @target_alias@ - top_builddir = @top_builddir@ +@@ -242,9 +244,9 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ + zip_LIBS = @zip_LIBS@ @MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wshadow -Wunused -Wformat=2 \ -@MUDFLAP_FALSE@ -Wextra -std=gnu99 +@MUDFLAP_FALSE@ $(WEXTRA) -std=gnu99 @@ -600,7 +784,7 @@ --- elfutils/libebl/ChangeLog +++ elfutils/libebl/ChangeLog -@@ -554,6 +554,11 @@ +@@ -563,6 +563,11 @@ * Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency tracking works right. @@ -631,7 +815,7 @@ INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \ --- elfutils/libebl/Makefile.in +++ elfutils/libebl/Makefile.in -@@ -123,6 +123,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -124,6 +124,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -639,7 +823,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -152,6 +153,7 @@ SHELL = @SHELL@ +@@ -153,6 +154,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = 1 @@ -647,9 +831,9 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -207,9 +209,9 @@ target_alias = @target_alias@ - top_builddir = @top_builddir@ +@@ -211,9 +213,9 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ + zip_LIBS = @zip_LIBS@ @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \ -@MUDFLAP_FALSE@ -Wextra -Wformat=2 -std=gnu99 +@MUDFLAP_FALSE@ $(WEXTRA) -Wformat=2 -std=gnu99 @@ -661,18 +845,18 @@ --- elfutils/libelf/ChangeLog +++ elfutils/libelf/ChangeLog -@@ -408,6 +408,11 @@ - If section content hasn't been read yet, do it before looking for the - block size. If no section data present, infer size of section header. +@@ -529,6 +529,11 @@ + + * elf.h: Update from glibc. +2005-05-31 Roland McGrath + + * Makefile.am (WEXTRA): New variable, substituted by configure. + (AM_CFLAGS): Use it in place of -Wextra. + - 2005-05-11 Ulrich Drepper + 2005-05-08 Roland McGrath - * elf.h: Update again. + * elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now. --- elfutils/libelf/common.h +++ elfutils/libelf/common.h @@ -160,7 +160,7 @@ libelf_release_all (Elf *elf) @@ -714,7 +898,7 @@ GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include) --- elfutils/libelf/Makefile.in +++ elfutils/libelf/Makefile.in -@@ -171,6 +171,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -172,6 +172,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -722,7 +906,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -200,6 +201,7 @@ SHELL = @SHELL@ +@@ -201,6 +202,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = 1 @@ -730,9 +914,9 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -255,10 +257,10 @@ target_alias = @target_alias@ - top_builddir = @top_builddir@ +@@ -259,10 +261,10 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ + zip_LIBS = @zip_LIBS@ @MUDFLAP_FALSE@AM_CFLAGS = $(am__append_1) -Wall -Wshadow -Werror \ -@MUDFLAP_FALSE@ -Wunused -Wextra -Wformat=2 -std=gnu99 \ +@MUDFLAP_FALSE@ -Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \ @@ -745,7 +929,7 @@ GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include) --- elfutils/m4/Makefile.in +++ elfutils/m4/Makefile.in -@@ -71,6 +71,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -72,6 +72,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -753,7 +937,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -100,6 +101,7 @@ SHELL = @SHELL@ +@@ -101,6 +102,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -763,7 +947,7 @@ YACC = @YACC@ --- elfutils/Makefile.in +++ elfutils/Makefile.in -@@ -98,6 +98,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -110,6 +110,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -771,7 +955,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -127,6 +128,7 @@ SHELL = @SHELL@ +@@ -139,6 +140,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -781,7 +965,16 @@ YACC = @YACC@ --- elfutils/src/ChangeLog +++ elfutils/src/ChangeLog -@@ -61,6 +61,11 @@ +@@ -62,6 +62,8 @@ + * readelf.c (print_debug_frame_section): Use t instead of j formats + for ptrdiff_t OFFSET. + ++ * addr2line.c (handle_address): Use %a instead of %m for compatibility. ++ + 2009-01-21 Ulrich Drepper + + * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section +@@ -245,6 +247,11 @@ that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really is valid in RELRO. @@ -793,7 +986,7 @@ 2008-02-29 Roland McGrath * readelf.c (print_attributes): Add a cast. -@@ -312,6 +317,8 @@ +@@ -496,6 +503,8 @@ * readelf.c (hex_dump): Fix rounding error in whitespace calculation. @@ -802,7 +995,7 @@ 2007-10-15 Roland McGrath * make-debug-archive.in: New file. -@@ -751,6 +758,10 @@ +@@ -935,6 +944,10 @@ * elflint.c (valid_e_machine): Add EM_ALPHA. Reported by Christian Aichinger . @@ -813,7 +1006,7 @@ 2006-08-08 Ulrich Drepper * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB. -@@ -827,6 +838,10 @@ +@@ -1011,6 +1024,10 @@ * Makefile.am: Add hacks to create dependency files for non-generic linker. @@ -824,7 +1017,7 @@ 2006-06-12 Ulrich Drepper * ldgeneric.c (ld_generic_generate_sections): Don't create .interp -@@ -1175,6 +1190,11 @@ +@@ -1359,6 +1376,11 @@ * readelf.c (print_debug_loc_section): Fix indentation for larger address size. @@ -838,7 +1031,7 @@ * readelf.c (print_debug_line_section): Print section offset of each --- elfutils/src/findtextrel.c +++ elfutils/src/findtextrel.c -@@ -488,7 +488,11 @@ ptrcompare (const void *p1, const void * +@@ -490,7 +490,11 @@ ptrcompare (const void *p1, const void * static void @@ -867,10 +1060,10 @@ $(if $($(*F)_no_Werror),,-Werror) \ - $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ + $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \ - $(if $($(*F)_no_Wformat),,-Wformat=2) $(CFLAGS_$(*F)) + $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $(CFLAGS_$(*F)) INCLUDES = -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \ -@@ -111,6 +112,9 @@ strings_no_Wformat = yes +@@ -112,6 +113,9 @@ addr2line_no_Wformat = yes # XXX While the file is not finished, don't warn about this ldgeneric_no_Wunused = yes @@ -882,7 +1075,7 @@ size_LDADD = $(libelf) $(libeu) $(libmudflap) --- elfutils/src/Makefile.in +++ elfutils/src/Makefile.in -@@ -201,6 +201,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -202,6 +202,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -890,7 +1083,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -230,6 +231,7 @@ SHELL = @SHELL@ +@@ -231,6 +232,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -898,24 +1091,24 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -d -@@ -287,13 +289,13 @@ top_srcdir = @top_srcdir@ +@@ -291,13 +293,13 @@ zip_LIBS = @zip_LIBS@ @MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -std=gnu99 \ @MUDFLAP_FALSE@ $(native_ld_cflags) $(if \ @MUDFLAP_FALSE@ $($(*F)_no_Werror),,-Werror) $(if \ -@MUDFLAP_FALSE@ $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \ +@MUDFLAP_FALSE@ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \ - @MUDFLAP_FALSE@ $($(*F)_no_Wformat),,-Wformat=2) \ + @MUDFLAP_FALSE@ $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \ @MUDFLAP_FALSE@ $(CFLAGS_$(*F)) @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Wshadow -std=gnu99 \ @MUDFLAP_TRUE@ $(native_ld_cflags) $(if \ @MUDFLAP_TRUE@ $($(*F)_no_Werror),,-Werror) $(if \ -@MUDFLAP_TRUE@ $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \ +@MUDFLAP_TRUE@ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \ - @MUDFLAP_TRUE@ $($(*F)_no_Wformat),,-Wformat=2) $(CFLAGS_$(*F)) + @MUDFLAP_TRUE@ $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \ + @MUDFLAP_TRUE@ $(CFLAGS_$(*F)) INCLUDES = -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \ - -I$(srcdir)/../libdw -I$(srcdir)/../libdwfl \ -@@ -337,6 +339,9 @@ size_no_Wformat = yes - strings_no_Wformat = yes +@@ -343,6 +345,9 @@ strings_no_Wformat = yes + addr2line_no_Wformat = yes # XXX While the file is not finished, don't warn about this ldgeneric_no_Wunused = yes + @@ -926,7 +1119,7 @@ size_LDADD = $(libelf) $(libeu) $(libmudflap) --- elfutils/src/readelf.c +++ elfutils/src/readelf.c -@@ -6419,7 +6419,7 @@ dump_archive_index (Elf *elf, const char +@@ -7436,7 +7436,7 @@ dump_archive_index (Elf *elf, const char if (unlikely (elf_rand (elf, as_off) == 0) || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf)) == NULL)) @@ -1016,7 +1209,7 @@ cannot set access and modification date of '%s'"), fname); --- elfutils/tests/ChangeLog +++ elfutils/tests/ChangeLog -@@ -51,6 +51,8 @@ +@@ -95,6 +95,8 @@ 2008-01-21 Roland McGrath @@ -1025,7 +1218,7 @@ * testfile45.S.bz2: Add tests for cltq, cqto. * testfile45.expect.bz2: Adjust. -@@ -759,6 +761,11 @@ +@@ -803,6 +805,11 @@ * Makefile.am (TESTS): Add run-elflint-test.sh. (EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2. @@ -1037,17 +1230,6 @@ 2005-05-24 Ulrich Drepper * get-files.c (main): Use correct format specifier. ---- elfutils/tests/line2addr.c -+++ elfutils/tests/line2addr.c -@@ -132,7 +132,7 @@ main (int argc, char *argv[]) - { - struct args a = { .arg = argv[cnt] }; - -- switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line)) -+ switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line)) - { - default: - case 0: --- elfutils/tests/Makefile.am +++ elfutils/tests/Makefile.am @@ -25,12 +25,13 @@ @@ -1068,7 +1250,7 @@ endif --- elfutils/tests/Makefile.in +++ elfutils/tests/Makefile.in -@@ -335,6 +335,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -342,6 +342,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -1076,7 +1258,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -364,6 +365,7 @@ SHELL = @SHELL@ +@@ -371,6 +372,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -1084,10 +1266,10 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -418,10 +420,10 @@ sysconfdir = @sysconfdir@ - target_alias = @target_alias@ +@@ -428,10 +430,10 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ + zip_LIBS = @zip_LIBS@ -@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 \ +@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror $(WEXTRA) -std=gnu99 \ @MUDFLAP_FALSE@ $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) diff --git a/elfutils-robustify.patch b/elfutils-robustify.patch index 8f2922d..c79d95c 100644 --- a/elfutils-robustify.patch +++ b/elfutils-robustify.patch @@ -1,72 +1,57 @@ -src/ -2005-06-09 Roland McGrath - - * readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link. - (handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise. - (handle_scngrp): Check for bogus sh_info. - - * strip.c (handle_elf): Check for bogus values in sh_link, sh_info, - st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data. - Don't use assert on input values, instead bail with "illformed" error. - -2005-05-17 Jakub Jelinek - -libelf/ - * elf32_getphdr.c (elfw2(LIBELFBITS,getphdr)): Check if program header - table fits into object's bounds. - * elf_getshstrndx.c (elf_getshstrndx): Add elf->start_offset to - elf->map_address. Check if first section header fits into object's - bounds. - * elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)): - Check if section header table fits into object's bounds. - * elf_begin.c (get_shnum): Ensure section headers fits into - object's bounds. - (file_read_elf): Make sure scncnt is small enough to allocate both - ElfXX_Shdr and Elf_Scn array. Make sure section and program header - tables fit into object's bounds. Avoid memory leak on failure. - -src/ - * elflint.c (check_hash): Don't check entries beyond end of section. - (check_note): Don't crash if gelf_rawchunk fails. - (section_name): Return if gelf_getshdr returns NULL. - -2005-05-14 Jakub Jelinek - -libelf/ - * libelfP.h (INVALID_NDX): Define. - * gelf_getdyn.c (gelf_getdyn): Use it. Remove ndx < 0 test if any. - * gelf_getlib.c (gelf_getlib): Likewise. - * gelf_getmove.c (gelf_getmove): Likewise. - * gelf_getrel.c (gelf_getrel): Likewise. - * gelf_getrela.c (gelf_getrela): Likewise. - * gelf_getsym.c (gelf_getsym): Likewise. - * gelf_getsyminfo.c (gelf_getsyminfo): Likewise. - * gelf_getsymshndx.c (gelf_getsymshndx): Likewise. - * gelf_getversym.c (gelf_getversym): Likewise. - * gelf_update_dyn.c (gelf_update_dyn): Likewise. - * gelf_update_lib.c (gelf_update_lib): Likewise. - * gelf_update_move.c (gelf_update_move): Likewise. - * gelf_update_rel.c (gelf_update_rel): Likewise. - * gelf_update_rela.c (gelf_update_rela): Likewise. - * gelf_update_sym.c (gelf_update_sym): Likewise. - * gelf_update_syminfo.c (gelf_update_syminfo): Likewise. - * gelf_update_symshndx.c (gelf_update_symshndx): Likewise. - * gelf_update_versym.c (gelf_update_versym): Likewise. - * elf_newscn.c (elf_newscn): Check for overflow. - * elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Likewise. - (__elfw2(LIBELFBITS,updatefile)): Likewise. - * elf_begin.c (file_read_elf): Likewise. - * elf32_newphdr.c (elfw2(LIBELFBITS,newphdr)): Likewise. - * elf_getarsym.c (elf_getarsym): Likewise. - * elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)): Likewise. -src/ - * elflint.c (section_name): Return "" instead of - crashing on invalid section name. - (check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic, - check_symtab_shndx, check_hash, check_versym): Robustify. - ---- elfutils-0.136/libelf/elf32_getphdr.c.robustify -+++ elfutils-0.136/libelf/elf32_getphdr.c +--- elfutils/libelf/ChangeLog ++++ elfutils/libelf/ChangeLog +@@ -521,6 +521,49 @@ + If section content hasn't been read yet, do it before looking for the + block size. If no section data present, infer size of section header. + ++2005-05-17 Jakub Jelinek ++ ++ * elf32_getphdr.c (elfw2(LIBELFBITS,getphdr)): Check if program header ++ table fits into object's bounds. ++ * elf_getshstrndx.c (elf_getshstrndx): Add elf->start_offset to ++ elf->map_address. Check if first section header fits into object's ++ bounds. ++ * elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)): ++ Check if section header table fits into object's bounds. ++ * elf_begin.c (get_shnum): Ensure section headers fits into ++ object's bounds. ++ (file_read_elf): Make sure scncnt is small enough to allocate both ++ ElfXX_Shdr and Elf_Scn array. Make sure section and program header ++ tables fit into object's bounds. Avoid memory leak on failure. ++ ++2005-05-14 Jakub Jelinek ++ ++ * libelfP.h (INVALID_NDX): Define. ++ * gelf_getdyn.c (gelf_getdyn): Use it. Remove ndx < 0 test if any. ++ * gelf_getlib.c (gelf_getlib): Likewise. ++ * gelf_getmove.c (gelf_getmove): Likewise. ++ * gelf_getrel.c (gelf_getrel): Likewise. ++ * gelf_getrela.c (gelf_getrela): Likewise. ++ * gelf_getsym.c (gelf_getsym): Likewise. ++ * gelf_getsyminfo.c (gelf_getsyminfo): Likewise. ++ * gelf_getsymshndx.c (gelf_getsymshndx): Likewise. ++ * gelf_getversym.c (gelf_getversym): Likewise. ++ * gelf_update_dyn.c (gelf_update_dyn): Likewise. ++ * gelf_update_lib.c (gelf_update_lib): Likewise. ++ * gelf_update_move.c (gelf_update_move): Likewise. ++ * gelf_update_rel.c (gelf_update_rel): Likewise. ++ * gelf_update_rela.c (gelf_update_rela): Likewise. ++ * gelf_update_sym.c (gelf_update_sym): Likewise. ++ * gelf_update_syminfo.c (gelf_update_syminfo): Likewise. ++ * gelf_update_symshndx.c (gelf_update_symshndx): Likewise. ++ * gelf_update_versym.c (gelf_update_versym): Likewise. ++ * elf_newscn.c (elf_newscn): Check for overflow. ++ * elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Likewise. ++ (__elfw2(LIBELFBITS,updatefile)): Likewise. ++ * elf_begin.c (file_read_elf): Likewise. ++ * elf32_newphdr.c (elfw2(LIBELFBITS,newphdr)): Likewise. ++ * elf_getarsym.c (elf_getarsym): Likewise. ++ * elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)): Likewise. + 2005-05-11 Ulrich Drepper + + * elf.h: Update again. +--- elfutils/libelf/elf32_getphdr.c ++++ elfutils/libelf/elf32_getphdr.c @@ -105,6 +105,16 @@ __elfw2(LIBELFBITS,getphdr_wrlock) (elf) if (elf->map_address != NULL) @@ -84,8 +69,8 @@ src/ /* All the data is already mapped. Use it. */ void *file_phdr = ((char *) elf->map_address + elf->start_offset + ehdr->e_phoff); ---- elfutils-0.136/libelf/elf32_getshdr.c.robustify -+++ elfutils-0.136/libelf/elf32_getshdr.c +--- elfutils/libelf/elf32_getshdr.c ++++ elfutils/libelf/elf32_getshdr.c @@ -1,5 +1,5 @@ /* Return section header. - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2007 Red Hat, Inc. @@ -93,7 +78,7 @@ src/ This file is part of Red Hat elfutils. Written by Ulrich Drepper , 1998. -@@ -81,7 +81,8 @@ load_shdr_rwlock (Elf_Scn *scn) +@@ -81,7 +81,8 @@ load_shdr_wrlock (Elf_Scn *scn) goto out; size_t shnum; @@ -103,7 +88,7 @@ src/ goto out; size_t size = shnum * sizeof (ElfW2(LIBELFBITS,Shdr)); -@@ -98,6 +99,16 @@ load_shdr_rwlock (Elf_Scn *scn) +@@ -98,6 +99,16 @@ load_shdr_wrlock (Elf_Scn *scn) if (elf->map_address != NULL) { @@ -120,8 +105,8 @@ src/ ElfW2(LIBELFBITS,Shdr) *notcvt; /* All the data is already mapped. If we could use it ---- elfutils-0.136/libelf/elf32_newphdr.c.robustify -+++ elfutils-0.136/libelf/elf32_newphdr.c +--- elfutils/libelf/elf32_newphdr.c ++++ elfutils/libelf/elf32_newphdr.c @@ -124,6 +124,12 @@ elfw2(LIBELFBITS,newphdr) (elf, count) else if (elf->state.ELFW(elf,LIBELFBITS).ehdr->e_phnum != count || elf->state.ELFW(elf,LIBELFBITS).phdr == NULL) @@ -135,9 +120,9 @@ src/ /* Allocate a new program header with the appropriate number of elements. */ result = (ElfW2(LIBELFBITS,Phdr) *) ---- elfutils-0.136/libelf/elf32_updatefile.c.robustify -+++ elfutils-0.136/libelf/elf32_updatefile.c -@@ -212,6 +212,9 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf +--- elfutils/libelf/elf32_updatefile.c ++++ elfutils/libelf/elf32_updatefile.c +@@ -220,6 +220,9 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf /* Write all the sections. Well, only those which are modified. */ if (shnum > 0) { @@ -147,7 +132,7 @@ src/ Elf_ScnList *list = &elf->state.ELFW(elf,LIBELFBITS).scns; Elf_Scn **scns = (Elf_Scn **) alloca (shnum * sizeof (Elf_Scn *)); char *const shdr_start = ((char *) elf->map_address + elf->start_offset -@@ -582,6 +585,10 @@ __elfw2(LIBELFBITS,updatefile) (Elf *elf +@@ -633,6 +636,10 @@ __elfw2(LIBELFBITS,updatefile) (Elf *elf /* Write all the sections. Well, only those which are modified. */ if (shnum > 0) { @@ -158,9 +143,9 @@ src/ off_t shdr_offset = elf->start_offset + ehdr->e_shoff; #if EV_NUM != 2 xfct_t shdr_fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR]; ---- elfutils-0.136/libelf/elf_begin.c.robustify -+++ elfutils-0.136/libelf/elf_begin.c -@@ -155,7 +155,8 @@ get_shnum (void *map_address, unsigned c +--- elfutils/libelf/elf_begin.c ++++ elfutils/libelf/elf_begin.c +@@ -165,7 +165,8 @@ get_shnum (void *map_address, unsigned c if (unlikely (result == 0) && ehdr.e32->e_shoff != 0) { @@ -170,7 +155,7 @@ src/ /* Cannot read the first section header. */ return 0; -@@ -203,7 +204,8 @@ get_shnum (void *map_address, unsigned c +@@ -213,7 +214,8 @@ get_shnum (void *map_address, unsigned c if (unlikely (result == 0) && ehdr.e64->e_shoff != 0) { @@ -180,7 +165,7 @@ src/ /* Cannot read the first section header. */ return 0; -@@ -275,6 +277,15 @@ file_read_elf (int fildes, void *map_add +@@ -285,6 +287,15 @@ file_read_elf (int fildes, void *map_add /* Could not determine the number of sections. */ return NULL; @@ -196,7 +181,7 @@ src/ /* We can now allocate the memory. */ Elf *elf = allocate_elf (fildes, map_address, offset, maxsize, cmd, parent, ELF_K_ELF, scncnt * sizeof (Elf_Scn)); -@@ -308,13 +319,31 @@ file_read_elf (int fildes, void *map_add +@@ -318,13 +329,31 @@ file_read_elf (int fildes, void *map_add { /* We can use the mmapped memory. */ elf->state.elf32.ehdr = ehdr; @@ -228,7 +213,7 @@ src/ for (size_t cnt = 0; cnt < scncnt; ++cnt) { -@@ -396,13 +425,26 @@ file_read_elf (int fildes, void *map_add +@@ -406,13 +435,26 @@ file_read_elf (int fildes, void *map_add { /* We can use the mmapped memory. */ elf->state.elf64.ehdr = ehdr; @@ -255,8 +240,8 @@ src/ for (size_t cnt = 0; cnt < scncnt; ++cnt) { ---- elfutils-0.136/libelf/elf_getarsym.c.robustify -+++ elfutils-0.136/libelf/elf_getarsym.c +--- elfutils/libelf/elf_getarsym.c ++++ elfutils/libelf/elf_getarsym.c @@ -179,6 +179,9 @@ elf_getarsym (elf, ptr) size_t index_size = atol (tmpbuf); @@ -267,8 +252,8 @@ src/ || n * sizeof (uint32_t) > index_size) { /* This index table cannot be right since it does not fit into ---- elfutils-0.136/libelf/elf_getshstrndx.c.robustify -+++ elfutils-0.136/libelf/elf_getshstrndx.c +--- elfutils/libelf/elf_getshstrndx.c ++++ elfutils/libelf/elf_getshstrndx.c @@ -125,10 +125,25 @@ elf_getshstrndx (elf, dst) if (elf->map_address != NULL && elf->state.elf32.ehdr->e_ident[EI_DATA] == MY_ELFDATA @@ -325,8 +310,8 @@ src/ else { /* We avoid reading in all the section headers. Just read ---- elfutils-0.136/libelf/elf_newscn.c.robustify -+++ elfutils-0.136/libelf/elf_newscn.c +--- elfutils/libelf/elf_newscn.c ++++ elfutils/libelf/elf_newscn.c @@ -104,10 +104,18 @@ elf_newscn (elf) else { @@ -347,8 +332,8 @@ src/ newp = (Elf_ScnList *) calloc (sizeof (Elf_ScnList) + ((elf->state.elf.scnincr *= 2) * sizeof (Elf_Scn)), 1); ---- elfutils-0.136/libelf/gelf_getdyn.c.robustify -+++ elfutils-0.136/libelf/gelf_getdyn.c +--- elfutils/libelf/gelf_getdyn.c ++++ elfutils/libelf/gelf_getdyn.c @@ -93,7 +93,8 @@ gelf_getdyn (data, ndx, dst) table entries has to be adopted. The user better has provided a buffer where we can store the information. While copying the @@ -369,8 +354,8 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.136/libelf/gelf_getlib.c.robustify -+++ elfutils-0.136/libelf/gelf_getlib.c +--- elfutils/libelf/gelf_getlib.c ++++ elfutils/libelf/gelf_getlib.c @@ -86,7 +86,8 @@ gelf_getlib (data, ndx, dst) /* The data is already in the correct form. Just make sure the index is OK. */ @@ -381,8 +366,8 @@ src/ __libelf_seterrno (ELF_E_INVALID_INDEX); else { ---- elfutils-0.136/libelf/gelf_getmove.c.robustify -+++ elfutils-0.136/libelf/gelf_getmove.c +--- elfutils/libelf/gelf_getmove.c ++++ elfutils/libelf/gelf_getmove.c @@ -83,7 +83,8 @@ gelf_getmove (data, ndx, dst) /* The data is already in the correct form. Just make sure the @@ -393,8 +378,8 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.136/libelf/gelf_getrela.c.robustify -+++ elfutils-0.136/libelf/gelf_getrela.c +--- elfutils/libelf/gelf_getrela.c ++++ elfutils/libelf/gelf_getrela.c @@ -71,12 +71,6 @@ gelf_getrela (data, ndx, dst) if (data_scn == NULL) return NULL; @@ -428,8 +413,8 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); result = NULL; ---- elfutils-0.136/libelf/gelf_getrel.c.robustify -+++ elfutils-0.136/libelf/gelf_getrel.c +--- elfutils/libelf/gelf_getrel.c ++++ elfutils/libelf/gelf_getrel.c @@ -71,12 +71,6 @@ gelf_getrel (data, ndx, dst) if (data_scn == NULL) return NULL; @@ -463,8 +448,8 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); result = NULL; ---- elfutils-0.136/libelf/gelf_getsym.c.robustify -+++ elfutils-0.136/libelf/gelf_getsym.c +--- elfutils/libelf/gelf_getsym.c ++++ elfutils/libelf/gelf_getsym.c @@ -90,7 +90,8 @@ gelf_getsym (data, ndx, dst) table entries has to be adopted. The user better has provided a buffer where we can store the information. While copying the @@ -485,8 +470,8 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.136/libelf/gelf_getsyminfo.c.robustify -+++ elfutils-0.136/libelf/gelf_getsyminfo.c +--- elfutils/libelf/gelf_getsyminfo.c ++++ elfutils/libelf/gelf_getsyminfo.c @@ -84,7 +84,8 @@ gelf_getsyminfo (data, ndx, dst) /* The data is already in the correct form. Just make sure the @@ -497,8 +482,8 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.136/libelf/gelf_getsymshndx.c.robustify -+++ elfutils-0.136/libelf/gelf_getsymshndx.c +--- elfutils/libelf/gelf_getsymshndx.c ++++ elfutils/libelf/gelf_getsymshndx.c @@ -90,7 +90,9 @@ gelf_getsymshndx (symdata, shndxdata, nd section index table. */ if (likely (shndxdata_scn != NULL)) @@ -530,8 +515,8 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.136/libelf/gelf_getversym.c.robustify -+++ elfutils-0.136/libelf/gelf_getversym.c +--- elfutils/libelf/gelf_getversym.c ++++ elfutils/libelf/gelf_getversym.c @@ -92,7 +92,8 @@ gelf_getversym (data, ndx, dst) /* The data is already in the correct form. Just make sure the @@ -542,8 +527,8 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); result = NULL; ---- elfutils-0.136/libelf/gelf_update_dyn.c.robustify -+++ elfutils-0.136/libelf/gelf_update_dyn.c +--- elfutils/libelf/gelf_update_dyn.c ++++ elfutils/libelf/gelf_update_dyn.c @@ -71,12 +71,6 @@ gelf_update_dyn (data, ndx, src) if (data == NULL) return 0; @@ -577,8 +562,8 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.136/libelf/gelf_update_lib.c.robustify -+++ elfutils-0.136/libelf/gelf_update_lib.c +--- elfutils/libelf/gelf_update_lib.c ++++ elfutils/libelf/gelf_update_lib.c @@ -68,12 +68,6 @@ gelf_update_lib (data, ndx, src) if (data == NULL) return 0; @@ -602,8 +587,8 @@ src/ __libelf_seterrno (ELF_E_INVALID_INDEX); else { ---- elfutils-0.136/libelf/gelf_update_move.c.robustify -+++ elfutils-0.136/libelf/gelf_update_move.c +--- elfutils/libelf/gelf_update_move.c ++++ elfutils/libelf/gelf_update_move.c @@ -75,7 +75,7 @@ gelf_update_move (data, ndx, src) assert (sizeof (GElf_Move) == sizeof (Elf64_Move)); @@ -613,8 +598,8 @@ src/ || unlikely ((ndx + 1) * sizeof (GElf_Move) > data_scn->d.d_size)) { __libelf_seterrno (ELF_E_INVALID_INDEX); ---- elfutils-0.136/libelf/gelf_update_rela.c.robustify -+++ elfutils-0.136/libelf/gelf_update_rela.c +--- elfutils/libelf/gelf_update_rela.c ++++ elfutils/libelf/gelf_update_rela.c @@ -68,12 +68,6 @@ gelf_update_rela (Elf_Data *dst, int ndx if (dst == NULL) return 0; @@ -648,8 +633,8 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.136/libelf/gelf_update_rel.c.robustify -+++ elfutils-0.136/libelf/gelf_update_rel.c +--- elfutils/libelf/gelf_update_rel.c ++++ elfutils/libelf/gelf_update_rel.c @@ -68,12 +68,6 @@ gelf_update_rel (Elf_Data *dst, int ndx, if (dst == NULL) return 0; @@ -683,8 +668,8 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.136/libelf/gelf_update_sym.c.robustify -+++ elfutils-0.136/libelf/gelf_update_sym.c +--- elfutils/libelf/gelf_update_sym.c ++++ elfutils/libelf/gelf_update_sym.c @@ -72,12 +72,6 @@ gelf_update_sym (data, ndx, src) if (data == NULL) return 0; @@ -718,8 +703,8 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.136/libelf/gelf_update_syminfo.c.robustify -+++ elfutils-0.136/libelf/gelf_update_syminfo.c +--- elfutils/libelf/gelf_update_syminfo.c ++++ elfutils/libelf/gelf_update_syminfo.c @@ -72,12 +72,6 @@ gelf_update_syminfo (data, ndx, src) if (data == NULL) return 0; @@ -743,8 +728,8 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.136/libelf/gelf_update_symshndx.c.robustify -+++ elfutils-0.136/libelf/gelf_update_symshndx.c +--- elfutils/libelf/gelf_update_symshndx.c ++++ elfutils/libelf/gelf_update_symshndx.c @@ -77,12 +77,6 @@ gelf_update_symshndx (symdata, shndxdata if (symdata == NULL) return 0; @@ -778,8 +763,8 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.136/libelf/gelf_update_versym.c.robustify -+++ elfutils-0.136/libelf/gelf_update_versym.c +--- elfutils/libelf/gelf_update_versym.c ++++ elfutils/libelf/gelf_update_versym.c @@ -75,7 +75,7 @@ gelf_update_versym (data, ndx, src) assert (sizeof (GElf_Versym) == sizeof (Elf64_Versym)); @@ -789,8 +774,8 @@ src/ || unlikely ((ndx + 1) * sizeof (GElf_Versym) > data_scn->d.d_size)) { __libelf_seterrno (ELF_E_INVALID_INDEX); ---- elfutils-0.136/libelf/libelfP.h.robustify -+++ elfutils-0.136/libelf/libelfP.h +--- elfutils/libelf/libelfP.h ++++ elfutils/libelf/libelfP.h @@ -611,4 +611,13 @@ extern uint32_t __libelf_crc32 (uint32_t /* Align offset to 4 bytes as needed for note name and descriptor data. */ #define NOTE_ALIGN(n) (((n) + 3) & -4U) @@ -805,9 +790,48 @@ src/ +#endif + #endif /* libelfP.h */ ---- elfutils-0.136/src/elflint.c.robustify -+++ elfutils-0.136/src/elflint.c -@@ -131,6 +131,9 @@ static uint32_t shstrndx; +--- elfutils/src/ChangeLog ++++ elfutils/src/ChangeLog +@@ -1347,6 +1347,16 @@ + object symbols or symbols with unknown type. + (check_rel): Likewise. + ++2005-06-09 Roland McGrath ++ ++ * readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link. ++ (handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise. ++ (handle_scngrp): Check for bogus sh_info. ++ ++ * strip.c (handle_elf): Check for bogus values in sh_link, sh_info, ++ st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data. ++ Don't use assert on input values, instead bail with "illformed" error. ++ + 2005-06-08 Roland McGrath + + * readelf.c (print_ops): Add consts. +@@ -1392,6 +1402,19 @@ + + * readelf.c (dwarf_tag_string): Add new tags. + ++2005-05-17 Jakub Jelinek ++ ++ * elflint.c (check_hash): Don't check entries beyond end of section. ++ (check_note): Don't crash if gelf_rawchunk fails. ++ (section_name): Return if gelf_getshdr returns NULL. ++ ++2005-05-14 Jakub Jelinek ++ ++ * elflint.c (section_name): Return "" instead of ++ crashing on invalid section name. ++ (check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic, ++ check_symtab_shndx, check_hash, check_versym): Robustify. ++ + 2005-05-08 Roland McGrath + + * strip.c (handle_elf): Don't translate hash and versym data formats, +--- elfutils/src/elflint.c ++++ elfutils/src/elflint.c +@@ -130,6 +130,9 @@ static uint32_t shstrndx; /* Array to count references in section groups. */ static int *scnref; @@ -817,7 +841,7 @@ src/ int main (int argc, char *argv[]) -@@ -320,10 +323,19 @@ section_name (Ebl *ebl, int idx) +@@ -318,10 +321,19 @@ section_name (Ebl *ebl, int idx) { GElf_Shdr shdr_mem; GElf_Shdr *shdr; @@ -838,7 +862,7 @@ src/ } -@@ -345,10 +357,6 @@ static const int valid_e_machine[] = +@@ -343,10 +355,6 @@ static const int valid_e_machine[] = (sizeof (valid_e_machine) / sizeof (valid_e_machine[0])) @@ -849,7 +873,7 @@ src/ static void check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size) { -@@ -613,7 +621,8 @@ section [%2d] '%s': symbol table cannot +@@ -611,7 +619,8 @@ section [%2d] '%s': symbol table cannot } } @@ -859,7 +883,7 @@ src/ ERROR (gettext ("\ section [%2u] '%s': entry size is does not match ElfXX_Sym\n"), idx, section_name (ebl, idx)); -@@ -651,7 +660,7 @@ section [%2d] '%s': XINDEX for zeroth en +@@ -649,7 +658,7 @@ section [%2d] '%s': XINDEX for zeroth en xndxscnidx, section_name (ebl, xndxscnidx)); } @@ -868,7 +892,7 @@ src/ { sym = gelf_getsymshndx (data, xndxdata, cnt, &sym_mem, &xndx); if (sym == NULL) -@@ -671,7 +680,8 @@ section [%2d] '%s': symbol %zu: invalid +@@ -669,7 +678,8 @@ section [%2d] '%s': symbol %zu: invalid else { name = elf_strptr (ebl->elf, shdr->sh_link, sym->st_name); @@ -878,7 +902,7 @@ src/ } if (sym->st_shndx == SHN_XINDEX) -@@ -1001,9 +1011,11 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e +@@ -999,9 +1009,11 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e { GElf_Shdr rcshdr_mem; const GElf_Shdr *rcshdr = gelf_getshdr (scn, &rcshdr_mem); @@ -892,7 +916,7 @@ src/ { /* Found the dynamic section. Look through it. */ Elf_Data *d = elf_getdata (scn, NULL); -@@ -1013,7 +1025,9 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e +@@ -1011,7 +1023,9 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e { GElf_Dyn dyn_mem; GElf_Dyn *dyn = gelf_getdyn (d, cnt, &dyn_mem); @@ -903,7 +927,7 @@ src/ if (dyn->d_tag == DT_RELCOUNT) { -@@ -1027,7 +1041,9 @@ section [%2d] '%s': DT_RELCOUNT used for +@@ -1025,7 +1039,9 @@ section [%2d] '%s': DT_RELCOUNT used for /* Does the number specified number of relative relocations exceed the total number of relocations? */ @@ -914,7 +938,7 @@ src/ ERROR (gettext ("\ section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"), idx, section_name (ebl, idx), -@@ -1187,7 +1203,8 @@ section [%2d] '%s': no relocations for m +@@ -1185,7 +1201,8 @@ section [%2d] '%s': no relocations for m } } @@ -924,7 +948,7 @@ src/ ERROR (gettext (reltype == ELF_T_RELA ? "\ section [%2d] '%s': section entry size does not match ElfXX_Rela\n" : "\ section [%2d] '%s': section entry size does not match ElfXX_Rel\n"), -@@ -1410,7 +1427,8 @@ check_rela (Ebl *ebl, GElf_Ehdr *ehdr, G +@@ -1408,7 +1425,8 @@ check_rela (Ebl *ebl, GElf_Ehdr *ehdr, G Elf_Data *symdata = elf_getdata (symscn, NULL); enum load_state state = state_undecided; @@ -934,7 +958,7 @@ src/ { GElf_Rela rela_mem; GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem); -@@ -1460,7 +1478,8 @@ check_rel (Ebl *ebl, GElf_Ehdr *ehdr, GE +@@ -1458,7 +1476,8 @@ check_rel (Ebl *ebl, GElf_Ehdr *ehdr, GE Elf_Data *symdata = elf_getdata (symscn, NULL); enum load_state state = state_undecided; @@ -944,7 +968,7 @@ src/ { GElf_Rel rel_mem; GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem); -@@ -1563,7 +1582,8 @@ section [%2d] '%s': referenced as string +@@ -1561,7 +1580,8 @@ section [%2d] '%s': referenced as string shdr->sh_link, section_name (ebl, shdr->sh_link), idx, section_name (ebl, idx)); @@ -954,7 +978,7 @@ src/ ERROR (gettext ("\ section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"), idx, section_name (ebl, idx)); -@@ -1573,7 +1593,7 @@ section [%2d] '%s': section entry size d +@@ -1571,7 +1591,7 @@ section [%2d] '%s': section entry size d idx, section_name (ebl, idx)); bool non_null_warned = false; @@ -963,7 +987,7 @@ src/ { GElf_Dyn dyn_mem; GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dyn_mem); -@@ -1854,6 +1874,8 @@ section [%2d] '%s': entry size does not +@@ -1852,6 +1872,8 @@ section [%2d] '%s': entry size does not idx, section_name (ebl, idx)); if (symshdr != NULL @@ -972,7 +996,7 @@ src/ && (shdr->sh_size / shdr->sh_entsize < symshdr->sh_size / symshdr->sh_entsize)) ERROR (gettext ("\ -@@ -1880,6 +1902,12 @@ section [%2d] '%s': extended section ind +@@ -1878,6 +1900,12 @@ section [%2d] '%s': extended section ind } Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL); @@ -985,7 +1009,7 @@ src/ if (*((Elf32_Word *) data->d_buf) != 0) ERROR (gettext ("symbol 0 should have zero extended section index\n")); -@@ -1922,7 +1950,7 @@ section [%2d] '%s': hash table section i +@@ -1920,7 +1948,7 @@ section [%2d] '%s': hash table section i size_t maxidx = nchain; @@ -994,7 +1018,7 @@ src/ { size_t symsize = symshdr->sh_size / symshdr->sh_entsize; -@@ -1933,18 +1961,28 @@ section [%2d] '%s': hash table section i +@@ -1931,18 +1959,28 @@ section [%2d] '%s': hash table section i maxidx = symsize; } @@ -1025,7 +1049,7 @@ src/ } -@@ -1974,18 +2012,28 @@ section [%2d] '%s': hash table section i +@@ -1972,18 +2010,28 @@ section [%2d] '%s': hash table section i maxidx = symsize; } @@ -1057,7 +1081,7 @@ src/ } -@@ -2010,7 +2058,7 @@ section [%2d] '%s': bitmask size not pow +@@ -2008,7 +2056,7 @@ section [%2d] '%s': bitmask size not pow if (shdr->sh_size < (4 + bitmask_words + nbuckets) * sizeof (Elf32_Word)) { ERROR (gettext ("\ @@ -1066,7 +1090,7 @@ src/ idx, section_name (ebl, idx), (long int) shdr->sh_size, (long int) ((4 + bitmask_words + nbuckets) * sizeof (Elf32_Word))); return; -@@ -2682,8 +2730,9 @@ section [%2d] '%s' refers in sh_link to +@@ -2680,8 +2728,9 @@ section [%2d] '%s' refers in sh_link to /* The number of elements in the version symbol table must be the same as the number of symbols. */ @@ -1078,9 +1102,9 @@ src/ ERROR (gettext ("\ section [%2d] '%s' has different number of entries than symbol table [%2d] '%s'\n"), idx, section_name (ebl, idx), ---- elfutils-0.136/src/readelf.c.robustify -+++ elfutils-0.136/src/readelf.c -@@ -1111,6 +1111,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G +--- elfutils/src/readelf.c ++++ elfutils/src/readelf.c +@@ -1136,6 +1136,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G Elf32_Word *grpref = (Elf32_Word *) data->d_buf; GElf_Sym sym_mem; @@ -1089,7 +1113,7 @@ src/ printf ((grpref[0] & GRP_COMDAT) ? ngettext ("\ \nCOMDAT section group [%2zu] '%s' with signature '%s' contains %zu entry:\n", -@@ -1123,8 +1125,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G +@@ -1148,8 +1150,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G data->d_size / sizeof (Elf32_Word) - 1), elf_ndxscn (scn), elf_strptr (ebl->elf, shstrndx, shdr->sh_name), @@ -1100,7 +1124,7 @@ src/ ?: gettext (""), data->d_size / sizeof (Elf32_Word) - 1); -@@ -1275,7 +1277,8 @@ static void +@@ -1300,7 +1302,8 @@ static void handle_dynamic (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr) { int class = gelf_getclass (ebl->elf); @@ -1110,7 +1134,7 @@ src/ Elf_Data *data; size_t cnt; size_t shstrndx; -@@ -1290,6 +1293,11 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn, +@@ -1315,6 +1318,11 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn, error (EXIT_FAILURE, 0, gettext ("cannot get section header string table index")); @@ -1122,7 +1146,7 @@ src/ printf (ngettext ("\ \nDynamic segment contains %lu entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n", "\ -@@ -1299,9 +1307,7 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn, +@@ -1324,9 +1332,7 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn, class == ELFCLASS32 ? 10 : 18, shdr->sh_addr, shdr->sh_offset, (int) shdr->sh_link, @@ -1133,7 +1157,7 @@ src/ fputs_unlocked (gettext (" Type Value\n"), stdout); for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt) -@@ -1801,6 +1807,13 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G +@@ -1826,6 +1832,13 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G error (EXIT_FAILURE, 0, gettext ("cannot get section header string table index")); @@ -1147,7 +1171,7 @@ src/ /* Now we can compute the number of entries in the section. */ unsigned int nsyms = data->d_size / (class == ELFCLASS32 ? sizeof (Elf32_Sym) -@@ -1811,15 +1824,12 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G +@@ -1836,15 +1849,12 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G nsyms), (unsigned int) elf_ndxscn (scn), elf_strptr (ebl->elf, shstrndx, shdr->sh_name), nsyms); @@ -1164,7 +1188,7 @@ src/ fputs_unlocked (class == ELFCLASS32 ? gettext ("\ -@@ -2055,7 +2065,13 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn, +@@ -2080,7 +2090,13 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn, error (EXIT_FAILURE, 0, gettext ("cannot get section header string table index")); @@ -1179,7 +1203,7 @@ src/ printf (ngettext ("\ \nVersion needs section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n", "\ -@@ -2066,9 +2082,7 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn, +@@ -2091,9 +2107,7 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn, class == ELFCLASS32 ? 10 : 18, shdr->sh_addr, shdr->sh_offset, (unsigned int) shdr->sh_link, @@ -1190,7 +1214,7 @@ src/ unsigned int offset = 0; for (int cnt = shdr->sh_info; --cnt >= 0; ) -@@ -2121,8 +2135,14 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G +@@ -2146,8 +2160,14 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G error (EXIT_FAILURE, 0, gettext ("cannot get section header string table index")); @@ -1206,7 +1230,7 @@ src/ printf (ngettext ("\ \nVersion definition section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n", "\ -@@ -2134,9 +2154,7 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G +@@ -2159,9 +2179,7 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G class == ELFCLASS32 ? 10 : 18, shdr->sh_addr, shdr->sh_offset, (unsigned int) shdr->sh_link, @@ -1217,7 +1241,7 @@ src/ unsigned int offset = 0; for (int cnt = shdr->sh_info; --cnt >= 0; ) -@@ -2398,8 +2416,14 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G +@@ -2423,8 +2441,14 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G filename = NULL; } @@ -1233,7 +1257,7 @@ src/ printf (ngettext ("\ \nVersion symbols section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'", "\ -@@ -2411,9 +2435,7 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G +@@ -2436,9 +2460,7 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G class == ELFCLASS32 ? 10 : 18, shdr->sh_addr, shdr->sh_offset, (unsigned int) shdr->sh_link, @@ -1244,7 +1268,7 @@ src/ /* Now we can finally look at the actual contents of this section. */ for (unsigned int cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt) -@@ -2465,7 +2487,17 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn, +@@ -2490,7 +2512,17 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn, for (Elf32_Word cnt = 0; cnt < nbucket; ++cnt) ++counts[lengths[cnt]]; @@ -1263,7 +1287,7 @@ src/ printf (ngettext ("\ \nHistogram for bucket list length in section [%2u] '%s' (total of %d bucket):\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n", "\ -@@ -2478,9 +2510,7 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn, +@@ -2503,9 +2535,7 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn, shdr->sh_addr, shdr->sh_offset, (unsigned int) shdr->sh_link, @@ -1274,7 +1298,7 @@ src/ if (extrastr != NULL) fputs (extrastr, stdout); -@@ -4039,6 +4069,16 @@ print_debug_aranges_section (Dwfl_Module +@@ -4104,6 +4134,16 @@ print_debug_aranges_section (Dwfl_Module return; } @@ -1289,10 +1313,10 @@ src/ + } + printf (ngettext ("\ - \nDWARF section '%s' at offset %#" PRIx64 " contains %zu entry:\n", + \nDWARF section [%2zu] '%s' at offset %#" PRIx64 " contains %zu entry:\n", "\ ---- elfutils-0.136/src/strip.c.robustify -+++ elfutils-0.136/src/strip.c +--- elfutils/src/strip.c ++++ elfutils/src/strip.c @@ -544,6 +544,11 @@ handle_elf (int fd, Elf *elf, const char goto fail_close; } diff --git a/elfutils-suse-10.3-fixes.diff b/elfutils-suse-10.3-fixes.diff new file mode 100644 index 0000000..f0fe313 --- /dev/null +++ b/elfutils-suse-10.3-fixes.diff @@ -0,0 +1,154 @@ +--- libdwfl/Makefile.am-dist 2009-02-19 15:35:22.000000000 +0100 ++++ libdwfl/Makefile.am 2009-02-19 15:36:58.000000000 +0100 +@@ -33,7 +33,8 @@ + else + AM_CFLAGS = + endif +-AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 $(WEXTRA) -std=gnu99 ++AM_CFLAGS += -Wall -Wshadow -Wunused -Wformat=2 $(WEXTRA) -std=gnu99 ++AM_CFLAGS += -fgnu89-inline + INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \ + -I$(srcdir)/../libdw -I.. -I$(srcdir)/../lib + VERSION = 1 +--- libdwfl/link_map.c-dist 2009-02-15 23:39:44.000000000 +0100 ++++ libdwfl/link_map.c 2009-02-19 15:36:58.000000000 +0100 +@@ -75,10 +75,10 @@ + /* Examine an auxv data block and determine its format. + Return true iff we figured it out. */ + static bool +-auxv_format_probe (const void *auxv, size_t size, ++auxv_format_probe (void *auxv, size_t size, + uint_fast8_t *elfclass, uint_fast8_t *elfdata) + { +- const union ++ union + { + char buf[size]; + Elf32_auxv_t a32[size / sizeof (Elf32_auxv_t)]; +@@ -301,7 +301,7 @@ report_r_debug (uint_fast8_t elfclass, u + return true; + } + +- const union ++ union + { + Elf32_Addr a32[n]; + Elf64_Addr a64[n]; +@@ -568,7 +568,7 @@ consider_executable (Dwfl_Module *mod, G + d_val_vaddr, buffer_available, + memory_callback_arg)) + { +- const union ++ union + { + Elf32_Addr a32; + Elf64_Addr a64; +@@ -626,10 +626,11 @@ find_executable (Dwfl *dwfl, GElf_Addr a + + + int +-dwfl_link_map_report (Dwfl *dwfl, const void *auxv, size_t auxv_size, ++dwfl_link_map_report (Dwfl *dwfl, const void *_auxv, size_t auxv_size, + Dwfl_Memory_Callback *memory_callback, + void *memory_callback_arg) + { ++ void *auxv = (void *)_auxv; + GElf_Addr r_debug_vaddr = 0; + + uint_fast8_t elfclass = ELFCLASSNONE; +@@ -644,7 +645,7 @@ dwfl_link_map_report (Dwfl *dwfl, const + + #define AUXV_SCAN(NN, BL) do \ + { \ +- const Elf##NN##_auxv_t *av = auxv; \ ++ Elf##NN##_auxv_t *av = auxv; \ + for (size_t i = 0; i < auxv_size / sizeof av[0]; ++i) \ + { \ + Elf##NN##_Addr val = BL##NN (av[i].a_un.a_val); \ +@@ -718,7 +719,7 @@ dwfl_link_map_report (Dwfl *dwfl, const + (&out, &in, elfdata) != NULL)) + { + /* We are looking for PT_DYNAMIC. */ +- const union ++ union + { + Elf32_Phdr p32[phnum]; + Elf64_Phdr p64[phnum]; +@@ -806,7 +807,7 @@ dwfl_link_map_report (Dwfl *dwfl, const + (&out, &in, elfdata) != NULL)) + { + /* We are looking for PT_DYNAMIC. */ +- const union ++ union + { + Elf32_Dyn d32[dyn_filesz / sizeof (Elf32_Dyn)]; + Elf64_Dyn d64[dyn_filesz / sizeof (Elf64_Dyn)]; +--- libdw/Makefile.am-dist 2009-02-19 15:35:22.000000000 +0100 ++++ libdw/Makefile.am 2009-02-19 15:36:58.000000000 +0100 +@@ -35,6 +35,7 @@ + AM_CFLAGS += -fpic + endif + AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 $(WEXTRA) -std=gnu99 ++AM_CFLAGS += -fgnu89-inline + INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib + VERSION = 1 + +--- libdw/libdw.h-dist 2008-12-10 23:21:29.000000000 +0100 ++++ libdw/libdw.h 2009-02-19 15:36:58.000000000 +0100 +@@ -67,7 +67,7 @@ + #ifdef __GNUC_STDC_INLINE__ + # define __libdw_extern_inline extern __inline __attribute__ ((__gnu_inline__)) + #else +-# define __libdw_extern_inline extern __inline ++# define __libdw_extern_inline extern __inline __attribute__ ((gnu_inline)) + #endif + + +--- src/Makefile.am-dist 2009-02-19 15:35:22.000000000 +0100 ++++ src/Makefile.am 2009-02-19 15:37:25.000000000 +0100 +@@ -37,6 +37,8 @@ + $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \ + $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $(CFLAGS_$(*F)) + ++AM_CFLAGS += -fgnu89-inline ++ + INCLUDES = -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \ + -I$(srcdir)/../libdw -I$(srcdir)/../libdwfl \ + -I$(srcdir)/../libasm -I$(srcdir)/../lib -I.. +--- src/ldgeneric.c-dist 2008-12-10 23:21:30.000000000 +0100 ++++ src/ldgeneric.c 2009-02-19 15:36:58.000000000 +0100 +@@ -63,6 +63,14 @@ struct unw_eh_frame_hdr + }; + #define EH_FRAME_HDR_VERSION 1 + ++static inline int popcount(unsigned int val) ++{ ++ int count = 0; ++ for (; val; val >>= 1) ++ if (val & 1) ++ count++; ++ return count; ++} + + /* Prototypes for local functions. */ + static const char **ld_generic_lib_extensions (struct ld_state *) +@@ -5830,7 +5838,7 @@ cannot create dynamic symbol table for o + + /* We need one more array which contains the hash codes of the + symbol names. */ +- hashcodes = (Elf32_Word *) xcalloc (__builtin_popcount ((int) ld_state.hash_style) ++ hashcodes = (Elf32_Word *) xcalloc (popcount ((int) ld_state.hash_style) + * nsym_dyn_allocated, + sizeof (Elf32_Word)); + gnuhashcodes = hashcodes; +--- backends/ia64_retval.c-dist 2008-12-10 23:21:28.000000000 +0100 ++++ backends/ia64_retval.c 2009-02-19 15:36:58.000000000 +0100 +@@ -96,7 +96,7 @@ hfa_type (Dwarf_Die *typedie, const Dwar + If we find a datum that's not the same FP type as the first datum, punt. + If we count more than eight total homogeneous FP data, punt. */ + +- inline int hfa (const Dwarf_Op *loc, int nregs) ++ inline __attribute__((gnu_inline)) int hfa (const Dwarf_Op *loc, int nregs) + { + if (fpregs_used == 0) + *locp = loc; diff --git a/elfutils.changes b/elfutils.changes index 7211083..a4327e2 100644 --- a/elfutils.changes +++ b/elfutils.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Thu Feb 19 15:39:39 CET 2009 - tiwai@suse.de + +- Update to 0.139 + - libcpu: Add Intel SSE4 disassembler support + - readelf: Implement call frame information and exception + handling dumping. + Add -e option. Enable it implicitly for -a. + - elflint: Check PT_GNU_EH_FRAME program header entry. + - libdwfl: Support automatic gzip/bzip2 decompression of ELF + files. +- updated to 0.140: + - libelf: Fix regression in creation of section header. + - Misc bug fixes + ------------------------------------------------------------------- Tue Jan 27 14:34:17 CET 2009 - tiwai@suse.de diff --git a/elfutils.spec b/elfutils.spec index c02a11e..5b27bc9 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,5 +1,5 @@ # -# spec file for package elfutils (Version 0.137) +# spec file for package elfutils (Version 0.140) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -20,12 +20,11 @@ Name: elfutils License: GPL v2 or later -Version: 0.137 -Release: 7 +Version: 0.140 +Release: 1 Summary: Higher-level library to access ELF Group: System/Libraries Url: http://elfutils.fedorahosted.org -Recommends: libebl1 Source: elfutils-%{version}-no-osl.tar.bz2 Patch: elfutils-portability.patch Patch1: elfutils-robustify.patch @@ -35,14 +34,9 @@ Patch8: elfutils-0.97-ftruncate-mmap-fix.diff Patch9: libelf-ignore-NOBITS-sh_offset.patch Patch10: test.diff Patch11: build.diff -Patch20: elfutils-0.137-fixes.patch -Patch21: elfutils-0.137-dwfl_getmodules-fixes.diff -Patch22: elfutils-0.137-i386-rel-types.diff -Patch23: elfutils-0.137-readelf-crash-fix.diff -Patch24: elfutils-0.137-nm-crash-fix.diff -Patch25: elfutils-0.137-main-bias-fix.diff -Patch26: elfutils-0.137-main-bias-fix2.diff -Patch27: elfutils-0.137-dwarf-header-check-fix.diff +Patch12: elfutils-old-scanf-fix.diff +Patch13: elfutils-suse-10.3-fixes.diff +Patch20: elfutils-0.137-dwarf-header-check-fix.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -102,7 +96,6 @@ Authors: Summary: A collection of utilities and DSOs to handle compiled objects Group: Development/Tools/Other License: GPL v2 or later -Requires: libdw1 = %{version}-%{release} Provides: libebl = %{version} Obsoletes: libebl < %{version} @@ -182,10 +175,11 @@ Authors: Ulrich Drepper %package -n libdw-devel -Summary: Include Files and Libraries mandatory for Development. +Summary: Include Files and Libraries mandatory for Development Group: Development/Libraries/C and C++ License: GPL v2 or later -Requires: glibc-devel, libdw1 = %{version}, libelf-devel = %{version} +Requires: glibc-devel, libdw1 = %{version} +Requires: libelf-devel = %{version} %description -n libdw-devel This package contains all necessary include files and libraries needed @@ -207,30 +201,33 @@ Authors: %patch9 -p1 #%patch10 -p1 %patch11 -p1 +%if %suse_version < 1100 +%patch12 +%endif +%if %suse_version == 1030 +# only 10.3 gcc has a problem +%patch13 +%endif %patch20 -p1 -%patch21 -p1 -%patch22 -p1 -%patch23 -p1 -%patch24 -p1 -%patch25 -p1 -# this seems buggy (bnc#468814) -# %patch26 -p1 -%patch27 -p1 %build autoreconf -fi %configure --program-prefix=eu- -make %{?jobs:-j %jobs} +make %install make DESTDIR=$RPM_BUILD_ROOT install # remove unneeded files rm -f $RPM_BUILD_ROOT%{_libdir}/*.la +%post -n libebl1 -p /sbin/ldconfig + %post -n libelf1 -p /sbin/ldconfig %post -n libdw1 -p /sbin/ldconfig +%postun -n libebl1 -p /sbin/ldconfig + %postun -n libelf1 -p /sbin/ldconfig %postun -n libdw1 -p /sbin/ldconfig @@ -280,6 +277,7 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/nlist.h %dir %{_includedir}/elfutils %{_includedir}/elfutils/elf-knowledge.h +%{_includedir}/elfutils/version.h %files -n libdw1 %defattr(-,root,root) @@ -296,6 +294,18 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/elfutils/libdwfl.h %changelog +* Thu Feb 19 2009 tiwai@suse.de +- Update to 0.139 + - libcpu: Add Intel SSE4 disassembler support + - readelf: Implement call frame information and exception + handling dumping. + Add -e option. Enable it implicitly for -a. + - elflint: Check PT_GNU_EH_FRAME program header entry. + - libdwfl: Support automatic gzip/bzip2 decompression of ELF + files. +- updated to 0.140: + - libelf: Fix regression in creation of section header. + - Misc bug fixes * Tue Jan 27 2009 tiwai@suse.de - revert the ET_DYN address fix patch; causing a regression (bnc#468814)