From d8185963f1935ac123c27e5e5032e53ce22b5b61 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Sun, 20 Apr 2008 16:58:33 +0000 Subject: [PATCH 01/13] Initialize branch F-9 for elfutils --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..1c26f78 --- /dev/null +++ b/branch @@ -0,0 +1 @@ +F-9 From d156f4c63fd3e83309756cd19e7186c942fa046d Mon Sep 17 00:00:00 2001 From: roland Date: Tue, 13 May 2008 01:16:29 +0000 Subject: [PATCH 02/13] New upstream version 0.135 --- .cvsignore | 4 +- elfutils-portability.patch | 26 +-- elfutils-robustify.patch | 331 +++++++++++++++++-------------- elfutils-strip-copy-symtab.patch | 199 ------------------- elfutils.spec | 19 +- sources | 4 +- 6 files changed, 203 insertions(+), 380 deletions(-) delete mode 100644 elfutils-strip-copy-symtab.patch diff --git a/.cvsignore b/.cvsignore index 14bd43f..38578b8 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,3 +1 @@ -testfile16.symtab.bz2 -testfile16.symtab.debug.bz2 -elfutils-0.134.tar.gz +elfutils-0.135.tar.gz diff --git a/elfutils-portability.patch b/elfutils-portability.patch index 464cf1e..6211cab 100644 --- a/elfutils-portability.patch +++ b/elfutils-portability.patch @@ -541,7 +541,7 @@ $(COMPILE))) --- elfutils/libdwfl/ChangeLog +++ elfutils/libdwfl/ChangeLog -@@ -787,6 +787,11 @@ +@@ -806,6 +806,11 @@ 2005-07-21 Roland McGrath @@ -795,7 +795,7 @@ YACC = @YACC@ --- elfutils/src/ChangeLog +++ elfutils/src/ChangeLog -@@ -15,6 +15,11 @@ +@@ -34,6 +34,11 @@ that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really is valid in RELRO. @@ -807,7 +807,7 @@ 2008-02-29 Roland McGrath * readelf.c (print_attributes): Add a cast. -@@ -266,6 +271,8 @@ +@@ -285,6 +290,8 @@ * readelf.c (hex_dump): Fix rounding error in whitespace calculation. @@ -816,7 +816,7 @@ 2007-10-15 Roland McGrath * make-debug-archive.in: New file. -@@ -705,6 +712,10 @@ +@@ -724,6 +731,10 @@ * elflint.c (valid_e_machine): Add EM_ALPHA. Reported by Christian Aichinger . @@ -827,7 +827,7 @@ 2006-08-08 Ulrich Drepper * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB. -@@ -781,6 +792,10 @@ +@@ -800,6 +811,10 @@ * Makefile.am: Add hacks to create dependency files for non-generic linker. @@ -838,7 +838,7 @@ 2006-06-12 Ulrich Drepper * ldgeneric.c (ld_generic_generate_sections): Don't create .interp -@@ -1129,6 +1144,11 @@ +@@ -1148,6 +1163,11 @@ * readelf.c (print_debug_loc_section): Fix indentation for larger address size. @@ -1010,7 +1010,7 @@ } /* Open the file. */ -@@ -1703,7 +1719,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -1745,7 +1761,7 @@ handle_elf (int fd, Elf *elf, const char /* If requested, preserve the timestamp. */ if (tvp != NULL) { @@ -1019,7 +1019,7 @@ { error (0, errno, gettext ("\ cannot set access and modification date of '%s'"), -@@ -1760,7 +1776,7 @@ handle_ar (int fd, Elf *elf, const char +@@ -1802,7 +1818,7 @@ handle_ar (int fd, Elf *elf, const char if (tvp != NULL) { @@ -1030,7 +1030,7 @@ cannot set access and modification date of '%s'"), fname); --- elfutils/tests/ChangeLog +++ elfutils/tests/ChangeLog -@@ -32,6 +32,8 @@ +@@ -45,6 +45,8 @@ 2008-01-21 Roland McGrath @@ -1039,7 +1039,7 @@ * testfile45.S.bz2: Add tests for cltq, cqto. * testfile45.expect.bz2: Adjust. -@@ -740,6 +742,11 @@ +@@ -753,6 +755,11 @@ * Makefile.am (TESTS): Add run-elflint-test.sh. (EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2. @@ -1082,7 +1082,7 @@ endif --- elfutils/tests/Makefile.in +++ elfutils/tests/Makefile.in -@@ -334,6 +334,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -335,6 +335,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -1090,7 +1090,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -363,6 +364,7 @@ SHELL = @SHELL@ +@@ -364,6 +365,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -1098,7 +1098,7 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -417,10 +419,10 @@ sysconfdir = @sysconfdir@ +@@ -418,10 +420,10 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ diff --git a/elfutils-robustify.patch b/elfutils-robustify.patch index 7bc2a35..5b582c7 100644 --- a/elfutils-robustify.patch +++ b/elfutils-robustify.patch @@ -65,9 +65,9 @@ src/ (check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic, check_symtab_shndx, check_hash, check_versym): Robustify. ---- elfutils-0.132/src/elflint.c.robustify -+++ elfutils-0.132/src/elflint.c -@@ -126,6 +126,9 @@ static uint32_t shstrndx; +--- elfutils-0.135/src/elflint.c.robustify ++++ elfutils-0.135/src/elflint.c +@@ -131,6 +131,9 @@ static uint32_t shstrndx; /* Array to count references in section groups. */ static int *scnref; @@ -77,7 +77,7 @@ src/ int main (int argc, char *argv[]) -@@ -315,10 +318,19 @@ section_name (Ebl *ebl, int idx) +@@ -320,10 +323,19 @@ section_name (Ebl *ebl, int idx) { GElf_Shdr shdr_mem; GElf_Shdr *shdr; @@ -98,7 +98,7 @@ src/ } -@@ -340,10 +352,6 @@ static const int valid_e_machine[] = +@@ -345,10 +357,6 @@ static const int valid_e_machine[] = (sizeof (valid_e_machine) / sizeof (valid_e_machine[0])) @@ -109,7 +109,7 @@ src/ static void check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size) { -@@ -605,7 +613,8 @@ section [%2d] '%s': symbol table cannot +@@ -613,7 +621,8 @@ section [%2d] '%s': symbol table cannot } } @@ -119,7 +119,7 @@ src/ ERROR (gettext ("\ section [%2u] '%s': entry size is does not match ElfXX_Sym\n"), idx, section_name (ebl, idx)); -@@ -643,7 +652,7 @@ section [%2d] '%s': XINDEX for zeroth en +@@ -651,7 +660,7 @@ section [%2d] '%s': XINDEX for zeroth en xndxscnidx, section_name (ebl, xndxscnidx)); } @@ -128,7 +128,7 @@ src/ { sym = gelf_getsymshndx (data, xndxdata, cnt, &sym_mem, &xndx); if (sym == NULL) -@@ -661,7 +670,8 @@ section [%2d] '%s': symbol %zu: invalid +@@ -671,7 +680,8 @@ section [%2d] '%s': symbol %zu: invalid else { name = elf_strptr (ebl->elf, shdr->sh_link, sym->st_name); @@ -138,7 +138,7 @@ src/ } if (sym->st_shndx == SHN_XINDEX) -@@ -991,9 +1001,11 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e +@@ -1001,9 +1011,11 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e { GElf_Shdr rcshdr_mem; const GElf_Shdr *rcshdr = gelf_getshdr (scn, &rcshdr_mem); @@ -152,7 +152,7 @@ src/ { /* Found the dynamic section. Look through it. */ Elf_Data *d = elf_getdata (scn, NULL); -@@ -1003,7 +1015,9 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e +@@ -1013,7 +1025,9 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e { GElf_Dyn dyn_mem; GElf_Dyn *dyn = gelf_getdyn (d, cnt, &dyn_mem); @@ -163,7 +163,7 @@ src/ if (dyn->d_tag == DT_RELCOUNT) { -@@ -1017,7 +1031,9 @@ section [%2d] '%s': DT_RELCOUNT used for +@@ -1027,7 +1041,9 @@ section [%2d] '%s': DT_RELCOUNT used for /* Does the number specified number of relative relocations exceed the total number of relocations? */ @@ -174,7 +174,7 @@ src/ ERROR (gettext ("\ section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"), idx, section_name (ebl, idx), -@@ -1177,7 +1193,8 @@ section [%2d] '%s': no relocations for m +@@ -1187,7 +1203,8 @@ section [%2d] '%s': no relocations for m } } @@ -184,7 +184,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"), -@@ -1400,7 +1417,8 @@ check_rela (Ebl *ebl, GElf_Ehdr *ehdr, G +@@ -1410,7 +1427,8 @@ check_rela (Ebl *ebl, GElf_Ehdr *ehdr, G Elf_Data *symdata = elf_getdata (symscn, NULL); enum load_state state = state_undecided; @@ -194,7 +194,7 @@ src/ { GElf_Rela rela_mem; GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem); -@@ -1450,7 +1468,8 @@ check_rel (Ebl *ebl, GElf_Ehdr *ehdr, GE +@@ -1460,7 +1478,8 @@ check_rel (Ebl *ebl, GElf_Ehdr *ehdr, GE Elf_Data *symdata = elf_getdata (symscn, NULL); enum load_state state = state_undecided; @@ -204,7 +204,7 @@ src/ { GElf_Rel rel_mem; GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem); -@@ -1553,7 +1572,8 @@ section [%2d] '%s': referenced as string +@@ -1563,7 +1582,8 @@ section [%2d] '%s': referenced as string shdr->sh_link, section_name (ebl, shdr->sh_link), idx, section_name (ebl, idx)); @@ -214,7 +214,7 @@ src/ ERROR (gettext ("\ section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"), idx, section_name (ebl, idx)); -@@ -1563,7 +1583,7 @@ section [%2d] '%s': section entry size d +@@ -1573,7 +1593,7 @@ section [%2d] '%s': section entry size d idx, section_name (ebl, idx)); bool non_null_warned = false; @@ -223,7 +223,7 @@ src/ { GElf_Dyn dyn_mem; GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dyn_mem); -@@ -1844,6 +1864,8 @@ section [%2d] '%s': entry size does not +@@ -1854,6 +1874,8 @@ section [%2d] '%s': entry size does not idx, section_name (ebl, idx)); if (symshdr != NULL @@ -232,7 +232,7 @@ src/ && (shdr->sh_size / shdr->sh_entsize < symshdr->sh_size / symshdr->sh_entsize)) ERROR (gettext ("\ -@@ -1870,6 +1892,12 @@ section [%2d] '%s': extended section ind +@@ -1880,6 +1902,12 @@ section [%2d] '%s': extended section ind } Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL); @@ -245,7 +245,7 @@ src/ if (*((Elf32_Word *) data->d_buf) != 0) ERROR (gettext ("symbol 0 should have zero extended section index\n")); -@@ -1912,7 +1940,7 @@ section [%2d] '%s': hash table section i +@@ -1922,7 +1950,7 @@ section [%2d] '%s': hash table section i size_t maxidx = nchain; @@ -254,7 +254,7 @@ src/ { size_t symsize = symshdr->sh_size / symshdr->sh_entsize; -@@ -1923,18 +1951,28 @@ section [%2d] '%s': hash table section i +@@ -1933,18 +1961,28 @@ section [%2d] '%s': hash table section i maxidx = symsize; } @@ -285,7 +285,7 @@ src/ } -@@ -1964,18 +2002,28 @@ section [%2d] '%s': hash table section i +@@ -1974,18 +2012,28 @@ section [%2d] '%s': hash table section i maxidx = symsize; } @@ -317,7 +317,7 @@ src/ } -@@ -2000,7 +2048,7 @@ section [%2d] '%s': bitmask size not pow +@@ -2010,7 +2058,7 @@ section [%2d] '%s': bitmask size not pow if (shdr->sh_size < (4 + bitmask_words + nbuckets) * sizeof (Elf32_Word)) { ERROR (gettext ("\ @@ -326,7 +326,7 @@ src/ idx, section_name (ebl, idx), (long int) shdr->sh_size, (long int) ((4 + bitmask_words + nbuckets) * sizeof (Elf32_Word))); return; -@@ -2657,8 +2705,9 @@ section [%2d] '%s' refers in sh_link to +@@ -2682,8 +2730,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. */ @@ -338,9 +338,10 @@ src/ ERROR (gettext ("\ section [%2d] '%s' has different number of entries than symbol table [%2d] '%s'\n"), idx, section_name (ebl, idx), ---- elfutils-0.132/src/readelf.c.robustify -+++ elfutils-0.132/src/readelf.c -@@ -1107,6 +1107,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G +diff -up elfutils-0.135/src/readelf.c.robustify elfutils-0.135/src/readelf.c +--- elfutils-0.135/src/readelf.c.robustify ++++ elfutils-0.135/src/readelf.c +@@ -1111,6 +1111,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G Elf32_Word *grpref = (Elf32_Word *) data->d_buf; GElf_Sym sym_mem; @@ -349,7 +350,7 @@ src/ printf ((grpref[0] & GRP_COMDAT) ? ngettext ("\ \nCOMDAT section group [%2zu] '%s' with signature '%s' contains %zu entry:\n", -@@ -1119,8 +1121,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G +@@ -1123,8 +1125,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), @@ -360,7 +361,7 @@ src/ ?: gettext (""), data->d_size / sizeof (Elf32_Word) - 1); -@@ -1271,7 +1273,8 @@ static void +@@ -1275,7 +1277,8 @@ static void handle_dynamic (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr) { int class = gelf_getclass (ebl->elf); @@ -370,7 +371,7 @@ src/ Elf_Data *data; size_t cnt; size_t shstrndx; -@@ -1286,6 +1289,11 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn, +@@ -1290,6 +1293,11 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn, error (EXIT_FAILURE, 0, gettext ("cannot get section header string table index")); @@ -382,7 +383,7 @@ src/ printf (ngettext ("\ \nDynamic segment contains %lu entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n", "\ -@@ -1295,9 +1303,7 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn, +@@ -1299,9 +1307,7 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn, class == ELFCLASS32 ? 10 : 18, shdr->sh_addr, shdr->sh_offset, (int) shdr->sh_link, @@ -393,7 +394,7 @@ src/ fputs_unlocked (gettext (" Type Value\n"), stdout); for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt) -@@ -1797,6 +1803,13 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G +@@ -1801,6 +1807,13 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G error (EXIT_FAILURE, 0, gettext ("cannot get section header string table index")); @@ -407,7 +408,7 @@ src/ /* Now we can compute the number of entries in the section. */ unsigned int nsyms = data->d_size / (class == ELFCLASS32 ? sizeof (Elf32_Sym) -@@ -1807,15 +1820,12 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G +@@ -1811,15 +1824,12 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G nsyms), (unsigned int) elf_ndxscn (scn), elf_strptr (ebl->elf, shstrndx, shdr->sh_name), nsyms); @@ -424,7 +425,7 @@ src/ fputs_unlocked (class == ELFCLASS32 ? gettext ("\ -@@ -2051,7 +2061,13 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn, +@@ -2055,7 +2065,13 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn, error (EXIT_FAILURE, 0, gettext ("cannot get section header string table index")); @@ -439,7 +440,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", "\ -@@ -2062,9 +2078,7 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn, +@@ -2066,9 +2082,7 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn, class == ELFCLASS32 ? 10 : 18, shdr->sh_addr, shdr->sh_offset, (unsigned int) shdr->sh_link, @@ -450,7 +451,7 @@ src/ unsigned int offset = 0; for (int cnt = shdr->sh_info; --cnt >= 0; ) -@@ -2117,8 +2131,14 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G +@@ -2121,8 +2135,14 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G error (EXIT_FAILURE, 0, gettext ("cannot get section header string table index")); @@ -466,7 +467,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", "\ -@@ -2130,9 +2150,7 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G +@@ -2134,9 +2154,7 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G class == ELFCLASS32 ? 10 : 18, shdr->sh_addr, shdr->sh_offset, (unsigned int) shdr->sh_link, @@ -477,7 +478,7 @@ src/ unsigned int offset = 0; for (int cnt = shdr->sh_info; --cnt >= 0; ) -@@ -2394,8 +2412,14 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G +@@ -2398,8 +2416,14 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G filename = NULL; } @@ -493,7 +494,7 @@ src/ printf (ngettext ("\ \nVersion symbols section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'", "\ -@@ -2407,9 +2431,7 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G +@@ -2411,9 +2435,7 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G class == ELFCLASS32 ? 10 : 18, shdr->sh_addr, shdr->sh_offset, (unsigned int) shdr->sh_link, @@ -504,7 +505,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) -@@ -2461,7 +2483,17 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn, +@@ -2465,7 +2487,17 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn, for (Elf32_Word cnt = 0; cnt < nbucket; ++cnt) ++counts[lengths[cnt]]; @@ -523,7 +524,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", "\ -@@ -2474,9 +2506,7 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn, +@@ -2478,9 +2510,7 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn, shdr->sh_addr, shdr->sh_offset, (unsigned int) shdr->sh_link, @@ -534,7 +535,7 @@ src/ if (extrastr != NULL) fputs (extrastr, stdout); -@@ -3875,6 +3905,16 @@ print_debug_aranges_section (Dwfl_Module +@@ -4039,6 +4069,16 @@ print_debug_aranges_section (Dwfl_Module return; } @@ -551,9 +552,10 @@ src/ printf (ngettext ("\ \nDWARF section '%s' at offset %#" PRIx64 " contains %zu entry:\n", "\ ---- elfutils-0.132/src/strip.c.robustify -+++ elfutils-0.132/src/strip.c -@@ -543,6 +543,11 @@ handle_elf (int fd, Elf *elf, const char +diff -up elfutils-0.135/src/strip.c.robustify elfutils-0.135/src/strip.c +--- elfutils-0.135/src/strip.c.robustify ++++ elfutils-0.135/src/strip.c +@@ -544,6 +544,11 @@ handle_elf (int fd, Elf *elf, const char goto fail_close; } @@ -565,7 +567,7 @@ src/ /* Storage for section information. We leave room for two more entries since we unconditionally create a section header string table. Maybe some weird tool created an ELF file without one. -@@ -564,7 +569,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -565,7 +570,7 @@ handle_elf (int fd, Elf *elf, const char { /* This should always be true (i.e., there should not be any holes in the numbering). */ @@ -574,7 +576,7 @@ src/ shdr_info[cnt].scn = scn; -@@ -577,6 +582,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -578,6 +583,7 @@ handle_elf (int fd, Elf *elf, const char shdr_info[cnt].shdr.sh_name); if (shdr_info[cnt].name == NULL) { @@ -582,7 +584,7 @@ src/ error (0, 0, gettext ("illformed file '%s'"), fname); goto fail_close; } -@@ -586,6 +592,8 @@ handle_elf (int fd, Elf *elf, const char +@@ -587,6 +593,8 @@ handle_elf (int fd, Elf *elf, const char /* Remember the shdr.sh_link value. */ shdr_info[cnt].old_sh_link = shdr_info[cnt].shdr.sh_link; @@ -591,7 +593,7 @@ src/ /* Sections in files other than relocatable object files which are not loaded can be freely moved by us. In relocatable -@@ -598,7 +606,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -599,7 +607,7 @@ handle_elf (int fd, Elf *elf, const char appropriate reference. */ if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB_SHNDX)) { @@ -600,7 +602,7 @@ src/ shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx = cnt; } else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GROUP)) -@@ -615,7 +623,12 @@ handle_elf (int fd, Elf *elf, const char +@@ -616,7 +624,12 @@ handle_elf (int fd, Elf *elf, const char for (inner = 1; inner < shdr_info[cnt].data->d_size / sizeof (Elf32_Word); ++inner) @@ -613,7 +615,7 @@ src/ if (inner == 1 || (inner == 2 && (grpref[0] & GRP_COMDAT) == 0)) /* If the section group contains only one element and this -@@ -626,7 +639,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -627,7 +640,7 @@ handle_elf (int fd, Elf *elf, const char } else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GNU_versym)) { @@ -622,7 +624,7 @@ src/ shdr_info[shdr_info[cnt].shdr.sh_link].version_idx = cnt; } -@@ -634,7 +647,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -635,7 +648,7 @@ handle_elf (int fd, Elf *elf, const char discarded right away. */ if ((shdr_info[cnt].shdr.sh_flags & SHF_GROUP) != 0) { @@ -631,7 +633,7 @@ src/ if (shdr_info[shdr_info[cnt].group_idx].idx == 0) { -@@ -709,11 +722,15 @@ handle_elf (int fd, Elf *elf, const char +@@ -710,11 +723,15 @@ handle_elf (int fd, Elf *elf, const char { /* If a relocation section is marked as being removed make sure the section it is relocating is removed, too. */ @@ -649,7 +651,7 @@ src/ if (shdr_info[cnt].idx == 1) { -@@ -738,7 +755,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -741,7 +758,7 @@ handle_elf (int fd, Elf *elf, const char if (shdr_info[cnt].symtab_idx != 0 && shdr_info[shdr_info[cnt].symtab_idx].data == NULL) { @@ -658,7 +660,7 @@ src/ shdr_info[shdr_info[cnt].symtab_idx].data = elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn, -@@ -778,6 +795,9 @@ handle_elf (int fd, Elf *elf, const char +@@ -781,6 +798,9 @@ handle_elf (int fd, Elf *elf, const char else if (scnidx == SHN_XINDEX) scnidx = xndx; @@ -666,9 +668,9 @@ src/ + goto illformed; + if (shdr_info[scnidx].idx == 0) - { - /* Mark this section as used. */ -@@ -809,12 +829,16 @@ handle_elf (int fd, Elf *elf, const char + /* This symbol table has a real symbol in + a discarded section. So preserve the +@@ -811,12 +831,16 @@ handle_elf (int fd, Elf *elf, const char } /* Handle references through sh_info. */ @@ -687,7 +689,7 @@ src/ /* Mark the section as investigated. */ shdr_info[cnt].idx = 2; -@@ -914,7 +938,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -954,7 +978,7 @@ handle_elf (int fd, Elf *elf, const char error (EXIT_FAILURE, 0, gettext ("while generating output file: %s"), elf_errmsg (-1)); @@ -696,7 +698,7 @@ src/ /* Add this name to the section header string table. */ shdr_info[cnt].se = ebl_strtabadd (shst, shdr_info[cnt].name, 0); -@@ -951,7 +975,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -991,7 +1015,7 @@ handle_elf (int fd, Elf *elf, const char error (EXIT_FAILURE, 0, gettext ("while create section header section: %s"), elf_errmsg (-1)); @@ -705,7 +707,7 @@ src/ shdr_info[cnt].data = elf_newdata (shdr_info[cnt].newscn); if (shdr_info[cnt].data == NULL) -@@ -1007,7 +1031,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -1047,7 +1071,7 @@ handle_elf (int fd, Elf *elf, const char error (EXIT_FAILURE, 0, gettext ("while create section header section: %s"), elf_errmsg (-1)); @@ -714,7 +716,7 @@ src/ /* Finalize the string table and fill in the correct indices in the section headers. */ -@@ -1097,20 +1121,20 @@ handle_elf (int fd, Elf *elf, const char +@@ -1137,20 +1161,20 @@ handle_elf (int fd, Elf *elf, const char shndxdata = elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn, NULL); @@ -738,7 +740,7 @@ src/ >= shdr_info[cnt].data->d_size / elsize); } -@@ -1165,7 +1189,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -1205,7 +1229,7 @@ handle_elf (int fd, Elf *elf, const char sec = shdr_info[sym->st_shndx].idx; else { @@ -747,7 +749,7 @@ src/ sec = shdr_info[xshndx].idx; } -@@ -1186,7 +1210,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -1226,7 +1250,7 @@ handle_elf (int fd, Elf *elf, const char nxshndx = sec; } @@ -756,8 +758,8 @@ src/ if ((inner != destidx || nshndx != sym->st_shndx || (shndxdata != NULL && nxshndx != xshndx)) -@@ -1209,7 +1233,7 @@ handle_elf (int fd, Elf *elf, const char - else +@@ -1250,7 +1274,7 @@ handle_elf (int fd, Elf *elf, const char + || shdr_info[cnt].debug_data == NULL) /* This is a section symbol for a section which has been removed. */ - assert (GELF_ST_TYPE (sym->st_info) == STT_SECTION); @@ -765,45 +767,46 @@ src/ } if (destidx != inner) -@@ -1388,11 +1412,11 @@ handle_elf (int fd, Elf *elf, const char - { - GElf_Sym sym_mem; - GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem); -- assert (sym != NULL); -+ elf_assert (sym != NULL); +@@ -1437,11 +1461,11 @@ handle_elf (int fd, Elf *elf, const char + { + GElf_Sym sym_mem; + GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem); +- assert (sym != NULL); ++ elf_assert (sym != NULL); - const char *name = elf_strptr (elf, strshndx, - sym->st_name); -- assert (name != NULL); -+ elf_assert (name != NULL); - size_t hidx = elf_hash (name) % nbucket; + const char *name = elf_strptr (elf, strshndx, + sym->st_name); +- assert (name != NULL); ++ elf_assert (name != NULL); + size_t hidx = elf_hash (name) % nbucket; - if (bucket[hidx] == 0) -@@ -1411,7 +1435,7 @@ handle_elf (int fd, Elf *elf, const char - else - { - /* Alpha and S390 64-bit use 64-bit SHT_HASH entries. */ -- assert (shdr_info[cnt].shdr.sh_entsize -+ elf_assert (shdr_info[cnt].shdr.sh_entsize - == sizeof (Elf64_Xword)); + if (bucket[hidx] == 0) +@@ -1460,7 +1484,7 @@ handle_elf (int fd, Elf *elf, const char + else + { + /* Alpha and S390 64-bit use 64-bit SHT_HASH entries. */ +- assert (shdr_info[cnt].shdr.sh_entsize ++ elf_assert (shdr_info[cnt].shdr.sh_entsize + == sizeof (Elf64_Xword)); - Elf64_Xword *bucket = (Elf64_Xword *) hashd->d_buf; -@@ -1442,11 +1466,11 @@ handle_elf (int fd, Elf *elf, const char - { - GElf_Sym sym_mem; - GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem); -- assert (sym != NULL); -+ elf_assert (sym != NULL); + Elf64_Xword *bucket = (Elf64_Xword *) hashd->d_buf; +@@ -1491,11 +1515,11 @@ handle_elf (int fd, Elf *elf, const char + { + GElf_Sym sym_mem; + GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem); +- assert (sym != NULL); ++ elf_assert (sym != NULL); - const char *name = elf_strptr (elf, strshndx, - sym->st_name); -- assert (name != NULL); -+ elf_assert (name != NULL); - size_t hidx = elf_hash (name) % nbucket; + const char *name = elf_strptr (elf, strshndx, + sym->st_name); +- assert (name != NULL); ++ elf_assert (name != NULL); + size_t hidx = elf_hash (name) % nbucket; - if (bucket[hidx] == 0) ---- elfutils-0.132/libelf/gelf_getdyn.c.robustify -+++ elfutils-0.132/libelf/gelf_getdyn.c + if (bucket[hidx] == 0) +diff -up elfutils-0.135/libelf/gelf_getdyn.c.robustify elfutils-0.135/libelf/gelf_getdyn.c +--- elfutils-0.135/libelf/gelf_getdyn.c.robustify ++++ elfutils-0.135/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 @@ -824,8 +827,9 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.132/libelf/gelf_getrel.c.robustify -+++ elfutils-0.132/libelf/gelf_getrel.c +diff -up elfutils-0.135/libelf/gelf_getrel.c.robustify elfutils-0.135/libelf/gelf_getrel.c +--- elfutils-0.135/libelf/gelf_getrel.c.robustify ++++ elfutils-0.135/libelf/gelf_getrel.c @@ -71,12 +71,6 @@ gelf_getrel (data, ndx, dst) if (data_scn == NULL) return NULL; @@ -859,8 +863,9 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); result = NULL; ---- elfutils-0.132/libelf/gelf_getversym.c.robustify -+++ elfutils-0.132/libelf/gelf_getversym.c +diff -up elfutils-0.135/libelf/gelf_getversym.c.robustify elfutils-0.135/libelf/gelf_getversym.c +--- elfutils-0.135/libelf/gelf_getversym.c.robustify ++++ elfutils-0.135/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 @@ -871,8 +876,9 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); result = NULL; ---- elfutils-0.132/libelf/elf_newscn.c.robustify -+++ elfutils-0.132/libelf/elf_newscn.c +diff -up elfutils-0.135/libelf/elf_newscn.c.robustify elfutils-0.135/libelf/elf_newscn.c +--- elfutils-0.135/libelf/elf_newscn.c.robustify ++++ elfutils-0.135/libelf/elf_newscn.c @@ -104,10 +104,18 @@ elf_newscn (elf) else { @@ -893,8 +899,9 @@ src/ newp = (Elf_ScnList *) calloc (sizeof (Elf_ScnList) + ((elf->state.elf.scnincr *= 2) * sizeof (Elf_Scn)), 1); ---- elfutils-0.132/libelf/elf32_getshdr.c.robustify -+++ elfutils-0.132/libelf/elf32_getshdr.c +diff -up elfutils-0.135/libelf/elf32_getshdr.c.robustify elfutils-0.135/libelf/elf32_getshdr.c +--- elfutils-0.135/libelf/elf32_getshdr.c.robustify ++++ elfutils-0.135/libelf/elf32_getshdr.c @@ -101,7 +101,8 @@ elfw2(LIBELFBITS,getshdr) (scn) goto out; @@ -922,8 +929,9 @@ src/ ElfW2(LIBELFBITS,Shdr) *notcvt; /* All the data is already mapped. If we could use it ---- elfutils-0.132/libelf/gelf_getsymshndx.c.robustify -+++ elfutils-0.132/libelf/gelf_getsymshndx.c +diff -up elfutils-0.135/libelf/gelf_getsymshndx.c.robustify elfutils-0.135/libelf/gelf_getsymshndx.c +--- elfutils-0.135/libelf/gelf_getsymshndx.c.robustify ++++ elfutils-0.135/libelf/gelf_getsymshndx.c @@ -90,7 +90,9 @@ gelf_getsymshndx (symdata, shndxdata, nd section index table. */ if (likely (shndxdata_scn != NULL)) @@ -955,8 +963,9 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.132/libelf/gelf_update_versym.c.robustify -+++ elfutils-0.132/libelf/gelf_update_versym.c +diff -up elfutils-0.135/libelf/gelf_update_versym.c.robustify elfutils-0.135/libelf/gelf_update_versym.c +--- elfutils-0.135/libelf/gelf_update_versym.c.robustify ++++ elfutils-0.135/libelf/gelf_update_versym.c @@ -75,7 +75,7 @@ gelf_update_versym (data, ndx, src) assert (sizeof (GElf_Versym) == sizeof (Elf64_Versym)); @@ -966,8 +975,9 @@ src/ || unlikely ((ndx + 1) * sizeof (GElf_Versym) > data_scn->d.d_size)) { __libelf_seterrno (ELF_E_INVALID_INDEX); ---- elfutils-0.132/libelf/elf_getshstrndx.c.robustify -+++ elfutils-0.132/libelf/elf_getshstrndx.c +diff -up elfutils-0.135/libelf/elf_getshstrndx.c.robustify elfutils-0.135/libelf/elf_getshstrndx.c +--- elfutils-0.135/libelf/elf_getshstrndx.c.robustify ++++ elfutils-0.135/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 @@ -1024,8 +1034,9 @@ src/ else { /* We avoid reading in all the section headers. Just read ---- elfutils-0.132/libelf/libelfP.h.robustify -+++ elfutils-0.132/libelf/libelfP.h +diff -up elfutils-0.135/libelf/libelfP.h.robustify elfutils-0.135/libelf/libelfP.h +--- elfutils-0.135/libelf/libelfP.h.robustify ++++ elfutils-0.135/libelf/libelfP.h @@ -596,4 +596,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) @@ -1040,8 +1051,9 @@ src/ +#endif + #endif /* libelfP.h */ ---- elfutils-0.132/libelf/gelf_getmove.c.robustify -+++ elfutils-0.132/libelf/gelf_getmove.c +diff -up elfutils-0.135/libelf/gelf_getmove.c.robustify elfutils-0.135/libelf/gelf_getmove.c +--- elfutils-0.135/libelf/gelf_getmove.c.robustify ++++ elfutils-0.135/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 @@ -1052,8 +1064,9 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.132/libelf/elf32_updatefile.c.robustify -+++ elfutils-0.132/libelf/elf32_updatefile.c +diff -up elfutils-0.135/libelf/elf32_updatefile.c.robustify elfutils-0.135/libelf/elf32_updatefile.c +--- elfutils-0.135/libelf/elf32_updatefile.c.robustify ++++ elfutils-0.135/libelf/elf32_updatefile.c @@ -212,6 +212,9 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf /* Write all the sections. Well, only those which are modified. */ if (shnum > 0) @@ -1075,8 +1088,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.132/libelf/gelf_update_lib.c.robustify -+++ elfutils-0.132/libelf/gelf_update_lib.c +diff -up elfutils-0.135/libelf/gelf_update_lib.c.robustify elfutils-0.135/libelf/gelf_update_lib.c +--- elfutils-0.135/libelf/gelf_update_lib.c.robustify ++++ elfutils-0.135/libelf/gelf_update_lib.c @@ -68,12 +68,6 @@ gelf_update_lib (data, ndx, src) if (data == NULL) return 0; @@ -1100,8 +1114,9 @@ src/ __libelf_seterrno (ELF_E_INVALID_INDEX); else { ---- elfutils-0.132/libelf/elf32_getphdr.c.robustify -+++ elfutils-0.132/libelf/elf32_getphdr.c +diff -up elfutils-0.135/libelf/elf32_getphdr.c.robustify elfutils-0.135/libelf/elf32_getphdr.c +--- elfutils-0.135/libelf/elf32_getphdr.c.robustify ++++ elfutils-0.135/libelf/elf32_getphdr.c @@ -116,6 +116,16 @@ elfw2(LIBELFBITS,getphdr) (elf) if (elf->map_address != NULL) @@ -1119,8 +1134,9 @@ src/ /* All the data is already mapped. Use it. */ void *file_phdr = ((char *) elf->map_address + elf->start_offset + ehdr->e_phoff); ---- elfutils-0.132/libelf/gelf_getlib.c.robustify -+++ elfutils-0.132/libelf/gelf_getlib.c +diff -up elfutils-0.135/libelf/gelf_getlib.c.robustify elfutils-0.135/libelf/gelf_getlib.c +--- elfutils-0.135/libelf/gelf_getlib.c.robustify ++++ elfutils-0.135/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. */ @@ -1131,8 +1147,9 @@ src/ __libelf_seterrno (ELF_E_INVALID_INDEX); else { ---- elfutils-0.132/libelf/elf32_newphdr.c.robustify -+++ elfutils-0.132/libelf/elf32_newphdr.c +diff -up elfutils-0.135/libelf/elf32_newphdr.c.robustify elfutils-0.135/libelf/elf32_newphdr.c +--- elfutils-0.135/libelf/elf32_newphdr.c.robustify ++++ elfutils-0.135/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) @@ -1146,8 +1163,9 @@ src/ /* Allocate a new program header with the appropriate number of elements. */ result = (ElfW2(LIBELFBITS,Phdr) *) ---- elfutils-0.132/libelf/gelf_update_rela.c.robustify -+++ elfutils-0.132/libelf/gelf_update_rela.c +diff -up elfutils-0.135/libelf/gelf_update_rela.c.robustify elfutils-0.135/libelf/gelf_update_rela.c +--- elfutils-0.135/libelf/gelf_update_rela.c.robustify ++++ elfutils-0.135/libelf/gelf_update_rela.c @@ -68,12 +68,6 @@ gelf_update_rela (Elf_Data *dst, int ndx if (dst == NULL) return 0; @@ -1181,8 +1199,9 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.132/libelf/gelf_update_syminfo.c.robustify -+++ elfutils-0.132/libelf/gelf_update_syminfo.c +diff -up elfutils-0.135/libelf/gelf_update_syminfo.c.robustify elfutils-0.135/libelf/gelf_update_syminfo.c +--- elfutils-0.135/libelf/gelf_update_syminfo.c.robustify ++++ elfutils-0.135/libelf/gelf_update_syminfo.c @@ -72,12 +72,6 @@ gelf_update_syminfo (data, ndx, src) if (data == NULL) return 0; @@ -1206,8 +1225,9 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.132/libelf/gelf_update_sym.c.robustify -+++ elfutils-0.132/libelf/gelf_update_sym.c +diff -up elfutils-0.135/libelf/gelf_update_sym.c.robustify elfutils-0.135/libelf/gelf_update_sym.c +--- elfutils-0.135/libelf/gelf_update_sym.c.robustify ++++ elfutils-0.135/libelf/gelf_update_sym.c @@ -72,12 +72,6 @@ gelf_update_sym (data, ndx, src) if (data == NULL) return 0; @@ -1241,8 +1261,9 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.132/libelf/gelf_getsyminfo.c.robustify -+++ elfutils-0.132/libelf/gelf_getsyminfo.c +diff -up elfutils-0.135/libelf/gelf_getsyminfo.c.robustify elfutils-0.135/libelf/gelf_getsyminfo.c +--- elfutils-0.135/libelf/gelf_getsyminfo.c.robustify ++++ elfutils-0.135/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 @@ -1253,8 +1274,9 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.132/libelf/gelf_update_symshndx.c.robustify -+++ elfutils-0.132/libelf/gelf_update_symshndx.c +diff -up elfutils-0.135/libelf/gelf_update_symshndx.c.robustify elfutils-0.135/libelf/gelf_update_symshndx.c +--- elfutils-0.135/libelf/gelf_update_symshndx.c.robustify ++++ elfutils-0.135/libelf/gelf_update_symshndx.c @@ -77,12 +77,6 @@ gelf_update_symshndx (symdata, shndxdata if (symdata == NULL) return 0; @@ -1288,8 +1310,9 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.132/libelf/elf_getarsym.c.robustify -+++ elfutils-0.132/libelf/elf_getarsym.c +diff -up elfutils-0.135/libelf/elf_getarsym.c.robustify elfutils-0.135/libelf/elf_getarsym.c +--- elfutils-0.135/libelf/elf_getarsym.c.robustify ++++ elfutils-0.135/libelf/elf_getarsym.c @@ -179,6 +179,9 @@ elf_getarsym (elf, ptr) size_t index_size = atol (tmpbuf); @@ -1300,8 +1323,9 @@ src/ || n * sizeof (uint32_t) > index_size) { /* This index table cannot be right since it does not fit into ---- elfutils-0.132/libelf/gelf_getsym.c.robustify -+++ elfutils-0.132/libelf/gelf_getsym.c +diff -up elfutils-0.135/libelf/gelf_getsym.c.robustify elfutils-0.135/libelf/gelf_getsym.c +--- elfutils-0.135/libelf/gelf_getsym.c.robustify ++++ elfutils-0.135/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 @@ -1322,8 +1346,9 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.132/libelf/elf_begin.c.robustify -+++ elfutils-0.132/libelf/elf_begin.c +diff -up elfutils-0.135/libelf/elf_begin.c.robustify elfutils-0.135/libelf/elf_begin.c +--- elfutils-0.135/libelf/elf_begin.c.robustify ++++ elfutils-0.135/libelf/elf_begin.c @@ -155,7 +155,8 @@ get_shnum (void *map_address, unsigned c if (unlikely (result == 0) && ehdr.e32->e_shoff != 0) @@ -1419,8 +1444,9 @@ src/ for (size_t cnt = 0; cnt < scncnt; ++cnt) { ---- elfutils-0.132/libelf/gelf_update_rel.c.robustify -+++ elfutils-0.132/libelf/gelf_update_rel.c +diff -up elfutils-0.135/libelf/gelf_update_rel.c.robustify elfutils-0.135/libelf/gelf_update_rel.c +--- elfutils-0.135/libelf/gelf_update_rel.c.robustify ++++ elfutils-0.135/libelf/gelf_update_rel.c @@ -68,12 +68,6 @@ gelf_update_rel (Elf_Data *dst, int ndx, if (dst == NULL) return 0; @@ -1454,8 +1480,9 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.132/libelf/gelf_update_move.c.robustify -+++ elfutils-0.132/libelf/gelf_update_move.c +diff -up elfutils-0.135/libelf/gelf_update_move.c.robustify elfutils-0.135/libelf/gelf_update_move.c +--- elfutils-0.135/libelf/gelf_update_move.c.robustify ++++ elfutils-0.135/libelf/gelf_update_move.c @@ -75,7 +75,7 @@ gelf_update_move (data, ndx, src) assert (sizeof (GElf_Move) == sizeof (Elf64_Move)); @@ -1465,8 +1492,9 @@ src/ || unlikely ((ndx + 1) * sizeof (GElf_Move) > data_scn->d.d_size)) { __libelf_seterrno (ELF_E_INVALID_INDEX); ---- elfutils-0.132/libelf/gelf_update_dyn.c.robustify -+++ elfutils-0.132/libelf/gelf_update_dyn.c +diff -up elfutils-0.135/libelf/gelf_update_dyn.c.robustify elfutils-0.135/libelf/gelf_update_dyn.c +--- elfutils-0.135/libelf/gelf_update_dyn.c.robustify ++++ elfutils-0.135/libelf/gelf_update_dyn.c @@ -71,12 +71,6 @@ gelf_update_dyn (data, ndx, src) if (data == NULL) return 0; @@ -1500,8 +1528,9 @@ src/ { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; ---- elfutils-0.132/libelf/gelf_getrela.c.robustify -+++ elfutils-0.132/libelf/gelf_getrela.c +diff -up elfutils-0.135/libelf/gelf_getrela.c.robustify elfutils-0.135/libelf/gelf_getrela.c +--- elfutils-0.135/libelf/gelf_getrela.c.robustify ++++ elfutils-0.135/libelf/gelf_getrela.c @@ -71,12 +71,6 @@ gelf_getrela (data, ndx, dst) if (data_scn == NULL) return NULL; diff --git a/elfutils-strip-copy-symtab.patch b/elfutils-strip-copy-symtab.patch deleted file mode 100644 index 35cc6b8..0000000 --- a/elfutils-strip-copy-symtab.patch +++ /dev/null @@ -1,199 +0,0 @@ -2006-09-19 Jakub Jelinek - - * strip.c (handle_elf): Formatting. If any relocation sections - stripped into separate debug info reference symtab that is kept, - emit symtab/strtab also into the separate debug info file. - ---- elfutils/src/strip.c -+++ elfutils/src/strip.c -@@ -399,6 +399,7 @@ handle_elf (int fd, Elf *elf, const char - Elf_Scn *newscn; - struct Ebl_Strent *se; - Elf32_Word *newsymidx; -+ void *debug_data; - } *shdr_info = NULL; - Elf_Scn *scn; - size_t cnt; -@@ -826,6 +827,37 @@ handle_elf (int fd, Elf *elf, const char - The ones that are not removed in the stripped file are SHT_NOBITS. */ - if (debug_fname != NULL) - { -+ /* libbfd and apps using it don't cope with separate debuginfo objects -+ with relocation sections against SHT_NOBITS .symtab/.strtab -+ - libbfd isn't able to look up the .symtab/.strtab in the stripped -+ object instead. As a workaround, emit .symtab/.strtab in both -+ places. */ -+ for (cnt = 1; cnt < shnum; ++cnt) -+ { -+ if (shdr_info[cnt].idx == 0 -+ && (shdr_info[cnt].shdr.sh_type == SHT_REL -+ || shdr_info[cnt].shdr.sh_type == SHT_RELA) -+ && (shdr_info[cnt].shdr.sh_flags & SHF_ALLOC) == 0) -+ { -+ Elf32_Word symtabidx = shdr_info[cnt].old_sh_link; -+ struct shdr_info *si = &shdr_info[symtabidx]; -+ si->debug_data = ""; -+ shdr_info[si->old_sh_link].debug_data = ""; -+ if (si->symtab_idx) -+ shdr_info[si->symtab_idx].debug_data = ""; -+ -+ if (si->shdr.sh_type != SHT_SYMTAB -+ || (si->shdr.sh_flags & SHF_ALLOC) -+ || shdr_info[si->old_sh_link].shdr.sh_type != SHT_STRTAB -+ || (shdr_info[si->old_sh_link].shdr.sh_flags & SHF_ALLOC) -+ || (si->symtab_idx -+ && (shdr_info[si->symtab_idx].shdr.sh_flags -+ & SHF_ALLOC))) -+ error (EXIT_FAILURE, 0, -+ gettext ("invalid symtab/strtab referenced by nonallocated section")); -+ } -+ } -+ - for (cnt = 1; cnt < shnum; ++cnt) - { - scn = elf_newscn (debugelf); -@@ -835,6 +867,7 @@ handle_elf (int fd, Elf *elf, const char - elf_errmsg (-1)); - - bool discard_section = (shdr_info[cnt].idx > 0 -+ && shdr_info[cnt].debug_data == NULL - && shdr_info[cnt].shdr.sh_type != SHT_NOTE - && cnt != ehdr->e_shstrndx); - -@@ -865,6 +898,13 @@ handle_elf (int fd, Elf *elf, const char - *debugdata = *shdr_info[cnt].data; - if (discard_section) - debugdata->d_buf = NULL; -+ else if (shdr_info[cnt].debug_data != NULL) -+ { -+ shdr_info[cnt].debug_data = xmalloc (debugdata->d_size); -+ memcpy (shdr_info[cnt].debug_data, debugdata->d_buf, -+ debugdata->d_size); -+ debugdata->d_buf = shdr_info[cnt].debug_data; -+ } - } - - /* Finish the ELF header. Fill in the fields not handled by -@@ -1056,7 +1096,7 @@ handle_elf (int fd, Elf *elf, const char - shdr_info[shdr_info[cnt].shdr.sh_info].idx; - - /* Get the data from the old file if necessary. We already -- created the data for the section header string table. */ -+ created the data for the section header string table. */ - if (cnt < shnum) - { - if (shdr_info[cnt].data == NULL) -@@ -1283,6 +1323,13 @@ handle_elf (int fd, Elf *elf, const char - if (shdr_info[shdr_info[cnt].old_sh_link].newsymidx == NULL) - continue; - -+ /* If the symbol table is not discarded, but additionally -+ duplicated in separate debug file and this section -+ is discarded, don't adjust anything. */ -+ if (shdr_info[cnt].idx == 0 -+ && shdr_info[shdr_info[cnt].old_sh_link].debug_data != NULL) -+ continue; -+ - Elf32_Word *newsymidx - = shdr_info[shdr_info[cnt].old_sh_link].newsymidx; - Elf_Data *d = elf_getdata (shdr_info[cnt].idx == 0 -@@ -1341,6 +1388,13 @@ handle_elf (int fd, Elf *elf, const char - if (shdr_info[symtabidx].newsymidx == NULL) - continue; - -+ /* If the symbol table is not discarded, but additionally -+ duplicated in separate debug file and this section -+ is discarded, don't adjust anything. */ -+ if (shdr_info[cnt].idx == 0 -+ && shdr_info[symtabidx].debug_data != NULL) -+ continue; -+ - assert (shdr_info[cnt].idx > 0); - - /* The hash section in the new file. */ -@@ -1460,7 +1514,7 @@ handle_elf (int fd, Elf *elf, const char - chain[hidx] = inner; - } - } -- } -+ } - } - else if (shdr_info[cnt].shdr.sh_type == SHT_GNU_versym) - { -@@ -1473,6 +1527,13 @@ handle_elf (int fd, Elf *elf, const char - if (shdr_info[symtabidx].newsymidx == NULL) - continue; - -+ /* If the symbol table is not discarded, but additionally -+ duplicated in separate debug file and this section -+ is discarded, don't adjust anything. */ -+ if (shdr_info[cnt].idx == 0 -+ && shdr_info[symtabidx].debug_data != NULL) -+ continue; -+ - assert (shdr_info[cnt].idx > 0); - - /* The symbol version section in the new file. */ -@@ -1515,20 +1576,27 @@ handle_elf (int fd, Elf *elf, const char - else if (shdr_info[cnt].shdr.sh_type == SHT_GROUP) - { - /* Check whether the associated symbol table changed. */ -- if (shdr_info[shdr_info[cnt].old_sh_link].newsymidx != NULL) -- { -- /* Yes the symbol table changed. Update the section -- header of the section group. */ -- scn = elf_getscn (newelf, shdr_info[cnt].idx); -- GElf_Shdr shdr_mem; -- GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); -- assert (shdr != NULL); -+ if (shdr_info[shdr_info[cnt].old_sh_link].newsymidx == NULL) -+ continue; - -- size_t stabidx = shdr_info[cnt].old_sh_link; -- shdr->sh_info = shdr_info[stabidx].newsymidx[shdr->sh_info]; -+ /* If the symbol table is not discarded, but additionally -+ duplicated in separate debug file and this section -+ is discarded, don't adjust anything. */ -+ if (shdr_info[cnt].idx == 0 -+ && shdr_info[shdr_info[cnt].old_sh_link].debug_data != NULL) -+ continue; - -- (void) gelf_update_shdr (scn, shdr); -- } -+ /* Yes the symbol table changed. Update the section -+ header of the section group. */ -+ scn = elf_getscn (newelf, shdr_info[cnt].idx); -+ GElf_Shdr shdr_mem; -+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); -+ assert (shdr != NULL); -+ -+ size_t stabidx = shdr_info[cnt].old_sh_link; -+ shdr->sh_info = shdr_info[stabidx].newsymidx[shdr->sh_info]; -+ -+ (void) gelf_update_shdr (scn, shdr); - } - } - } -@@ -1658,7 +1726,10 @@ handle_elf (int fd, Elf *elf, const char - table indices. */ - if (any_symtab_changes) - for (cnt = 1; cnt <= shdridx; ++cnt) -- free (shdr_info[cnt].newsymidx); -+ { -+ free (shdr_info[cnt].newsymidx); -+ free (shdr_info[cnt].debug_data); -+ } - - /* Free the memory. */ - if ((shnum + 2) * sizeof (struct shdr_info) > MAX_STACK_ALLOC) ---- elfutils/tests/run-strip-test5.sh.~1~ -+++ elfutils/tests/run-strip-test5.sh -@@ -1,5 +1,5 @@ - original=testfile8 --stripped=testfile16 --debugfile=testfile16.debug -+stripped=testfile16.symtab -+debugfile=testfile16.symtab.debug - - . $srcdir/run-strip-test.sh - diff --git a/elfutils.spec b/elfutils.spec index b6bd50b..e20c451 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,4 +1,4 @@ -%define eu_version 0.134 +%define eu_version 0.135 %define eu_release 1 %if %{?_with_compat:1}%{!?_with_compat:0} @@ -38,11 +38,6 @@ Patch2: elfutils-robustify.patch Requires: elfutils-libelf-%{_arch} = %{version}-%{release} Requires: elfutils-libs-%{_arch} = %{version}-%{release} -Patch0: elfutils-strip-copy-symtab.patch -Source2: testfile16.symtab.bz2 -Source3: testfile16.symtab.debug.bz2 - - BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: bison >= 1.875 BuildRequires: flex >= 2.5.4a @@ -147,22 +142,19 @@ for libelf. %prep %setup -q -%patch0 -p1 -ln -f %{SOURCE2} %{SOURCE3} tests || cp -f %{SOURCE2} %{SOURCE3} tests - %if !0%{?scanf_has_m} sed -i.scanf-m -e 's/%m/%a/' tests/line2addr.c %endif %if %{compat} -%patch1 -p1 +%patch1 -p1 -b .portability sleep 1 find . \( -name Makefile.in -o -name aclocal.m4 \) -print | xargs touch sleep 1 find . \( -name configure -o -name config.h.in \) -print | xargs touch %endif -%patch2 -p1 +%patch2 -p1 -b .robustify find . -name \*.sh ! -perm -0100 -print | xargs chmod +x @@ -270,6 +262,11 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/libelf.a %changelog +* Mon May 12 2008 Roland McGrath - 0.135-1 +- Update to 0.135 + - libdwfl: bug fixes + - eu-strip: changed handling of ET_REL files wrt symbol tables and relocs + * Wed Apr 9 2008 Roland McGrath - 0.134-1 - Update to 0.134 - elflint: backend improvements for sparc, alpha (#204170) diff --git a/sources b/sources index 6ae75e8..1652d0a 100644 --- a/sources +++ b/sources @@ -1,3 +1 @@ -07a924423a05b1bf6d0f9fe8b35dbe6b testfile16.symtab.bz2 -bd40d1aaca8eaf1c7aea54bf4b29bda2 testfile16.symtab.debug.bz2 -17b6dde57fec341ae785d5b7123da7c4 elfutils-0.134.tar.gz +2fb0d3d9cdb22f71ad0df91d676bb2eb elfutils-0.135.tar.gz From 7ec0f1ab436a0b92f2fd976e620b3c0230f1cc8e Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Mon, 7 Jul 2008 17:16:13 +0000 Subject: [PATCH 03/13] fix conditional comparison --- elfutils.spec | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/elfutils.spec b/elfutils.spec index e20c451..2fb7056 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,5 +1,5 @@ %define eu_version 0.135 -%define eu_release 1 +%define eu_release 2 %if %{?_with_compat:1}%{!?_with_compat:0} %define compat 1 @@ -7,17 +7,17 @@ %define compat 0 %endif -%if "%fedora" >= "8" +%if 0%{?fedora} >= 8 %define scanf_has_m 1 %endif -%if "%rhel" >= "6" +%if 0%{?rhel} >= 6 %define scanf_has_m 1 %endif -%if "%fedora" >= "7" +%if 0%{?fedora} >= 7 %define separate_devel_static 1 %endif -%if "%rhel" >= "6" +%if 0%{?rhel} >= 6 %define separate_devel_static 1 %endif @@ -262,6 +262,9 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/libelf.a %changelog +* Mon Jul 7 2008 Tom "spot" Callaway - 0.135-2 +- fix conditional comparison + * Mon May 12 2008 Roland McGrath - 0.135-1 - Update to 0.135 - libdwfl: bug fixes From f0710e5f52a22e1a8b6a7a8cf160e18c354fdfab Mon Sep 17 00:00:00 2001 From: roland Date: Wed, 27 Aug 2008 08:26:20 +0000 Subject: [PATCH 04/13] Update to 0.137 --- .cvsignore | 2 +- elfutils-portability.patch | 108 ++- elfutils-robustify.patch | 1514 ++++++++++++++++++------------------ elfutils.spec | 9 +- sources | 2 +- 5 files changed, 802 insertions(+), 833 deletions(-) diff --git a/.cvsignore b/.cvsignore index 38578b8..0da9d88 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -elfutils-0.135.tar.gz +elfutils-0.137.tar.gz diff --git a/elfutils-portability.patch b/elfutils-portability.patch index 6211cab..e12a63e 100644 --- a/elfutils-portability.patch +++ b/elfutils-portability.patch @@ -1,6 +1,6 @@ --- elfutils/backends/ChangeLog +++ elfutils/backends/ChangeLog -@@ -296,6 +296,11 @@ +@@ -315,6 +315,11 @@ * sparc_init.c: Likewise. * x86_64_init.c: Likewise. @@ -12,7 +12,7 @@ 2005-11-19 Roland McGrath * ppc64_reloc.def: REL30 -> ADDR30. -@@ -318,6 +323,9 @@ +@@ -337,6 +342,9 @@ * Makefile.am (uninstall): Don't try to remove $(pkgincludedir). (CLEANFILES): Add libebl_$(m).so. @@ -46,11 +46,11 @@ - i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c \ - i386_retval.c i386_regs.c i386_auxv.c + i386_retval.c i386_regs.c i386_auxv.c i386_syscall.c cpu_i386 = ../libcpu/libcpu_i386.a --- elfutils/backends/Makefile.in +++ elfutils/backends/Makefile.in -@@ -153,6 +153,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@ @@ -58,7 +58,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -182,6 +183,7 @@ SHELL = @SHELL@ +@@ -184,6 +185,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -66,7 +66,7 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -237,9 +239,9 @@ target_alias = @target_alias@ +@@ -239,9 +241,9 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \ @@ -80,7 +80,7 @@ -I$(top_srcdir)/lib -I.. --- elfutils/ChangeLog +++ elfutils/ChangeLog -@@ -30,6 +30,10 @@ +@@ -39,6 +39,10 @@ * configure.ac: Add dummy automake conditional to get dependencies for non-generic linker right. See src/Makefile.am. @@ -91,7 +91,7 @@ 2005-11-18 Roland McGrath * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable. -@@ -77,6 +81,17 @@ +@@ -86,6 +90,17 @@ * Makefile.am (all_SUBDIRS): Add libdwfl. * configure.ac: Write libdwfl/Makefile. @@ -129,7 +129,7 @@ YACC = @YACC@ --- elfutils/configure +++ elfutils/configure -@@ -674,6 +674,8 @@ YFLAGS +@@ -676,6 +676,8 @@ YFLAGS LEX LEX_OUTPUT_ROOT LEXLIB @@ -138,7 +138,7 @@ LOCALEDIR DATADIRNAME NATIVE_LD_TRUE -@@ -3877,6 +3879,88 @@ echo "$as_me: error: gcc with C99 suppor +@@ -3894,6 +3896,88 @@ echo "$as_me: error: gcc with C99 suppor fi @@ -227,40 +227,38 @@ LOCALEDIR=$datadir cat >>confdefs.h <<_ACEOF -@@ -5621,10 +5705,10 @@ YFLAGS!$YFLAGS$ac_delim +@@ -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 - LOCALEDIR!$LOCALEDIR$ac_delim - DATADIRNAME!$DATADIRNAME$ac_delim --NATIVE_LD_TRUE!$NATIVE_LD_TRUE$ac_delim --NATIVE_LD_FALSE!$NATIVE_LD_FALSE$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then -@@ -5666,6 +5750,8 @@ _ACEOF +@@ -5689,6 +5773,8 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF -+NATIVE_LD_TRUE!$NATIVE_LD_TRUE$ac_delim -+NATIVE_LD_FALSE!$NATIVE_LD_FALSE$ac_delim ++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 - NEVER_TRUE!$NEVER_TRUE$ac_delim - NEVER_FALSE!$NEVER_FALSE$ac_delim -@@ -5697,7 +5783,7 @@ LIBOBJS!$LIBOBJS$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` = 29; then -+ 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` = 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 -@@ -71,6 +71,34 @@ CFLAGS="$old_CFLAGS"]) +@@ -74,6 +74,34 @@ CFLAGS="$old_CFLAGS"]) AS_IF([test "x$ac_cv_c99" != xyes], AC_MSG_ERROR([gcc with C99 support required])) @@ -297,7 +295,7 @@ AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR") --- elfutils/lib/ChangeLog +++ elfutils/lib/ChangeLog -@@ -30,6 +30,11 @@ +@@ -41,6 +41,11 @@ * Makefile.am (libeu_a_SOURCES): Add it. * system.h: Declare crc32_file. @@ -477,7 +475,7 @@ INCLUDES = -I$(srcdir) -I$(srcdir)/../lib -I$(srcdir)/../libelf \ --- elfutils/libdw/ChangeLog +++ elfutils/libdw/ChangeLog -@@ -490,6 +490,11 @@ +@@ -495,6 +495,11 @@ 2005-05-31 Roland McGrath @@ -541,7 +539,7 @@ $(COMPILE))) --- elfutils/libdwfl/ChangeLog +++ elfutils/libdwfl/ChangeLog -@@ -806,6 +806,11 @@ +@@ -885,6 +885,11 @@ 2005-07-21 Roland McGrath @@ -572,7 +570,7 @@ VERSION = 1 --- elfutils/libdwfl/Makefile.in +++ elfutils/libdwfl/Makefile.in -@@ -129,6 +129,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -131,6 +131,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -580,7 +578,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -158,6 +159,7 @@ SHELL = @SHELL@ +@@ -160,6 +161,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = 1 @@ -588,7 +586,7 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -213,9 +215,9 @@ target_alias = @target_alias@ +@@ -215,9 +217,9 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wshadow -Wunused -Wformat=2 \ @@ -602,7 +600,7 @@ --- elfutils/libebl/ChangeLog +++ elfutils/libebl/ChangeLog -@@ -538,6 +538,11 @@ +@@ -554,6 +554,11 @@ * Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency tracking works right. @@ -633,7 +631,7 @@ INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \ --- elfutils/libebl/Makefile.in +++ elfutils/libebl/Makefile.in -@@ -122,6 +122,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -123,6 +123,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -641,7 +639,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -151,6 +152,7 @@ SHELL = @SHELL@ +@@ -152,6 +153,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = 1 @@ -649,7 +647,7 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -206,9 +208,9 @@ target_alias = @target_alias@ +@@ -207,9 +209,9 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \ @@ -663,7 +661,7 @@ --- elfutils/libelf/ChangeLog +++ elfutils/libelf/ChangeLog -@@ -359,6 +359,11 @@ +@@ -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. @@ -677,7 +675,7 @@ * elf.h: Update again. --- elfutils/libelf/common.h +++ elfutils/libelf/common.h -@@ -159,7 +159,7 @@ libelf_release_all (Elf *elf) +@@ -160,7 +160,7 @@ libelf_release_all (Elf *elf) (Var) = (sizeof (Var) == 1 \ ? (unsigned char) (Var) \ : (sizeof (Var) == 2 \ @@ -686,7 +684,7 @@ : (sizeof (Var) == 4 \ ? bswap_32 (Var) \ : bswap_64 (Var)))) -@@ -168,7 +168,7 @@ libelf_release_all (Elf *elf) +@@ -169,7 +169,7 @@ libelf_release_all (Elf *elf) (Dst) = (sizeof (Var) == 1 \ ? (unsigned char) (Var) \ : (sizeof (Var) == 2 \ @@ -705,30 +703,18 @@ if MUDFLAP AM_CFLAGS = -fmudflap else -@@ -33,7 +34,10 @@ endif +@@ -33,7 +34,7 @@ endif if BUILD_STATIC AM_CFLAGS += -fpic endif -AM_CFLAGS += -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 -std=gnu99 \ -+if BUILD_STATIC -+AM_CFLAGS += -fpic -+endif +AM_CFLAGS += -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \ $($(*F)_CFLAGS) INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I.. GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include) --- elfutils/libelf/Makefile.in +++ elfutils/libelf/Makefile.in -@@ -34,7 +34,7 @@ PRE_UNINSTALL = : - POST_UNINSTALL = : - build_triplet = @build@ - host_triplet = @host@ --@BUILD_STATIC_TRUE@am__append_1 = -fpic -+@BUILD_STATIC_TRUE@am__append_1 = -fpic -fpic - @MUDFLAP_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1) - @MUDFLAP_TRUE@am_libelf_pic_a_OBJECTS = - subdir = libelf -@@ -170,6 +170,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -171,6 +171,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -736,7 +722,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -199,6 +200,7 @@ SHELL = @SHELL@ +@@ -200,6 +201,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = 1 @@ -744,7 +730,7 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -254,10 +256,10 @@ target_alias = @target_alias@ +@@ -255,10 +257,10 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @MUDFLAP_FALSE@AM_CFLAGS = $(am__append_1) -Wall -Wshadow -Werror \ @@ -795,7 +781,7 @@ YACC = @YACC@ --- elfutils/src/ChangeLog +++ elfutils/src/ChangeLog -@@ -34,6 +34,11 @@ +@@ -61,6 +61,11 @@ that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really is valid in RELRO. @@ -807,7 +793,7 @@ 2008-02-29 Roland McGrath * readelf.c (print_attributes): Add a cast. -@@ -285,6 +290,8 @@ +@@ -312,6 +317,8 @@ * readelf.c (hex_dump): Fix rounding error in whitespace calculation. @@ -816,7 +802,7 @@ 2007-10-15 Roland McGrath * make-debug-archive.in: New file. -@@ -724,6 +731,10 @@ +@@ -751,6 +758,10 @@ * elflint.c (valid_e_machine): Add EM_ALPHA. Reported by Christian Aichinger . @@ -827,7 +813,7 @@ 2006-08-08 Ulrich Drepper * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB. -@@ -800,6 +811,10 @@ +@@ -827,6 +838,10 @@ * Makefile.am: Add hacks to create dependency files for non-generic linker. @@ -838,7 +824,7 @@ 2006-06-12 Ulrich Drepper * ldgeneric.c (ld_generic_generate_sections): Don't create .interp -@@ -1148,6 +1163,11 @@ +@@ -1175,6 +1190,11 @@ * readelf.c (print_debug_loc_section): Fix indentation for larger address size. @@ -940,7 +926,7 @@ size_LDADD = $(libelf) $(libeu) $(libmudflap) --- elfutils/src/readelf.c +++ elfutils/src/readelf.c -@@ -6340,7 +6340,7 @@ dump_archive_index (Elf *elf, const char +@@ -6419,7 +6419,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)) @@ -1030,7 +1016,7 @@ cannot set access and modification date of '%s'"), fname); --- elfutils/tests/ChangeLog +++ elfutils/tests/ChangeLog -@@ -45,6 +45,8 @@ +@@ -51,6 +51,8 @@ 2008-01-21 Roland McGrath @@ -1039,7 +1025,7 @@ * testfile45.S.bz2: Add tests for cltq, cqto. * testfile45.expect.bz2: Adjust. -@@ -753,6 +755,11 @@ +@@ -759,6 +761,11 @@ * Makefile.am (TESTS): Add run-elflint-test.sh. (EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2. diff --git a/elfutils-robustify.patch b/elfutils-robustify.patch index 5b582c7..1c3d3e7 100644 --- a/elfutils-robustify.patch +++ b/elfutils-robustify.patch @@ -65,8 +65,748 @@ src/ (check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic, check_symtab_shndx, check_hash, check_versym): Robustify. ---- elfutils-0.135/src/elflint.c.robustify -+++ elfutils-0.135/src/elflint.c +--- elfutils-0.136/libelf/elf32_getphdr.c.robustify ++++ elfutils-0.136/libelf/elf32_getphdr.c +@@ -105,6 +105,16 @@ __elfw2(LIBELFBITS,getphdr_wrlock) (elf) + + if (elf->map_address != NULL) + { ++ /* First see whether the information in the ELF header is ++ valid and it does not ask for too much. */ ++ if (unlikely (ehdr->e_phoff >= elf->maximum_size) ++ || unlikely (ehdr->e_phoff + size > elf->maximum_size)) ++ { ++ /* Something is wrong. */ ++ __libelf_seterrno (ELF_E_INVALID_PHDR); ++ goto out; ++ } ++ + /* 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 +@@ -1,5 +1,5 @@ + /* Return section header. +- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2007 Red Hat, Inc. ++ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2007, 2008 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper , 1998. + +@@ -81,7 +81,8 @@ load_shdr_rwlock (Elf_Scn *scn) + goto out; + + size_t shnum; +- if (__elf_getshnum_rdlock (elf, &shnum) != 0) ++ if (__elf_getshnum_rdlock (elf, &shnum) != 0 ++ || shnum > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Shdr))) + goto out; + size_t size = shnum * sizeof (ElfW2(LIBELFBITS,Shdr)); + +@@ -98,6 +99,16 @@ load_shdr_rwlock (Elf_Scn *scn) + + if (elf->map_address != NULL) + { ++ /* First see whether the information in the ELF header is ++ valid and it does not ask for too much. */ ++ if (unlikely (ehdr->e_shoff >= elf->maximum_size) ++ || unlikely (ehdr->e_shoff + size > elf->maximum_size)) ++ { ++ /* Something is wrong. */ ++ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER); ++ goto free_and_out; ++ } ++ + 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 +@@ -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) + { ++ if (unlikely (count > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Phdr)))) ++ { ++ result = NULL; ++ goto out; ++ } ++ + /* 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 + /* Write all the sections. Well, only those which are modified. */ + if (shnum > 0) + { ++ if (unlikely (shnum > SIZE_MAX / sizeof (Elf_Scn *))) ++ return 1; ++ + 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 + /* Write all the sections. Well, only those which are modified. */ + if (shnum > 0) + { ++ if (unlikely (shnum > SIZE_MAX / (sizeof (Elf_Scn *) ++ + sizeof (ElfW2(LIBELFBITS,Shdr))))) ++ return 1; ++ + 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 + + if (unlikely (result == 0) && ehdr.e32->e_shoff != 0) + { +- if (ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize) ++ if (unlikely (ehdr.e32->e_shoff >= maxsize) ++ || unlikely (ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize)) + /* Cannot read the first section header. */ + return 0; + +@@ -203,7 +204,8 @@ get_shnum (void *map_address, unsigned c + + if (unlikely (result == 0) && ehdr.e64->e_shoff != 0) + { +- if (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize) ++ if (unlikely (ehdr.e64->e_shoff >= maxsize) ++ || unlikely (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize)) + /* Cannot read the first section header. */ + return 0; + +@@ -275,6 +277,15 @@ file_read_elf (int fildes, void *map_add + /* Could not determine the number of sections. */ + return NULL; + ++ /* Check for too many sections. */ ++ if (e_ident[EI_CLASS] == ELFCLASS32) ++ { ++ if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf32_Shdr))) ++ return NULL; ++ } ++ else if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf64_Shdr))) ++ return NULL; ++ + /* 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 + { + /* We can use the mmapped memory. */ + elf->state.elf32.ehdr = ehdr; ++ ++ if (unlikely (ehdr->e_shoff >= maxsize) ++ || unlikely (ehdr->e_shoff ++ + scncnt * sizeof (Elf32_Shdr) > maxsize)) ++ { ++ free_and_out: ++ free (elf); ++ __libelf_seterrno (ELF_E_INVALID_FILE); ++ return NULL; ++ } + elf->state.elf32.shdr + = (Elf32_Shdr *) ((char *) ehdr + ehdr->e_shoff); ++ + if (ehdr->e_phnum > 0) ++ { + /* Assign a value only if there really is a program + header. Otherwise the value remains NULL. */ ++ if (unlikely (ehdr->e_phoff >= maxsize) ++ || unlikely (ehdr->e_phoff ++ + ehdr->e_phnum ++ * sizeof (Elf32_Phdr) > maxsize)) ++ goto free_and_out; + elf->state.elf32.phdr + = (Elf32_Phdr *) ((char *) ehdr + ehdr->e_phoff); ++ } + + for (size_t cnt = 0; cnt < scncnt; ++cnt) + { +@@ -396,13 +425,26 @@ file_read_elf (int fildes, void *map_add + { + /* We can use the mmapped memory. */ + elf->state.elf64.ehdr = ehdr; ++ ++ if (unlikely (ehdr->e_shoff >= maxsize) ++ || unlikely (ehdr->e_shoff ++ + scncnt * sizeof (Elf32_Shdr) > maxsize)) ++ goto free_and_out; + elf->state.elf64.shdr + = (Elf64_Shdr *) ((char *) ehdr + ehdr->e_shoff); ++ + if (ehdr->e_phnum > 0) ++ { + /* Assign a value only if there really is a program + header. Otherwise the value remains NULL. */ ++ if (unlikely (ehdr->e_phoff >= maxsize) ++ || unlikely (ehdr->e_phoff ++ + ehdr->e_phnum ++ * sizeof (Elf32_Phdr) > maxsize)) ++ goto free_and_out; + elf->state.elf64.phdr + = (Elf64_Phdr *) ((char *) ehdr + ehdr->e_phoff); ++ } + + for (size_t cnt = 0; cnt < scncnt; ++cnt) + { +--- elfutils-0.136/libelf/elf_getarsym.c.robustify ++++ elfutils-0.136/libelf/elf_getarsym.c +@@ -179,6 +179,9 @@ elf_getarsym (elf, ptr) + size_t index_size = atol (tmpbuf); + + if (SARMAG + sizeof (struct ar_hdr) + index_size > elf->maximum_size ++#if SIZE_MAX <= 4294967295U ++ || n >= SIZE_MAX / sizeof (Elf_Arsym) ++#endif + || 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 +@@ -125,10 +125,25 @@ elf_getshstrndx (elf, dst) + if (elf->map_address != NULL + && elf->state.elf32.ehdr->e_ident[EI_DATA] == MY_ELFDATA + && (ALLOW_UNALIGNED +- || (((size_t) ((char *) elf->map_address + offset)) ++ || (((size_t) ((char *) elf->map_address ++ + elf->start_offset + offset)) + & (__alignof__ (Elf32_Shdr) - 1)) == 0)) ++ { ++ /* First see whether the information in the ELF header is ++ valid and it does not ask for too much. */ ++ if (unlikely (offset + sizeof (Elf32_Shdr) ++ > elf->maximum_size)) ++ { ++ /* Something is wrong. */ ++ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER); ++ result = -1; ++ goto out; ++ } ++ + /* We can directly access the memory. */ +- num = ((Elf32_Shdr *) (elf->map_address + offset))->sh_link; ++ num = ((Elf32_Shdr *) (elf->map_address + elf->start_offset ++ + offset))->sh_link; ++ } + else + { + /* We avoid reading in all the section headers. Just read +@@ -163,10 +178,25 @@ elf_getshstrndx (elf, dst) + if (elf->map_address != NULL + && elf->state.elf64.ehdr->e_ident[EI_DATA] == MY_ELFDATA + && (ALLOW_UNALIGNED +- || (((size_t) ((char *) elf->map_address + offset)) ++ || (((size_t) ((char *) elf->map_address ++ + elf->start_offset + offset)) + & (__alignof__ (Elf64_Shdr) - 1)) == 0)) ++ { ++ /* First see whether the information in the ELF header is ++ valid and it does not ask for too much. */ ++ if (unlikely (offset + sizeof (Elf64_Shdr) ++ > elf->maximum_size)) ++ { ++ /* Something is wrong. */ ++ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER); ++ result = -1; ++ goto out; ++ } ++ + /* We can directly access the memory. */ +- num = ((Elf64_Shdr *) (elf->map_address + offset))->sh_link; ++ num = ((Elf64_Shdr *) (elf->map_address ++ + elf->start_offset + offset))->sh_link; ++ } + 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 +@@ -104,10 +104,18 @@ elf_newscn (elf) + else + { + /* We must allocate a new element. */ +- Elf_ScnList *newp; ++ Elf_ScnList *newp = NULL; + + assert (elf->state.elf.scnincr > 0); + ++ if ( ++#if SIZE_MAX <= 4294967295U ++ likely (elf->state.elf.scnincr ++ < SIZE_MAX / 2 / sizeof (Elf_Scn) - sizeof (Elf_ScnList)) ++#else ++ 1 ++#endif ++ ) + 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 +@@ -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 + data we are converting the format. */ +- if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf32_Dyn) ++ || unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size)) + { + __libelf_seterrno (ELF_E_INVALID_INDEX); + goto out; +@@ -114,7 +115,8 @@ gelf_getdyn (data, ndx, dst) + + /* The data is already in the correct form. Just make sure the + index is OK. */ +- if (unlikely ((ndx + 1) * sizeof (GElf_Dyn) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, GElf_Dyn) ++ || unlikely ((ndx + 1) * sizeof (GElf_Dyn) > data_scn->d.d_size)) + { + __libelf_seterrno (ELF_E_INVALID_INDEX); + goto out; +--- elfutils-0.136/libelf/gelf_getlib.c.robustify ++++ elfutils-0.136/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. */ + GElf_Lib *result = NULL; +- if (unlikely ((ndx + 1) * sizeof (GElf_Lib) > data->d_size)) ++ if (INVALID_NDX (ndx, GElf_Lib) ++ || unlikely ((ndx + 1) * sizeof (GElf_Lib) > data->d_size)) + __libelf_seterrno (ELF_E_INVALID_INDEX); + else + { +--- elfutils-0.136/libelf/gelf_getmove.c.robustify ++++ elfutils-0.136/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 + index is OK. */ +- if (unlikely ((ndx + 1) * sizeof (GElf_Move) > data->d_size)) ++ if (INVALID_NDX (ndx, GElf_Move) ++ || unlikely ((ndx + 1) * sizeof (GElf_Move) > data->d_size)) + { + __libelf_seterrno (ELF_E_INVALID_INDEX); + goto out; +--- elfutils-0.136/libelf/gelf_getrela.c.robustify ++++ elfutils-0.136/libelf/gelf_getrela.c +@@ -71,12 +71,6 @@ gelf_getrela (data, ndx, dst) + if (data_scn == NULL) + return NULL; + +- if (unlikely (ndx < 0)) +- { +- __libelf_seterrno (ELF_E_INVALID_INDEX); +- return NULL; +- } +- + if (unlikely (data_scn->d.d_type != ELF_T_RELA)) + { + __libelf_seterrno (ELF_E_INVALID_HANDLE); +@@ -93,7 +87,8 @@ gelf_getrela (data, ndx, dst) + if (scn->elf->class == ELFCLASS32) + { + /* We have to convert the data. */ +- if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf32_Rela) ++ || unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size)) + { + __libelf_seterrno (ELF_E_INVALID_INDEX); + result = NULL; +@@ -114,7 +109,8 @@ gelf_getrela (data, ndx, dst) + { + /* Simply copy the data after we made sure we are actually getting + correct data. */ +- if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf64_Rela) ++ || unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size)) + { + __libelf_seterrno (ELF_E_INVALID_INDEX); + result = NULL; +--- elfutils-0.136/libelf/gelf_getrel.c.robustify ++++ elfutils-0.136/libelf/gelf_getrel.c +@@ -71,12 +71,6 @@ gelf_getrel (data, ndx, dst) + if (data_scn == NULL) + return NULL; + +- if (unlikely (ndx < 0)) +- { +- __libelf_seterrno (ELF_E_INVALID_INDEX); +- return NULL; +- } +- + if (unlikely (data_scn->d.d_type != ELF_T_REL)) + { + __libelf_seterrno (ELF_E_INVALID_HANDLE); +@@ -93,7 +87,8 @@ gelf_getrel (data, ndx, dst) + if (scn->elf->class == ELFCLASS32) + { + /* We have to convert the data. */ +- if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf32_Rel) ++ || unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size)) + { + __libelf_seterrno (ELF_E_INVALID_INDEX); + result = NULL; +@@ -113,7 +108,8 @@ gelf_getrel (data, ndx, dst) + { + /* Simply copy the data after we made sure we are actually getting + correct data. */ +- if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf64_Rel) ++ || unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size)) + { + __libelf_seterrno (ELF_E_INVALID_INDEX); + result = NULL; +--- elfutils-0.136/libelf/gelf_getsym.c.robustify ++++ elfutils-0.136/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 + data we are converting the format. */ +- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data->d_size)) ++ if (INVALID_NDX (ndx, Elf32_Sym) ++ || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data->d_size)) + { + __libelf_seterrno (ELF_E_INVALID_INDEX); + goto out; +@@ -119,7 +120,8 @@ gelf_getsym (data, ndx, dst) + + /* The data is already in the correct form. Just make sure the + index is OK. */ +- if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > data->d_size)) ++ if (INVALID_NDX (ndx, GElf_Sym) ++ || unlikely ((ndx + 1) * sizeof (GElf_Sym) > data->d_size)) + { + __libelf_seterrno (ELF_E_INVALID_INDEX); + goto out; +--- elfutils-0.136/libelf/gelf_getsyminfo.c.robustify ++++ elfutils-0.136/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 + index is OK. */ +- if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data->d_size)) ++ if (INVALID_NDX (ndx, GElf_Syminfo) ++ || unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data->d_size)) + { + __libelf_seterrno (ELF_E_INVALID_INDEX); + goto out; +--- elfutils-0.136/libelf/gelf_getsymshndx.c.robustify ++++ elfutils-0.136/libelf/gelf_getsymshndx.c +@@ -90,7 +90,9 @@ gelf_getsymshndx (symdata, shndxdata, nd + section index table. */ + if (likely (shndxdata_scn != NULL)) + { +- if (unlikely ((ndx + 1) * sizeof (Elf32_Word) > shndxdata_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf32_Word) ++ || unlikely ((ndx + 1) * sizeof (Elf32_Word) ++ > shndxdata_scn->d.d_size)) + { + __libelf_seterrno (ELF_E_INVALID_INDEX); + goto out; +@@ -110,7 +112,8 @@ gelf_getsymshndx (symdata, shndxdata, nd + table entries has to be adopted. The user better has provided + a buffer where we can store the information. While copying the + data we are converting the format. */ +- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata->d_size)) ++ if (INVALID_NDX (ndx, Elf32_Sym) ++ || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata->d_size)) + { + __libelf_seterrno (ELF_E_INVALID_INDEX); + goto out; +@@ -139,7 +142,8 @@ gelf_getsymshndx (symdata, shndxdata, nd + + /* The data is already in the correct form. Just make sure the + index is OK. */ +- if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > symdata->d_size)) ++ if (INVALID_NDX (ndx, GElf_Sym) ++ || unlikely ((ndx + 1) * sizeof (GElf_Sym) > symdata->d_size)) + { + __libelf_seterrno (ELF_E_INVALID_INDEX); + goto out; +--- elfutils-0.136/libelf/gelf_getversym.c.robustify ++++ elfutils-0.136/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 + index is OK. */ +- if (unlikely ((ndx + 1) * sizeof (GElf_Versym) > data->d_size)) ++ if (INVALID_NDX (ndx, GElf_Versym) ++ || unlikely ((ndx + 1) * sizeof (GElf_Versym) > data->d_size)) + { + __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 +@@ -71,12 +71,6 @@ gelf_update_dyn (data, ndx, src) + if (data == NULL) + return 0; + +- if (unlikely (ndx < 0)) +- { +- __libelf_seterrno (ELF_E_INVALID_INDEX); +- return 0; +- } +- + if (unlikely (data_scn->d.d_type != ELF_T_DYN)) + { + /* The type of the data better should match. */ +@@ -102,7 +96,8 @@ gelf_update_dyn (data, ndx, src) + } + + /* Check whether we have to resize the data buffer. */ +- if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf32_Dyn) ++ || unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size)) + { + __libelf_seterrno (ELF_E_INVALID_INDEX); + goto out; +@@ -116,7 +111,8 @@ gelf_update_dyn (data, ndx, src) + else + { + /* Check whether we have to resize the data buffer. */ +- if (unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf64_Dyn) ++ || unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size)) + { + __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 +@@ -68,12 +68,6 @@ gelf_update_lib (data, ndx, src) + if (data == NULL) + return 0; + +- if (unlikely (ndx < 0)) +- { +- __libelf_seterrno (ELF_E_INVALID_INDEX); +- return 0; +- } +- + Elf_Data_Scn *data_scn = (Elf_Data_Scn *) data; + if (unlikely (data_scn->d.d_type != ELF_T_LIB)) + { +@@ -87,7 +81,8 @@ gelf_update_lib (data, ndx, src) + + /* Check whether we have to resize the data buffer. */ + int result = 0; +- if (unlikely ((ndx + 1) * sizeof (Elf64_Lib) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf64_Lib) ++ || unlikely ((ndx + 1) * sizeof (Elf64_Lib) > data_scn->d.d_size)) + __libelf_seterrno (ELF_E_INVALID_INDEX); + else + { +--- elfutils-0.136/libelf/gelf_update_move.c.robustify ++++ elfutils-0.136/libelf/gelf_update_move.c +@@ -75,7 +75,7 @@ gelf_update_move (data, ndx, src) + assert (sizeof (GElf_Move) == sizeof (Elf64_Move)); + + /* Check whether we have to resize the data buffer. */ +- if (unlikely (ndx < 0) ++ if (INVALID_NDX (ndx, GElf_Move) + || 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 +@@ -68,12 +68,6 @@ gelf_update_rela (Elf_Data *dst, int ndx + if (dst == NULL) + return 0; + +- if (unlikely (ndx < 0)) +- { +- __libelf_seterrno (ELF_E_INVALID_INDEX); +- return 0; +- } +- + if (unlikely (data_scn->d.d_type != ELF_T_RELA)) + { + /* The type of the data better should match. */ +@@ -101,7 +95,8 @@ gelf_update_rela (Elf_Data *dst, int ndx + } + + /* Check whether we have to resize the data buffer. */ +- if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf32_Rela) ++ || unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size)) + { + __libelf_seterrno (ELF_E_INVALID_INDEX); + goto out; +@@ -117,7 +112,8 @@ gelf_update_rela (Elf_Data *dst, int ndx + else + { + /* Check whether we have to resize the data buffer. */ +- if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf64_Rela) ++ || unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size)) + { + __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 +@@ -68,12 +68,6 @@ gelf_update_rel (Elf_Data *dst, int ndx, + if (dst == NULL) + return 0; + +- if (unlikely (ndx < 0)) +- { +- __libelf_seterrno (ELF_E_INVALID_INDEX); +- return 0; +- } +- + if (unlikely (data_scn->d.d_type != ELF_T_REL)) + { + /* The type of the data better should match. */ +@@ -99,7 +93,8 @@ gelf_update_rel (Elf_Data *dst, int ndx, + } + + /* Check whether we have to resize the data buffer. */ +- if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf32_Rel) ++ || unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size)) + { + __libelf_seterrno (ELF_E_INVALID_INDEX); + goto out; +@@ -114,7 +109,8 @@ gelf_update_rel (Elf_Data *dst, int ndx, + else + { + /* Check whether we have to resize the data buffer. */ +- if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf64_Rel) ++ || unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size)) + { + __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 +@@ -72,12 +72,6 @@ gelf_update_sym (data, ndx, src) + if (data == NULL) + return 0; + +- if (unlikely (ndx < 0)) +- { +- __libelf_seterrno (ELF_E_INVALID_INDEX); +- return 0; +- } +- + if (unlikely (data_scn->d.d_type != ELF_T_SYM)) + { + /* The type of the data better should match. */ +@@ -102,7 +96,8 @@ gelf_update_sym (data, ndx, src) + } + + /* Check whether we have to resize the data buffer. */ +- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf32_Sym) ++ || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data_scn->d.d_size)) + { + __libelf_seterrno (ELF_E_INVALID_INDEX); + goto out; +@@ -125,7 +120,8 @@ gelf_update_sym (data, ndx, src) + else + { + /* Check whether we have to resize the data buffer. */ +- if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf64_Sym) ++ || unlikely ((ndx + 1) * sizeof (Elf64_Sym) > data_scn->d.d_size)) + { + __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 +@@ -72,12 +72,6 @@ gelf_update_syminfo (data, ndx, src) + if (data == NULL) + return 0; + +- if (unlikely (ndx < 0)) +- { +- __libelf_seterrno (ELF_E_INVALID_INDEX); +- return 0; +- } +- + if (unlikely (data_scn->d.d_type != ELF_T_SYMINFO)) + { + /* The type of the data better should match. */ +@@ -93,7 +87,8 @@ gelf_update_syminfo (data, ndx, src) + rwlock_wrlock (scn->elf->lock); + + /* Check whether we have to resize the data buffer. */ +- if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, GElf_Syminfo) ++ || unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data_scn->d.d_size)) + { + __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 +@@ -77,12 +77,6 @@ gelf_update_symshndx (symdata, shndxdata + if (symdata == NULL) + return 0; + +- if (unlikely (ndx < 0)) +- { +- __libelf_seterrno (ELF_E_INVALID_INDEX); +- return 0; +- } +- + if (unlikely (symdata_scn->d.d_type != ELF_T_SYM)) + { + /* The type of the data better should match. */ +@@ -128,7 +122,8 @@ gelf_update_symshndx (symdata, shndxdata + } + + /* Check whether we have to resize the data buffer. */ +- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf32_Sym) ++ || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata_scn->d.d_size)) + { + __libelf_seterrno (ELF_E_INVALID_INDEX); + goto out; +@@ -151,7 +146,8 @@ gelf_update_symshndx (symdata, shndxdata + else + { + /* Check whether we have to resize the data buffer. */ +- if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > symdata_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf64_Sym) ++ || unlikely ((ndx + 1) * sizeof (Elf64_Sym) > symdata_scn->d.d_size)) + { + __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 +@@ -75,7 +75,7 @@ gelf_update_versym (data, ndx, src) + assert (sizeof (GElf_Versym) == sizeof (Elf64_Versym)); + + /* Check whether we have to resize the data buffer. */ +- if (unlikely (ndx < 0) ++ if (INVALID_NDX (ndx, GElf_Versym) + || 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 +@@ -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) + ++/* Convenience macro. Assumes int NDX and TYPE with size at least ++ 2 bytes. */ ++#if SIZE_MAX > 4294967295U ++# define INVALID_NDX(ndx, type) unlikely (ndx < 0) ++#else ++# define INVALID_NDX(ndx, type) \ ++ unlikely ((unsigned int) (ndx) >= SIZE_MAX / sizeof (type)) ++#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; /* Array to count references in section groups. */ static int *scnref; @@ -338,9 +1078,8 @@ src/ ERROR (gettext ("\ section [%2d] '%s' has different number of entries than symbol table [%2d] '%s'\n"), idx, section_name (ebl, idx), -diff -up elfutils-0.135/src/readelf.c.robustify elfutils-0.135/src/readelf.c ---- elfutils-0.135/src/readelf.c.robustify -+++ elfutils-0.135/src/readelf.c +--- 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 Elf32_Word *grpref = (Elf32_Word *) data->d_buf; @@ -552,9 +1291,8 @@ diff -up elfutils-0.135/src/readelf.c.robustify elfutils-0.135/src/readelf.c printf (ngettext ("\ \nDWARF section '%s' at offset %#" PRIx64 " contains %zu entry:\n", "\ -diff -up elfutils-0.135/src/strip.c.robustify elfutils-0.135/src/strip.c ---- elfutils-0.135/src/strip.c.robustify -+++ elfutils-0.135/src/strip.c +--- elfutils-0.136/src/strip.c.robustify ++++ elfutils-0.136/src/strip.c @@ -544,6 +544,11 @@ handle_elf (int fd, Elf *elf, const char goto fail_close; } @@ -804,763 +1542,3 @@ diff -up elfutils-0.135/src/strip.c.robustify elfutils-0.135/src/strip.c size_t hidx = elf_hash (name) % nbucket; if (bucket[hidx] == 0) -diff -up elfutils-0.135/libelf/gelf_getdyn.c.robustify elfutils-0.135/libelf/gelf_getdyn.c ---- elfutils-0.135/libelf/gelf_getdyn.c.robustify -+++ elfutils-0.135/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 - data we are converting the format. */ -- if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf32_Dyn) -+ || unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - goto out; -@@ -114,7 +115,8 @@ gelf_getdyn (data, ndx, dst) - - /* The data is already in the correct form. Just make sure the - index is OK. */ -- if (unlikely ((ndx + 1) * sizeof (GElf_Dyn) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, GElf_Dyn) -+ || unlikely ((ndx + 1) * sizeof (GElf_Dyn) > data_scn->d.d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - goto out; -diff -up elfutils-0.135/libelf/gelf_getrel.c.robustify elfutils-0.135/libelf/gelf_getrel.c ---- elfutils-0.135/libelf/gelf_getrel.c.robustify -+++ elfutils-0.135/libelf/gelf_getrel.c -@@ -71,12 +71,6 @@ gelf_getrel (data, ndx, dst) - if (data_scn == NULL) - return NULL; - -- if (unlikely (ndx < 0)) -- { -- __libelf_seterrno (ELF_E_INVALID_INDEX); -- return NULL; -- } -- - if (unlikely (data_scn->d.d_type != ELF_T_REL)) - { - __libelf_seterrno (ELF_E_INVALID_HANDLE); -@@ -93,7 +87,8 @@ gelf_getrel (data, ndx, dst) - if (scn->elf->class == ELFCLASS32) - { - /* We have to convert the data. */ -- if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf32_Rel) -+ || unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - result = NULL; -@@ -113,7 +108,8 @@ gelf_getrel (data, ndx, dst) - { - /* Simply copy the data after we made sure we are actually getting - correct data. */ -- if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf64_Rel) -+ || unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - result = NULL; -diff -up elfutils-0.135/libelf/gelf_getversym.c.robustify elfutils-0.135/libelf/gelf_getversym.c ---- elfutils-0.135/libelf/gelf_getversym.c.robustify -+++ elfutils-0.135/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 - index is OK. */ -- if (unlikely ((ndx + 1) * sizeof (GElf_Versym) > data->d_size)) -+ if (INVALID_NDX (ndx, GElf_Versym) -+ || unlikely ((ndx + 1) * sizeof (GElf_Versym) > data->d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - result = NULL; -diff -up elfutils-0.135/libelf/elf_newscn.c.robustify elfutils-0.135/libelf/elf_newscn.c ---- elfutils-0.135/libelf/elf_newscn.c.robustify -+++ elfutils-0.135/libelf/elf_newscn.c -@@ -104,10 +104,18 @@ elf_newscn (elf) - else - { - /* We must allocate a new element. */ -- Elf_ScnList *newp; -+ Elf_ScnList *newp = NULL; - - assert (elf->state.elf.scnincr > 0); - -+ if ( -+#if SIZE_MAX <= 4294967295U -+ likely (elf->state.elf.scnincr -+ < SIZE_MAX / 2 / sizeof (Elf_Scn) - sizeof (Elf_ScnList)) -+#else -+ 1 -+#endif -+ ) - newp = (Elf_ScnList *) calloc (sizeof (Elf_ScnList) - + ((elf->state.elf.scnincr *= 2) - * sizeof (Elf_Scn)), 1); -diff -up elfutils-0.135/libelf/elf32_getshdr.c.robustify elfutils-0.135/libelf/elf32_getshdr.c ---- elfutils-0.135/libelf/elf32_getshdr.c.robustify -+++ elfutils-0.135/libelf/elf32_getshdr.c -@@ -101,7 +101,8 @@ elfw2(LIBELFBITS,getshdr) (scn) - goto out; - - size_t shnum; -- if (INTUSE (elf_getshnum) (elf, &shnum) != 0) -+ if (INTUSE (elf_getshnum) (elf, &shnum) != 0 -+ || shnum > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Shdr))) - goto out; - size_t size = shnum * sizeof (ElfW2(LIBELFBITS,Shdr)); - -@@ -118,6 +119,16 @@ elfw2(LIBELFBITS,getshdr) (scn) - - if (elf->map_address != NULL) - { -+ /* First see whether the information in the ELF header is -+ valid and it does not ask for too much. */ -+ if (unlikely (ehdr->e_shoff >= elf->maximum_size) -+ || unlikely (ehdr->e_shoff + size > elf->maximum_size)) -+ { -+ /* Something is wrong. */ -+ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER); -+ goto free_and_out; -+ } -+ - ElfW2(LIBELFBITS,Shdr) *notcvt; - - /* All the data is already mapped. If we could use it -diff -up elfutils-0.135/libelf/gelf_getsymshndx.c.robustify elfutils-0.135/libelf/gelf_getsymshndx.c ---- elfutils-0.135/libelf/gelf_getsymshndx.c.robustify -+++ elfutils-0.135/libelf/gelf_getsymshndx.c -@@ -90,7 +90,9 @@ gelf_getsymshndx (symdata, shndxdata, nd - section index table. */ - if (likely (shndxdata_scn != NULL)) - { -- if (unlikely ((ndx + 1) * sizeof (Elf32_Word) > shndxdata_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf32_Word) -+ || unlikely ((ndx + 1) * sizeof (Elf32_Word) -+ > shndxdata_scn->d.d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - goto out; -@@ -110,7 +112,8 @@ gelf_getsymshndx (symdata, shndxdata, nd - table entries has to be adopted. The user better has provided - a buffer where we can store the information. While copying the - data we are converting the format. */ -- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata->d_size)) -+ if (INVALID_NDX (ndx, Elf32_Sym) -+ || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata->d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - goto out; -@@ -139,7 +142,8 @@ gelf_getsymshndx (symdata, shndxdata, nd - - /* The data is already in the correct form. Just make sure the - index is OK. */ -- if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > symdata->d_size)) -+ if (INVALID_NDX (ndx, GElf_Sym) -+ || unlikely ((ndx + 1) * sizeof (GElf_Sym) > symdata->d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - goto out; -diff -up elfutils-0.135/libelf/gelf_update_versym.c.robustify elfutils-0.135/libelf/gelf_update_versym.c ---- elfutils-0.135/libelf/gelf_update_versym.c.robustify -+++ elfutils-0.135/libelf/gelf_update_versym.c -@@ -75,7 +75,7 @@ gelf_update_versym (data, ndx, src) - assert (sizeof (GElf_Versym) == sizeof (Elf64_Versym)); - - /* Check whether we have to resize the data buffer. */ -- if (unlikely (ndx < 0) -+ if (INVALID_NDX (ndx, GElf_Versym) - || unlikely ((ndx + 1) * sizeof (GElf_Versym) > data_scn->d.d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); -diff -up elfutils-0.135/libelf/elf_getshstrndx.c.robustify elfutils-0.135/libelf/elf_getshstrndx.c ---- elfutils-0.135/libelf/elf_getshstrndx.c.robustify -+++ elfutils-0.135/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 - && (ALLOW_UNALIGNED -- || (((size_t) ((char *) elf->map_address + offset)) -+ || (((size_t) ((char *) elf->map_address -+ + elf->start_offset + offset)) - & (__alignof__ (Elf32_Shdr) - 1)) == 0)) -+ { -+ /* First see whether the information in the ELF header is -+ valid and it does not ask for too much. */ -+ if (unlikely (offset + sizeof (Elf32_Shdr) -+ > elf->maximum_size)) -+ { -+ /* Something is wrong. */ -+ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER); -+ result = -1; -+ goto out; -+ } -+ - /* We can directly access the memory. */ -- num = ((Elf32_Shdr *) (elf->map_address + offset))->sh_link; -+ num = ((Elf32_Shdr *) (elf->map_address + elf->start_offset -+ + offset))->sh_link; -+ } - else - { - /* We avoid reading in all the section headers. Just read -@@ -163,10 +178,25 @@ elf_getshstrndx (elf, dst) - if (elf->map_address != NULL - && elf->state.elf64.ehdr->e_ident[EI_DATA] == MY_ELFDATA - && (ALLOW_UNALIGNED -- || (((size_t) ((char *) elf->map_address + offset)) -+ || (((size_t) ((char *) elf->map_address -+ + elf->start_offset + offset)) - & (__alignof__ (Elf64_Shdr) - 1)) == 0)) -+ { -+ /* First see whether the information in the ELF header is -+ valid and it does not ask for too much. */ -+ if (unlikely (offset + sizeof (Elf64_Shdr) -+ > elf->maximum_size)) -+ { -+ /* Something is wrong. */ -+ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER); -+ result = -1; -+ goto out; -+ } -+ - /* We can directly access the memory. */ -- num = ((Elf64_Shdr *) (elf->map_address + offset))->sh_link; -+ num = ((Elf64_Shdr *) (elf->map_address -+ + elf->start_offset + offset))->sh_link; -+ } - else - { - /* We avoid reading in all the section headers. Just read -diff -up elfutils-0.135/libelf/libelfP.h.robustify elfutils-0.135/libelf/libelfP.h ---- elfutils-0.135/libelf/libelfP.h.robustify -+++ elfutils-0.135/libelf/libelfP.h -@@ -596,4 +596,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) - -+/* Convenience macro. Assumes int NDX and TYPE with size at least -+ 2 bytes. */ -+#if SIZE_MAX > 4294967295U -+# define INVALID_NDX(ndx, type) unlikely (ndx < 0) -+#else -+# define INVALID_NDX(ndx, type) \ -+ unlikely ((unsigned int) (ndx) >= SIZE_MAX / sizeof (type)) -+#endif -+ - #endif /* libelfP.h */ -diff -up elfutils-0.135/libelf/gelf_getmove.c.robustify elfutils-0.135/libelf/gelf_getmove.c ---- elfutils-0.135/libelf/gelf_getmove.c.robustify -+++ elfutils-0.135/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 - index is OK. */ -- if (unlikely ((ndx + 1) * sizeof (GElf_Move) > data->d_size)) -+ if (INVALID_NDX (ndx, GElf_Move) -+ || unlikely ((ndx + 1) * sizeof (GElf_Move) > data->d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - goto out; -diff -up elfutils-0.135/libelf/elf32_updatefile.c.robustify elfutils-0.135/libelf/elf32_updatefile.c ---- elfutils-0.135/libelf/elf32_updatefile.c.robustify -+++ elfutils-0.135/libelf/elf32_updatefile.c -@@ -212,6 +212,9 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf - /* Write all the sections. Well, only those which are modified. */ - if (shnum > 0) - { -+ if (unlikely (shnum > SIZE_MAX / sizeof (Elf_Scn *))) -+ return 1; -+ - 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 - /* Write all the sections. Well, only those which are modified. */ - if (shnum > 0) - { -+ if (unlikely (shnum > SIZE_MAX / (sizeof (Elf_Scn *) -+ + sizeof (ElfW2(LIBELFBITS,Shdr))))) -+ return 1; -+ - 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]; -diff -up elfutils-0.135/libelf/gelf_update_lib.c.robustify elfutils-0.135/libelf/gelf_update_lib.c ---- elfutils-0.135/libelf/gelf_update_lib.c.robustify -+++ elfutils-0.135/libelf/gelf_update_lib.c -@@ -68,12 +68,6 @@ gelf_update_lib (data, ndx, src) - if (data == NULL) - return 0; - -- if (unlikely (ndx < 0)) -- { -- __libelf_seterrno (ELF_E_INVALID_INDEX); -- return 0; -- } -- - Elf_Data_Scn *data_scn = (Elf_Data_Scn *) data; - if (unlikely (data_scn->d.d_type != ELF_T_LIB)) - { -@@ -87,7 +81,8 @@ gelf_update_lib (data, ndx, src) - - /* Check whether we have to resize the data buffer. */ - int result = 0; -- if (unlikely ((ndx + 1) * sizeof (Elf64_Lib) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf64_Lib) -+ || unlikely ((ndx + 1) * sizeof (Elf64_Lib) > data_scn->d.d_size)) - __libelf_seterrno (ELF_E_INVALID_INDEX); - else - { -diff -up elfutils-0.135/libelf/elf32_getphdr.c.robustify elfutils-0.135/libelf/elf32_getphdr.c ---- elfutils-0.135/libelf/elf32_getphdr.c.robustify -+++ elfutils-0.135/libelf/elf32_getphdr.c -@@ -116,6 +116,16 @@ elfw2(LIBELFBITS,getphdr) (elf) - - if (elf->map_address != NULL) - { -+ /* First see whether the information in the ELF header is -+ valid and it does not ask for too much. */ -+ if (unlikely (ehdr->e_phoff >= elf->maximum_size) -+ || unlikely (ehdr->e_phoff + size > elf->maximum_size)) -+ { -+ /* Something is wrong. */ -+ __libelf_seterrno (ELF_E_INVALID_PHDR); -+ goto out; -+ } -+ - /* All the data is already mapped. Use it. */ - void *file_phdr = ((char *) elf->map_address - + elf->start_offset + ehdr->e_phoff); -diff -up elfutils-0.135/libelf/gelf_getlib.c.robustify elfutils-0.135/libelf/gelf_getlib.c ---- elfutils-0.135/libelf/gelf_getlib.c.robustify -+++ elfutils-0.135/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. */ - GElf_Lib *result = NULL; -- if (unlikely ((ndx + 1) * sizeof (GElf_Lib) > data->d_size)) -+ if (INVALID_NDX (ndx, GElf_Lib) -+ || unlikely ((ndx + 1) * sizeof (GElf_Lib) > data->d_size)) - __libelf_seterrno (ELF_E_INVALID_INDEX); - else - { -diff -up elfutils-0.135/libelf/elf32_newphdr.c.robustify elfutils-0.135/libelf/elf32_newphdr.c ---- elfutils-0.135/libelf/elf32_newphdr.c.robustify -+++ elfutils-0.135/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) - { -+ if (unlikely (count > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Phdr)))) -+ { -+ result = NULL; -+ goto out; -+ } -+ - /* Allocate a new program header with the appropriate number of - elements. */ - result = (ElfW2(LIBELFBITS,Phdr) *) -diff -up elfutils-0.135/libelf/gelf_update_rela.c.robustify elfutils-0.135/libelf/gelf_update_rela.c ---- elfutils-0.135/libelf/gelf_update_rela.c.robustify -+++ elfutils-0.135/libelf/gelf_update_rela.c -@@ -68,12 +68,6 @@ gelf_update_rela (Elf_Data *dst, int ndx - if (dst == NULL) - return 0; - -- if (unlikely (ndx < 0)) -- { -- __libelf_seterrno (ELF_E_INVALID_INDEX); -- return 0; -- } -- - if (unlikely (data_scn->d.d_type != ELF_T_RELA)) - { - /* The type of the data better should match. */ -@@ -101,7 +95,8 @@ gelf_update_rela (Elf_Data *dst, int ndx - } - - /* Check whether we have to resize the data buffer. */ -- if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf32_Rela) -+ || unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - goto out; -@@ -117,7 +112,8 @@ gelf_update_rela (Elf_Data *dst, int ndx - else - { - /* Check whether we have to resize the data buffer. */ -- if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf64_Rela) -+ || unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - goto out; -diff -up elfutils-0.135/libelf/gelf_update_syminfo.c.robustify elfutils-0.135/libelf/gelf_update_syminfo.c ---- elfutils-0.135/libelf/gelf_update_syminfo.c.robustify -+++ elfutils-0.135/libelf/gelf_update_syminfo.c -@@ -72,12 +72,6 @@ gelf_update_syminfo (data, ndx, src) - if (data == NULL) - return 0; - -- if (unlikely (ndx < 0)) -- { -- __libelf_seterrno (ELF_E_INVALID_INDEX); -- return 0; -- } -- - if (unlikely (data_scn->d.d_type != ELF_T_SYMINFO)) - { - /* The type of the data better should match. */ -@@ -93,7 +87,8 @@ gelf_update_syminfo (data, ndx, src) - rwlock_wrlock (scn->elf->lock); - - /* Check whether we have to resize the data buffer. */ -- if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, GElf_Syminfo) -+ || unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data_scn->d.d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - goto out; -diff -up elfutils-0.135/libelf/gelf_update_sym.c.robustify elfutils-0.135/libelf/gelf_update_sym.c ---- elfutils-0.135/libelf/gelf_update_sym.c.robustify -+++ elfutils-0.135/libelf/gelf_update_sym.c -@@ -72,12 +72,6 @@ gelf_update_sym (data, ndx, src) - if (data == NULL) - return 0; - -- if (unlikely (ndx < 0)) -- { -- __libelf_seterrno (ELF_E_INVALID_INDEX); -- return 0; -- } -- - if (unlikely (data_scn->d.d_type != ELF_T_SYM)) - { - /* The type of the data better should match. */ -@@ -102,7 +96,8 @@ gelf_update_sym (data, ndx, src) - } - - /* Check whether we have to resize the data buffer. */ -- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf32_Sym) -+ || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data_scn->d.d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - goto out; -@@ -125,7 +120,8 @@ gelf_update_sym (data, ndx, src) - else - { - /* Check whether we have to resize the data buffer. */ -- if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf64_Sym) -+ || unlikely ((ndx + 1) * sizeof (Elf64_Sym) > data_scn->d.d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - goto out; -diff -up elfutils-0.135/libelf/gelf_getsyminfo.c.robustify elfutils-0.135/libelf/gelf_getsyminfo.c ---- elfutils-0.135/libelf/gelf_getsyminfo.c.robustify -+++ elfutils-0.135/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 - index is OK. */ -- if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data->d_size)) -+ if (INVALID_NDX (ndx, GElf_Syminfo) -+ || unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data->d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - goto out; -diff -up elfutils-0.135/libelf/gelf_update_symshndx.c.robustify elfutils-0.135/libelf/gelf_update_symshndx.c ---- elfutils-0.135/libelf/gelf_update_symshndx.c.robustify -+++ elfutils-0.135/libelf/gelf_update_symshndx.c -@@ -77,12 +77,6 @@ gelf_update_symshndx (symdata, shndxdata - if (symdata == NULL) - return 0; - -- if (unlikely (ndx < 0)) -- { -- __libelf_seterrno (ELF_E_INVALID_INDEX); -- return 0; -- } -- - if (unlikely (symdata_scn->d.d_type != ELF_T_SYM)) - { - /* The type of the data better should match. */ -@@ -128,7 +122,8 @@ gelf_update_symshndx (symdata, shndxdata - } - - /* Check whether we have to resize the data buffer. */ -- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf32_Sym) -+ || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata_scn->d.d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - goto out; -@@ -151,7 +146,8 @@ gelf_update_symshndx (symdata, shndxdata - else - { - /* Check whether we have to resize the data buffer. */ -- if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > symdata_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf64_Sym) -+ || unlikely ((ndx + 1) * sizeof (Elf64_Sym) > symdata_scn->d.d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - goto out; -diff -up elfutils-0.135/libelf/elf_getarsym.c.robustify elfutils-0.135/libelf/elf_getarsym.c ---- elfutils-0.135/libelf/elf_getarsym.c.robustify -+++ elfutils-0.135/libelf/elf_getarsym.c -@@ -179,6 +179,9 @@ elf_getarsym (elf, ptr) - size_t index_size = atol (tmpbuf); - - if (SARMAG + sizeof (struct ar_hdr) + index_size > elf->maximum_size -+#if SIZE_MAX <= 4294967295U -+ || n >= SIZE_MAX / sizeof (Elf_Arsym) -+#endif - || n * sizeof (uint32_t) > index_size) - { - /* This index table cannot be right since it does not fit into -diff -up elfutils-0.135/libelf/gelf_getsym.c.robustify elfutils-0.135/libelf/gelf_getsym.c ---- elfutils-0.135/libelf/gelf_getsym.c.robustify -+++ elfutils-0.135/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 - data we are converting the format. */ -- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data->d_size)) -+ if (INVALID_NDX (ndx, Elf32_Sym) -+ || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data->d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - goto out; -@@ -119,7 +120,8 @@ gelf_getsym (data, ndx, dst) - - /* The data is already in the correct form. Just make sure the - index is OK. */ -- if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > data->d_size)) -+ if (INVALID_NDX (ndx, GElf_Sym) -+ || unlikely ((ndx + 1) * sizeof (GElf_Sym) > data->d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - goto out; -diff -up elfutils-0.135/libelf/elf_begin.c.robustify elfutils-0.135/libelf/elf_begin.c ---- elfutils-0.135/libelf/elf_begin.c.robustify -+++ elfutils-0.135/libelf/elf_begin.c -@@ -155,7 +155,8 @@ get_shnum (void *map_address, unsigned c - - if (unlikely (result == 0) && ehdr.e32->e_shoff != 0) - { -- if (ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize) -+ if (unlikely (ehdr.e32->e_shoff >= maxsize) -+ || unlikely (ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize)) - /* Cannot read the first section header. */ - return 0; - -@@ -203,7 +204,8 @@ get_shnum (void *map_address, unsigned c - - if (unlikely (result == 0) && ehdr.e64->e_shoff != 0) - { -- if (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize) -+ if (unlikely (ehdr.e64->e_shoff >= maxsize) -+ || unlikely (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize)) - /* Cannot read the first section header. */ - return 0; - -@@ -275,6 +277,15 @@ file_read_elf (int fildes, void *map_add - /* Could not determine the number of sections. */ - return NULL; - -+ /* Check for too many sections. */ -+ if (e_ident[EI_CLASS] == ELFCLASS32) -+ { -+ if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf32_Shdr))) -+ return NULL; -+ } -+ else if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf64_Shdr))) -+ return NULL; -+ - /* 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 - { - /* We can use the mmapped memory. */ - elf->state.elf32.ehdr = ehdr; -+ -+ if (unlikely (ehdr->e_shoff >= maxsize) -+ || unlikely (ehdr->e_shoff -+ + scncnt * sizeof (Elf32_Shdr) > maxsize)) -+ { -+ free_and_out: -+ free (elf); -+ __libelf_seterrno (ELF_E_INVALID_FILE); -+ return NULL; -+ } - elf->state.elf32.shdr - = (Elf32_Shdr *) ((char *) ehdr + ehdr->e_shoff); -+ - if (ehdr->e_phnum > 0) -+ { - /* Assign a value only if there really is a program - header. Otherwise the value remains NULL. */ -+ if (unlikely (ehdr->e_phoff >= maxsize) -+ || unlikely (ehdr->e_phoff -+ + ehdr->e_phnum -+ * sizeof (Elf32_Phdr) > maxsize)) -+ goto free_and_out; - elf->state.elf32.phdr - = (Elf32_Phdr *) ((char *) ehdr + ehdr->e_phoff); -+ } - - for (size_t cnt = 0; cnt < scncnt; ++cnt) - { -@@ -396,13 +425,26 @@ file_read_elf (int fildes, void *map_add - { - /* We can use the mmapped memory. */ - elf->state.elf64.ehdr = ehdr; -+ -+ if (unlikely (ehdr->e_shoff >= maxsize) -+ || unlikely (ehdr->e_shoff -+ + scncnt * sizeof (Elf32_Shdr) > maxsize)) -+ goto free_and_out; - elf->state.elf64.shdr - = (Elf64_Shdr *) ((char *) ehdr + ehdr->e_shoff); -+ - if (ehdr->e_phnum > 0) -+ { - /* Assign a value only if there really is a program - header. Otherwise the value remains NULL. */ -+ if (unlikely (ehdr->e_phoff >= maxsize) -+ || unlikely (ehdr->e_phoff -+ + ehdr->e_phnum -+ * sizeof (Elf32_Phdr) > maxsize)) -+ goto free_and_out; - elf->state.elf64.phdr - = (Elf64_Phdr *) ((char *) ehdr + ehdr->e_phoff); -+ } - - for (size_t cnt = 0; cnt < scncnt; ++cnt) - { -diff -up elfutils-0.135/libelf/gelf_update_rel.c.robustify elfutils-0.135/libelf/gelf_update_rel.c ---- elfutils-0.135/libelf/gelf_update_rel.c.robustify -+++ elfutils-0.135/libelf/gelf_update_rel.c -@@ -68,12 +68,6 @@ gelf_update_rel (Elf_Data *dst, int ndx, - if (dst == NULL) - return 0; - -- if (unlikely (ndx < 0)) -- { -- __libelf_seterrno (ELF_E_INVALID_INDEX); -- return 0; -- } -- - if (unlikely (data_scn->d.d_type != ELF_T_REL)) - { - /* The type of the data better should match. */ -@@ -99,7 +93,8 @@ gelf_update_rel (Elf_Data *dst, int ndx, - } - - /* Check whether we have to resize the data buffer. */ -- if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf32_Rel) -+ || unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - goto out; -@@ -114,7 +109,8 @@ gelf_update_rel (Elf_Data *dst, int ndx, - else - { - /* Check whether we have to resize the data buffer. */ -- if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf64_Rel) -+ || unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - goto out; -diff -up elfutils-0.135/libelf/gelf_update_move.c.robustify elfutils-0.135/libelf/gelf_update_move.c ---- elfutils-0.135/libelf/gelf_update_move.c.robustify -+++ elfutils-0.135/libelf/gelf_update_move.c -@@ -75,7 +75,7 @@ gelf_update_move (data, ndx, src) - assert (sizeof (GElf_Move) == sizeof (Elf64_Move)); - - /* Check whether we have to resize the data buffer. */ -- if (unlikely (ndx < 0) -+ if (INVALID_NDX (ndx, GElf_Move) - || unlikely ((ndx + 1) * sizeof (GElf_Move) > data_scn->d.d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); -diff -up elfutils-0.135/libelf/gelf_update_dyn.c.robustify elfutils-0.135/libelf/gelf_update_dyn.c ---- elfutils-0.135/libelf/gelf_update_dyn.c.robustify -+++ elfutils-0.135/libelf/gelf_update_dyn.c -@@ -71,12 +71,6 @@ gelf_update_dyn (data, ndx, src) - if (data == NULL) - return 0; - -- if (unlikely (ndx < 0)) -- { -- __libelf_seterrno (ELF_E_INVALID_INDEX); -- return 0; -- } -- - if (unlikely (data_scn->d.d_type != ELF_T_DYN)) - { - /* The type of the data better should match. */ -@@ -102,7 +96,8 @@ gelf_update_dyn (data, ndx, src) - } - - /* Check whether we have to resize the data buffer. */ -- if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf32_Dyn) -+ || unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - goto out; -@@ -116,7 +111,8 @@ gelf_update_dyn (data, ndx, src) - else - { - /* Check whether we have to resize the data buffer. */ -- if (unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf64_Dyn) -+ || unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - goto out; -diff -up elfutils-0.135/libelf/gelf_getrela.c.robustify elfutils-0.135/libelf/gelf_getrela.c ---- elfutils-0.135/libelf/gelf_getrela.c.robustify -+++ elfutils-0.135/libelf/gelf_getrela.c -@@ -71,12 +71,6 @@ gelf_getrela (data, ndx, dst) - if (data_scn == NULL) - return NULL; - -- if (unlikely (ndx < 0)) -- { -- __libelf_seterrno (ELF_E_INVALID_INDEX); -- return NULL; -- } -- - if (unlikely (data_scn->d.d_type != ELF_T_RELA)) - { - __libelf_seterrno (ELF_E_INVALID_HANDLE); -@@ -93,7 +87,8 @@ gelf_getrela (data, ndx, dst) - if (scn->elf->class == ELFCLASS32) - { - /* We have to convert the data. */ -- if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf32_Rela) -+ || unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - result = NULL; -@@ -114,7 +109,8 @@ gelf_getrela (data, ndx, dst) - { - /* Simply copy the data after we made sure we are actually getting - correct data. */ -- if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf64_Rela) -+ || unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size)) - { - __libelf_seterrno (ELF_E_INVALID_INDEX); - result = NULL; diff --git a/elfutils.spec b/elfutils.spec index 2fb7056..bd00cf6 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,5 +1,5 @@ -%define eu_version 0.135 -%define eu_release 2 +%define eu_version 0.137 +%define eu_release 1 %if %{?_with_compat:1}%{!?_with_compat:0} %define compat 1 @@ -262,6 +262,11 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/libelf.a %changelog +* Wed Aug 27 2008 Roland McGrath - 0.137-1 +- Update to 0.137 + - libdwfl: bug fixes; new segment interfaces; + all the libdwfl-based tools now support --core=COREFILE option + * Mon Jul 7 2008 Tom "spot" Callaway - 0.135-2 - fix conditional comparison diff --git a/sources b/sources index 1652d0a..81ce69c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2fb0d3d9cdb22f71ad0df91d676bb2eb elfutils-0.135.tar.gz +a24690a64268516bd413c4c3fe6c6dd4 elfutils-0.137.tar.gz From 93a363242b1233955bc5c945ec16f2158ece4436 Mon Sep 17 00:00:00 2001 From: roland Date: Thu, 28 Aug 2008 07:44:31 +0000 Subject: [PATCH 05/13] alignment fixes, segment table botch fix --- Makefile | 6 +- elfutils-0.137-fixes.patch | 118 +++++++++++++++++++++++++++++++++++++ elfutils.spec | 9 ++- 3 files changed, 129 insertions(+), 4 deletions(-) create mode 100644 elfutils-0.137-fixes.patch diff --git a/Makefile b/Makefile index 208b99f..305a07f 100644 --- a/Makefile +++ b/Makefile @@ -24,17 +24,21 @@ endif include $(MAKEFILE_COMMON) +ifneq (,$(CURL)) CURL += -k +endif MONOTONE = mtn branch-portability = portable +elfutils-base = t:elfutils-$(VERSION) + elfutils-%.patch: elfutils-$(VERSION).tar.gz Makefile @rm -rf elfutils-master elfutils-$* # $(MONOTONE) checkout -b com.redhat.elfutils elfutils-master $(MONOTONE) checkout -b com.redhat.elfutils \ - -r t:elfutils-$(VERSION) elfutils-master + -r $(elfutils-base) elfutils-master $(MONOTONE) checkout \ -b com.redhat.elfutils.$(firstword $(branch-$*) $*) \ elfutils-$* diff --git a/elfutils-0.137-fixes.patch b/elfutils-0.137-fixes.patch new file mode 100644 index 0000000..49940d7 --- /dev/null +++ b/elfutils-0.137-fixes.patch @@ -0,0 +1,118 @@ +--- elfutils-0.137/libdwfl/ChangeLog ++++ elfutils-0.137/libdwfl/ChangeLog +@@ -1,3 +1,12 @@ ++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 +@@ -175,9 +175,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))) +--- 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 +@@ -110,8 +110,14 @@ get_shnum (void *map_address, unsigned c + } ehdr_mem; + bool is32 = e_ident[EI_CLASS] == ELFCLASS32; + ++ // e_shnum shoff ++ + /* 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 +136,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 +152,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.spec b/elfutils.spec index bd00cf6..2b515e2 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,5 +1,5 @@ %define eu_version 0.137 -%define eu_release 1 +%define eu_release 2 %if %{?_with_compat:1}%{!?_with_compat:0} %define compat 1 @@ -35,6 +35,7 @@ URL: https://fedorahosted.org/elfutils/ Source: http://fedorahosted.org/releases/e/l/elfutils/%{name}-%{version}.tar.gz Patch1: elfutils-portability.patch Patch2: elfutils-robustify.patch +Patch3: elfutils-0.137-fixes.patch Requires: elfutils-libelf-%{_arch} = %{version}-%{release} Requires: elfutils-libs-%{_arch} = %{version}-%{release} @@ -156,6 +157,8 @@ find . \( -name configure -o -name config.h.in \) -print | xargs touch %patch2 -p1 -b .robustify +%patch3 -p1 -b .fixes + find . -name \*.sh ! -perm -0100 -print | xargs chmod +x %build @@ -262,10 +265,11 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/libelf.a %changelog -* Wed Aug 27 2008 Roland McGrath - 0.137-1 +* Thu Aug 28 2008 Roland McGrath - 0.137-2 - Update to 0.137 - libdwfl: bug fixes; new segment interfaces; all the libdwfl-based tools now support --core=COREFILE option +- Resolves: RHBZ #325021, RHBZ #447416 * Mon Jul 7 2008 Tom "spot" Callaway - 0.135-2 - fix conditional comparison @@ -354,7 +358,6 @@ rm -rf ${RPM_BUILD_ROOT} - New program eu-ar. - libdw: fix missing dwarf_getelf (#227206) - libdwfl: dwfl_module_addrname for st_size=0 symbols (#227167, #227231) -- Resolves: RHBZ #227206, RHBZ #227167, RHBZ #227231 * Wed Jan 10 2007 Roland McGrath - 0.125-3 - Fix overeager warn_unused_result build failures. From 90aabc50afa0362c5b6b7f7e9f4791954202c6cb Mon Sep 17 00:00:00 2001 From: roland Date: Wed, 1 Oct 2008 19:24:41 +0000 Subject: [PATCH 06/13] - fix libdwfl regression (#462689) --- elfutils-0.137-fixes.patch | 72 +++++++++++++++++++++++++++++++++----- elfutils.spec | 5 ++- 2 files changed, 68 insertions(+), 9 deletions(-) diff --git a/elfutils-0.137-fixes.patch b/elfutils-0.137-fixes.patch index 49940d7..d357273 100644 --- a/elfutils-0.137-fixes.patch +++ b/elfutils-0.137-fixes.patch @@ -1,6 +1,11 @@ --- elfutils-0.137/libdwfl/ChangeLog +++ elfutils-0.137/libdwfl/ChangeLog -@@ -1,3 +1,12 @@ +@@ -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. @@ -27,7 +32,35 @@ return nread; --- elfutils-0.137/libdwfl/segment.c +++ elfutils-0.137/libdwfl/segment.c -@@ -175,9 +175,17 @@ reify_segments (Dwfl *dwfl) +@@ -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; } @@ -47,6 +80,32 @@ /* 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 @@ @@ -61,12 +120,9 @@ * Makefile.am (libelf_so_LDLIBS): New variable. --- elfutils-0.137/libelf/elf_begin.c +++ elfutils-0.137/libelf/elf_begin.c -@@ -110,8 +110,14 @@ get_shnum (void *map_address, unsigned c - } ehdr_mem; +@@ -111,7 +111,11 @@ get_shnum (void *map_address, unsigned c bool is32 = e_ident[EI_CLASS] == ELFCLASS32; -+ // e_shnum shoff -+ /* Make the ELF header available. */ - if (e_ident[EI_DATA] == MY_ELFDATA) + if (e_ident[EI_DATA] == MY_ELFDATA @@ -77,7 +133,7 @@ ehdr.p = e_ident; else { -@@ -130,8 +136,11 @@ get_shnum (void *map_address, unsigned c +@@ -130,8 +134,11 @@ get_shnum (void *map_address, unsigned c else memcpy (&ehdr_mem, e_ident, sizeof (Elf32_Ehdr)); @@ -91,7 +147,7 @@ } else { -@@ -143,8 +152,11 @@ get_shnum (void *map_address, unsigned c +@@ -143,8 +150,11 @@ get_shnum (void *map_address, unsigned c else memcpy (&ehdr_mem, e_ident, sizeof (Elf64_Ehdr)); diff --git a/elfutils.spec b/elfutils.spec index 2b515e2..d2d3430 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,5 +1,5 @@ %define eu_version 0.137 -%define eu_release 2 +%define eu_release 3 %if %{?_with_compat:1}%{!?_with_compat:0} %define compat 1 @@ -265,6 +265,9 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/libelf.a %changelog +* Wed Oct 1 2008 Roland McGrath - 0.137-3 +- fix libdwfl regression (#462689) + * Thu Aug 28 2008 Roland McGrath - 0.137-2 - Update to 0.137 - libdwfl: bug fixes; new segment interfaces; From 26909b873fd2c449e695c7aca639a0038e7ce0c8 Mon Sep 17 00:00:00 2001 From: roland Date: Wed, 31 Dec 2008 22:12:43 +0000 Subject: [PATCH 07/13] Update to 0.138 --- .cvsignore | 2 +- Makefile | 25 +++--- elfutils-0.134.tar.gz.sig | Bin 65 -> 0 bytes elfutils-0.137-fixes.patch | 174 ------------------------------------- elfutils-0.138.tar.bz2.sig | Bin 0 -> 72 bytes elfutils-portability.patch | 158 ++++++++++++++------------------- elfutils.spec | 20 +++-- sources | 2 +- 8 files changed, 92 insertions(+), 289 deletions(-) delete mode 100644 elfutils-0.134.tar.gz.sig delete mode 100644 elfutils-0.137-fixes.patch create mode 100644 elfutils-0.138.tar.bz2.sig diff --git a/.cvsignore b/.cvsignore index 0da9d88..2650720 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -elfutils-0.137.tar.gz +elfutils-0.138.tar.bz2 diff --git a/Makefile b/Makefile index 305a07f..b8735ba 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ NAME := elfutils SPECFILE = elfutils.spec UPSTREAM_CHECKS := sig -UPSTREAM_FILES = $(NAME)-$(VERSION).tar.gz +UPSTREAM_FILES = $(NAME)-$(VERSION).tar.bz2 upstream:; define find-makefile-common @@ -28,22 +28,19 @@ ifneq (,$(CURL)) CURL += -k endif -MONOTONE = mtn - branch-portability = portable -elfutils-base = t:elfutils-$(VERSION) +elfutils-base = elfutils-$(VERSION) +elfutils-base = master -elfutils-%.patch: elfutils-$(VERSION).tar.gz Makefile +elfutils-%.patch: elfutils-$(VERSION).tar.bz2 Makefile @rm -rf elfutils-master elfutils-$* -# $(MONOTONE) checkout -b com.redhat.elfutils elfutils-master - $(MONOTONE) checkout -b com.redhat.elfutils \ - -r $(elfutils-base) elfutils-master - $(MONOTONE) checkout \ - -b com.redhat.elfutils.$(firstword $(branch-$*) $*) \ - elfutils-$* - cd elfutils-master; autoreconf -i; rm -rf autom4te.cache _MTN - cd elfutils-$*; autoreconf -i; rm -rf autom4te.cache _MTN + git archive --prefix=elfutils-master/ $(elfutils-base) \ + | tar xf - + git archive --prefix=elfutils-$*/ $(firstword $(branch-$*) $*) \ + | tar xf - + cd elfutils-master; autoreconf -i; rm -rf autom4te.cache + cd elfutils-$*; autoreconf -i; rm -rf autom4te.cache diff -Nrpu elfutils-master elfutils-$* | \ filterdiff --remove-timestamps --strip=1 --addprefix=elfutils/ > $@.new mv $@.new $@ @@ -56,7 +53,7 @@ portable-r = 0.$(subst $(DIST),,$(RELEASE)) portable-vr = $(VERSION)-$(portable-r) portable.srpm = elfutils-$(portable-vr).src.rpm $(portable.srpm): elfutils-portable.spec elfutils-portability.patch \ - elfutils-$(VERSION).tar.gz + elfutils-$(VERSION).tar.bz2 $(RPM_WITH_DIRS) --nodeps -bs $< portable-srpm: $(portable.srpm) diff --git a/elfutils-0.134.tar.gz.sig b/elfutils-0.134.tar.gz.sig deleted file mode 100644 index 9fff7d50b372ee33554cb75bcbecf0949cd8808e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 65 zcmV-H0KWf-KLZ5-NBjW^+9<+0dH+Oo5dxSu0HDgarqyHIZ~@Zj=-t0WV`VGTKJNgZ XWgTd=x?~C3hVhA{!&(f;3F>H>rV1Xm diff --git a/elfutils-0.137-fixes.patch b/elfutils-0.137-fixes.patch deleted file mode 100644 index d357273..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.138.tar.bz2.sig b/elfutils-0.138.tar.bz2.sig new file mode 100644 index 0000000000000000000000000000000000000000..24149f5c3168fc2736fae735cbd6ef631f01789f GIT binary patch literal 72 zcmV-O0Jr~$Mg#y60ssaD0!drt9{>so5ZWlhI(h#@botx>psRih!Rybi+)tzG8YU?F e3KZ(w&H$SQE?qh+^#gVQi(2%3K@2QZqnnhiUL1V@ literal 0 HcmV?d00001 diff --git a/elfutils-portability.patch b/elfutils-portability.patch index e12a63e..c87295f 100644 --- a/elfutils-portability.patch +++ b/elfutils-portability.patch @@ -1,6 +1,6 @@ --- elfutils/backends/ChangeLog +++ elfutils/backends/ChangeLog -@@ -315,6 +315,11 @@ +@@ -325,6 +325,11 @@ * sparc_init.c: Likewise. * x86_64_init.c: Likewise. @@ -12,7 +12,7 @@ 2005-11-19 Roland McGrath * ppc64_reloc.def: REL30 -> ADDR30. -@@ -337,6 +342,9 @@ +@@ -347,6 +352,9 @@ * Makefile.am (uninstall): Don't try to remove $(pkgincludedir). (CLEANFILES): Add libebl_$(m).so. @@ -66,7 +66,7 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -239,9 +241,9 @@ target_alias = @target_alias@ +@@ -241,9 +243,9 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \ @@ -80,7 +80,7 @@ -I$(top_srcdir)/lib -I.. --- elfutils/ChangeLog +++ elfutils/ChangeLog -@@ -39,6 +39,10 @@ +@@ -54,6 +54,10 @@ * configure.ac: Add dummy automake conditional to get dependencies for non-generic linker right. See src/Makefile.am. @@ -91,7 +91,7 @@ 2005-11-18 Roland McGrath * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable. -@@ -86,6 +90,17 @@ +@@ -101,6 +105,17 @@ * Makefile.am (all_SUBDIRS): Add libdwfl. * configure.ac: Write libdwfl/Makefile. @@ -99,12 +99,12 @@ + + * 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 @@ -129,23 +129,23 @@ YACC = @YACC@ --- elfutils/configure +++ elfutils/configure -@@ -676,6 +676,8 @@ YFLAGS - LEX - LEX_OUTPUT_ROOT - LEXLIB -+WEXTRA -+LD_AS_NEEDED - LOCALEDIR - DATADIRNAME +@@ -637,6 +637,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 +@@ -4028,6 +4030,89 @@ $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 +158,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 +181,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 +191,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 +214,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 @@ -227,35 +228,6 @@ LOCALEDIR=$datadir 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"]) @@ -342,7 +314,7 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -177,9 +179,9 @@ target_alias = @target_alias@ +@@ -179,9 +181,9 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \ @@ -356,7 +328,7 @@ libeu_a_SOURCES = xstrndup.c xmalloc.c next_prime.c \ --- elfutils/libasm/ChangeLog +++ elfutils/libasm/ChangeLog -@@ -54,6 +54,11 @@ +@@ -58,6 +58,11 @@ * asm_error.c: Add new error ASM_E_IOERROR. * libasmP.h: Add ASM_E_IOERROR definition. @@ -387,7 +359,7 @@ -I$(top_srcdir)/lib --- elfutils/libasm/Makefile.in +++ elfutils/libasm/Makefile.in -@@ -126,6 +126,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -127,6 +127,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -395,7 +367,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -155,6 +156,7 @@ SHELL = @SHELL@ +@@ -156,6 +157,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = 1 @@ -403,7 +375,7 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -210,9 +212,9 @@ target_alias = @target_alias@ +@@ -213,9 +215,9 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @MUDFLAP_FALSE@AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Werror -Wunused \ @@ -417,7 +389,7 @@ -I$(top_srcdir)/lib --- elfutils/libcpu/ChangeLog +++ elfutils/libcpu/ChangeLog -@@ -265,6 +265,11 @@ +@@ -307,6 +307,11 @@ * defs/i386.doc: New file. * defs/x86_64: New file. @@ -459,8 +431,8 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -192,10 +194,10 @@ sysconfdir = @sysconfdir@ - target_alias = @target_alias@ +@@ -194,10 +196,10 @@ target_alias = @target_alias@ + top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Wunused -Wextra -std=gnu99 \ @@ -524,7 +496,7 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -248,9 +250,10 @@ target_alias = @target_alias@ +@@ -250,9 +252,10 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @MUDFLAP_FALSE@AM_CFLAGS = $(am__append_1) -Wall -Werror -Wshadow \ @@ -539,7 +511,7 @@ $(COMPILE))) --- elfutils/libdwfl/ChangeLog +++ elfutils/libdwfl/ChangeLog -@@ -885,6 +885,11 @@ +@@ -936,6 +936,11 @@ 2005-07-21 Roland McGrath @@ -586,7 +558,7 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -215,9 +217,9 @@ target_alias = @target_alias@ +@@ -217,9 +219,9 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wshadow -Wunused -Wformat=2 \ @@ -600,7 +572,7 @@ --- elfutils/libebl/ChangeLog +++ elfutils/libebl/ChangeLog -@@ -554,6 +554,11 @@ +@@ -558,6 +558,11 @@ * Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency tracking works right. @@ -647,7 +619,7 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -207,9 +209,9 @@ target_alias = @target_alias@ +@@ -209,9 +211,9 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \ @@ -661,7 +633,7 @@ --- elfutils/libelf/ChangeLog +++ elfutils/libelf/ChangeLog -@@ -408,6 +408,11 @@ +@@ -477,6 +477,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. @@ -730,7 +702,7 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -255,10 +257,10 @@ target_alias = @target_alias@ +@@ -257,10 +259,10 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @MUDFLAP_FALSE@AM_CFLAGS = $(am__append_1) -Wall -Wshadow -Werror \ @@ -763,7 +735,7 @@ YACC = @YACC@ --- elfutils/Makefile.in +++ elfutils/Makefile.in -@@ -98,6 +98,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -109,6 +109,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -771,7 +743,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -127,6 +128,7 @@ SHELL = @SHELL@ +@@ -138,6 +139,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -781,7 +753,7 @@ YACC = @YACC@ --- elfutils/src/ChangeLog +++ elfutils/src/ChangeLog -@@ -61,6 +61,11 @@ +@@ -76,6 +76,11 @@ that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really is valid in RELRO. @@ -793,7 +765,7 @@ 2008-02-29 Roland McGrath * readelf.c (print_attributes): Add a cast. -@@ -312,6 +317,8 @@ +@@ -327,6 +332,8 @@ * readelf.c (hex_dump): Fix rounding error in whitespace calculation. @@ -802,7 +774,7 @@ 2007-10-15 Roland McGrath * make-debug-archive.in: New file. -@@ -751,6 +758,10 @@ +@@ -766,6 +773,10 @@ * elflint.c (valid_e_machine): Add EM_ALPHA. Reported by Christian Aichinger . @@ -813,7 +785,7 @@ 2006-08-08 Ulrich Drepper * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB. -@@ -827,6 +838,10 @@ +@@ -842,6 +853,10 @@ * Makefile.am: Add hacks to create dependency files for non-generic linker. @@ -824,7 +796,7 @@ 2006-06-12 Ulrich Drepper * ldgeneric.c (ld_generic_generate_sections): Don't create .interp -@@ -1175,6 +1190,11 @@ +@@ -1190,6 +1205,11 @@ * readelf.c (print_debug_loc_section): Fix indentation for larger address size. @@ -898,7 +870,7 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -d -@@ -287,13 +289,13 @@ top_srcdir = @top_srcdir@ +@@ -289,13 +291,13 @@ top_srcdir = @top_srcdir@ @MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -std=gnu99 \ @MUDFLAP_FALSE@ $(native_ld_cflags) $(if \ @MUDFLAP_FALSE@ $($(*F)_no_Werror),,-Werror) $(if \ @@ -914,7 +886,7 @@ @MUDFLAP_TRUE@ $($(*F)_no_Wformat),,-Wformat=2) $(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 +@@ -339,6 +341,9 @@ size_no_Wformat = yes strings_no_Wformat = yes # XXX While the file is not finished, don't warn about this ldgeneric_no_Wunused = yes @@ -926,7 +898,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 +@@ -6424,7 +6424,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 +988,7 @@ cannot set access and modification date of '%s'"), fname); --- elfutils/tests/ChangeLog +++ elfutils/tests/ChangeLog -@@ -51,6 +51,8 @@ +@@ -84,6 +84,8 @@ 2008-01-21 Roland McGrath @@ -1025,7 +997,7 @@ * testfile45.S.bz2: Add tests for cltq, cqto. * testfile45.expect.bz2: Adjust. -@@ -759,6 +761,11 @@ +@@ -792,6 +794,11 @@ * Makefile.am (TESTS): Add run-elflint-test.sh. (EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2. @@ -1068,7 +1040,7 @@ endif --- elfutils/tests/Makefile.in +++ elfutils/tests/Makefile.in -@@ -335,6 +335,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -341,6 +341,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -1076,7 +1048,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -364,6 +365,7 @@ SHELL = @SHELL@ +@@ -370,6 +371,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -1084,8 +1056,8 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -418,10 +420,10 @@ sysconfdir = @sysconfdir@ - target_alias = @target_alias@ +@@ -426,10 +428,10 @@ target_alias = @target_alias@ + top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 \ diff --git a/elfutils.spec b/elfutils.spec index d2d3430..de61463 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,5 +1,5 @@ -%define eu_version 0.137 -%define eu_release 3 +%define eu_version 0.138 +%define eu_release 1 %if %{?_with_compat:1}%{!?_with_compat:0} %define compat 1 @@ -32,10 +32,9 @@ Release: 0.%{eu_release} License: GPLv2 with exceptions Group: Development/Tools URL: https://fedorahosted.org/elfutils/ -Source: http://fedorahosted.org/releases/e/l/elfutils/%{name}-%{version}.tar.gz +Source: http://fedorahosted.org/releases/e/l/elfutils/%{name}-%{version}.tar.bz2 Patch1: elfutils-portability.patch Patch2: elfutils-robustify.patch -Patch3: elfutils-0.137-fixes.patch Requires: elfutils-libelf-%{_arch} = %{version}-%{release} Requires: elfutils-libs-%{_arch} = %{version}-%{release} @@ -157,8 +156,6 @@ find . \( -name configure -o -name config.h.in \) -print | xargs touch %patch2 -p1 -b .robustify -%patch3 -p1 -b .fixes - find . -name \*.sh ! -perm -0100 -print | xargs chmod +x %build @@ -239,6 +236,7 @@ rm -rf ${RPM_BUILD_ROOT} %{_includedir}/elfutils/libebl.h %{_includedir}/elfutils/libdw.h %{_includedir}/elfutils/libdwfl.h +%{_includedir}/elfutils/version.h %{_libdir}/libebl.a %{_libdir}/libasm.so %{_libdir}/libdw.so @@ -265,6 +263,16 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/libelf.a %changelog +* Wed Dec 31 2008 Roland McGrath - 0.138-1 +- Update to 0.138 + - Install header file for applications to use in + source version compatibility checks. + - libebl: backend fixes for i386 TLS relocs; backend support for NT_386_IOPERM + - libcpu: disassembler fixes (#469739) + - libdwfl: bug fixes (#465878) + - libelf: bug fixes + - eu-nm: bug fixes for handling corrupt input files (#476136) + * Wed Oct 1 2008 Roland McGrath - 0.137-3 - fix libdwfl regression (#462689) diff --git a/sources b/sources index 81ce69c..6e5fa80 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a24690a64268516bd413c4c3fe6c6dd4 elfutils-0.137.tar.gz +1a846d275cb6c8ab995fa0fa877113ff elfutils-0.138.tar.bz2 From 066e18505592be71cc3192b36708ac230ced71bf Mon Sep 17 00:00:00 2001 From: roland Date: Sat, 24 Jan 2009 01:22:10 +0000 Subject: [PATCH 08/13] Update to 0.139 --- .cvsignore | 2 +- Makefile | 25 +- elfutils-0.138.tar.bz2.sig | Bin 72 -> 0 bytes elfutils-0.139.tar.bz2.sig | Bin 0 -> 65 bytes elfutils-portability.patch | 691 +++++++++++++++++++++++++++++++------ elfutils-robustify.patch | 372 ++++++++++---------- elfutils.spec | 42 ++- sources | 2 +- upstream-key.gpg | 214 ++++++------ 9 files changed, 935 insertions(+), 413 deletions(-) delete mode 100644 elfutils-0.138.tar.bz2.sig create mode 100644 elfutils-0.139.tar.bz2.sig diff --git a/.cvsignore b/.cvsignore index 2650720..27a80ff 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -elfutils-0.138.tar.bz2 +elfutils-0.139.tar.bz2 diff --git a/Makefile b/Makefile index b8735ba..8d35a02 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ NAME := elfutils SPECFILE = elfutils.spec +all: + UPSTREAM_CHECKS := sig UPSTREAM_FILES = $(NAME)-$(VERSION).tar.bz2 upstream:; @@ -28,20 +30,19 @@ ifneq (,$(CURL)) CURL += -k endif +patches := $(patsubst %,elfutils-%.patch,robustify portability) +all: $(patches) + branch-portability = portable +branch-master = elfutils-$(VERSION) -elfutils-base = elfutils-$(VERSION) -elfutils-base = master +elfutils-%/configure: .git/refs/heads/* Makefile + @rm -rf $(@D) + git archive --prefix=$(@D)/ $(firstword $(branch-$*) $*) | tar xf - + cd $(@D) && autoreconf -i && rm -rf autom4te.cache -elfutils-%.patch: elfutils-$(VERSION).tar.bz2 Makefile - @rm -rf elfutils-master elfutils-$* - git archive --prefix=elfutils-master/ $(elfutils-base) \ - | tar xf - - git archive --prefix=elfutils-$*/ $(firstword $(branch-$*) $*) \ - | tar xf - - cd elfutils-master; autoreconf -i; rm -rf autom4te.cache - cd elfutils-$*; autoreconf -i; rm -rf autom4te.cache - diff -Nrpu elfutils-master elfutils-$* | \ +elfutils-%.patch: elfutils-master/configure elfutils-%/configure + diff --exclude='.gitignore' -Nrpu $(^D) | \ filterdiff --remove-timestamps --strip=1 --addprefix=elfutils/ > $@.new mv $@.new $@ @@ -52,7 +53,7 @@ elfutils-portable.spec: elfutils.spec portable-r = 0.$(subst $(DIST),,$(RELEASE)) portable-vr = $(VERSION)-$(portable-r) portable.srpm = elfutils-$(portable-vr).src.rpm -$(portable.srpm): elfutils-portable.spec elfutils-portability.patch \ +$(portable.srpm): elfutils-portable.spec $(patches) \ elfutils-$(VERSION).tar.bz2 $(RPM_WITH_DIRS) --nodeps -bs $< diff --git a/elfutils-0.138.tar.bz2.sig b/elfutils-0.138.tar.bz2.sig deleted file mode 100644 index 24149f5c3168fc2736fae735cbd6ef631f01789f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 72 zcmV-O0Jr~$Mg#y60ssaD0!drt9{>so5ZWlhI(h#@botx>psRih!Rybi+)tzG8YU?F e3KZ(w&H$SQE?qh+^#gVQi(2%3K@2QZqnnhiUL1V@ diff --git a/elfutils-0.139.tar.bz2.sig b/elfutils-0.139.tar.bz2.sig new file mode 100644 index 0000000000000000000000000000000000000000..4f317460a23ad1c0de091e34fb76f13c5c85e255 GIT binary patch literal 65 zcmV-H0KWf-KLZ5-NqLeP+V?dIe!JEs5dt910G=eLHLffl-+l^8m0EUXmxH~`NGkxJ XSCD0bVe}~>QoTwc46L8#Y5%n5Ep;1i literal 0 HcmV?d00001 diff --git a/elfutils-portability.patch b/elfutils-portability.patch index c87295f..545e9b2 100644 --- a/elfutils-portability.patch +++ b/elfutils-portability.patch @@ -1,6 +1,14 @@ --- elfutils/backends/ChangeLog +++ elfutils/backends/ChangeLog -@@ -325,6 +325,11 @@ +@@ -1,3 +1,7 @@ ++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 +@@ -325,6 +329,11 @@ * sparc_init.c: Likewise. * x86_64_init.c: Likewise. @@ -12,7 +20,7 @@ 2005-11-19 Roland McGrath * ppc64_reloc.def: REL30 -> ADDR30. -@@ -347,6 +352,9 @@ +@@ -347,6 +356,9 @@ * Makefile.am (uninstall): Don't try to remove $(pkgincludedir). (CLEANFILES): Add libebl_$(m).so. @@ -24,6 +32,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 +64,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 +83,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 +91,9 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -241,9 +243,9 @@ top_build_prefix = @top_build_prefix@ - 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 +103,31 @@ 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 -@@ -54,6 +54,10 @@ +@@ -1,3 +1,12 @@ ++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 ++ building with compiler support but no working runtime support. ++ + 2009-01-22 Ulrich Drepper + + * Makefile.am (rpm): The tarball is now bzip2-compressed. +@@ -73,6 +82,10 @@ * configure.ac: Add dummy automake conditional to get dependencies for non-generic linker right. See src/Makefile.am. @@ -91,7 +138,7 @@ 2005-11-18 Roland McGrath * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable. -@@ -101,6 +105,17 @@ +@@ -120,6 +133,17 @@ * Makefile.am (all_SUBDIRS): Add libdwfl. * configure.ac: Write libdwfl/Makefile. @@ -111,7 +158,7 @@ * 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 +166,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,9 +174,28 @@ 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 -@@ -637,6 +637,8 @@ NATIVE_LD_FALSE +@@ -642,6 +642,8 @@ NATIVE_LD_FALSE NATIVE_LD_TRUE DATADIRNAME LOCALEDIR @@ -138,38 +204,31 @@ LEXLIB LEX_OUTPUT_ROOT LEX -@@ -4028,6 +4030,89 @@ $as_echo "$as_me: error: gcc with C99 su +@@ -4041,13 +4043,15 @@ $as_echo "$as_me: error: gcc with C99 su fi +-{ $as_echo "$as_me:$LINENO: checking for gcc with TLS support" >&5 +-$as_echo_n "checking for gcc with TLS support... " >&6; } +-if test "${ac_cv_tls+set}" = set; then +{ $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 -+ $as_echo_n "(cached) " >&6 -+else + $as_echo_n "(cached) " >&6 + else +- cat >conftest.$ac_ext <<_ACEOF +-__thread int a; int foo (int b) { return a + b; } + old_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wextra" +cat >conftest.$ac_ext <<_ACEOF +void foo (void) { } -+_ACEOF -+rm -f conftest.$ac_objext -+if { (ac_try="$ac_compile" -+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_compile") 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_objext; then + _ACEOF + rm -f conftest.$ac_objext + if { (ac_try="$ac_compile" +@@ -4067,6 +4071,172 @@ $as_echo "$ac_try_echo") >&5 + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_cc_wextra=yes +else + $as_echo "$as_me: failed program was:" >&5 @@ -224,16 +283,226 @@ + + + ++{ $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 ++ $as_echo_n "(cached) " >&6 ++else ++ # 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. ++save_CFLAGS="$CFLAGS" ++save_LDFLAGS="$LDFLAGS" ++CFLAGS="-fpic $CFLAGS" ++LDFLAGS="-shared -Wl,-z,defs,-z,relro $LDFLAGS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#undef __thread ++static __thread int a; int foo (int b) { return a + b; } ++int ++main () ++{ ++exit (foo (0)); ++ ; ++ 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_tls=yes + else + $as_echo "$as_me: failed program was:" >&5 +@@ -4075,14 +4245,27 @@ sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_tls=no + fi - cat >>confdefs.h <<_ACEOF +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -rf conftest.dSYM ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++CFLAGS="$save_CFLAGS" ++LDFLAGS="$save_LDFLAGS" + 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: gcc with TLS support required" >&5 +-$as_echo "$as_me: error: gcc with TLS 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 + + +@@ -4673,9 +4856,9 @@ if test "${with_zlib+set}" = set; then + fi + + if test $with_zlib != no; then +- { $as_echo "$as_me:$LINENO: checking for library containing gzdopen" >&5 +-$as_echo_n "checking for library containing gzdopen... " >&6; } +-if test "${ac_cv_search_gzdopen+set}" = set; then ++ { $as_echo "$as_me:$LINENO: checking for library containing gzdirect" >&5 ++$as_echo_n "checking for library containing gzdirect... " >&6; } ++if test "${ac_cv_search_gzdirect+set}" = set; then + $as_echo_n "(cached) " >&6 + else + ac_func_search_save_LIBS=$LIBS +@@ -4692,11 +4875,11 @@ cat >>conftest.$ac_ext <<_ACEOF + #ifdef __cplusplus + extern "C" + #endif +-char gzdopen (); ++char gzdirect (); + int + main () + { +-return gzdopen (); ++return gzdirect (); + ; + return 0; + } +@@ -4729,7 +4912,7 @@ $as_echo "$ac_try_echo") >&5 + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then +- ac_cv_search_gzdopen=$ac_res ++ ac_cv_search_gzdirect=$ac_res + else + $as_echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 +@@ -4740,21 +4923,21 @@ fi + rm -rf conftest.dSYM + rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext +- if test "${ac_cv_search_gzdopen+set}" = set; then ++ if test "${ac_cv_search_gzdirect+set}" = set; then + break + fi + done +-if test "${ac_cv_search_gzdopen+set}" = set; then ++if test "${ac_cv_search_gzdirect+set}" = set; then + : + else +- ac_cv_search_gzdopen=no ++ ac_cv_search_gzdirect=no + fi + rm conftest.$ac_ext + LIBS=$ac_func_search_save_LIBS + fi +-{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_gzdopen" >&5 +-$as_echo "$ac_cv_search_gzdopen" >&6; } +-ac_res=$ac_cv_search_gzdopen ++{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_gzdirect" >&5 ++$as_echo "$ac_cv_search_gzdirect" >&6; } ++ac_res=$ac_cv_search_gzdirect + if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + with_zlib=yes --- elfutils/configure.ac +++ elfutils/configure.ac -@@ -74,6 +74,34 @@ CFLAGS="$old_CFLAGS"]) +@@ -74,12 +74,58 @@ CFLAGS="$old_CFLAGS"]) AS_IF([test "x$ac_cv_c99" != xyes], AC_MSG_ERROR([gcc with C99 support required])) +-AC_CACHE_CHECK([for gcc with TLS support], ac_cv_tls, [dnl +-AC_COMPILE_IFELSE([dnl +-__thread int a; int foo (int b) { return a + b; }], +- ac_cv_tls=yes, ac_cv_tls=no)]) +AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl +old_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wextra" @@ -261,13 +530,58 @@ + [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. ++save_CFLAGS="$CFLAGS" ++save_LDFLAGS="$LDFLAGS" ++CFLAGS="-fpic $CFLAGS" ++LDFLAGS="-shared -Wl,-z,defs,-z,relro $LDFLAGS" ++AC_LINK_IFELSE([dnl ++AC_LANG_PROGRAM([[#undef __thread ++static __thread int a; int foo (int b) { return a + b; }]], ++ [[exit (foo (0));]])], ++ ac_cv_tls=yes, ac_cv_tls=no) ++CFLAGS="$save_CFLAGS" ++LDFLAGS="$save_LDFLAGS"]) + AS_IF([test "x$ac_cv_tls" != xyes], +- AC_MSG_ERROR([gcc with TLS 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") +@@ -193,7 +239,7 @@ dnl Test for zlib and bzlib, gives ZLIB/ + dnl conditional and config.h USE_ZLIB/USE_BZLIB #define. + save_LIBS="$LIBS" + LIBS= +-eu_ZIPLIB(z,Z,z,gzdopen,gzip) ++eu_ZIPLIB(z,Z,z,gzdirect,gzip) + eu_ZIPLIB(bz,BZ,bz2,BZ2_bzdopen,bzip2) + zip_LIBS="$LIBS" + LIBS="$save_LIBS" --- elfutils/lib/ChangeLog +++ elfutils/lib/ChangeLog -@@ -41,6 +41,11 @@ +@@ -1,3 +1,10 @@ ++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 + + * system.h (ARGP_PROGRAM_VERSION_HOOK_DEF): Define. +@@ -52,6 +59,11 @@ * Makefile.am (libeu_a_SOURCES): Add it. * system.h: Declare crc32_file. @@ -279,6 +593,36 @@ 2005-04-30 Ulrich Drepper * Makefile.am: Use -ffunction-sections for xmalloc.c. +--- elfutils/lib/eu-config.h ++++ elfutils/lib/eu-config.h +@@ -46,6 +46,9 @@ + Network licensing program, please visit www.openinventionnetwork.com + . */ + ++#ifndef EU_CONFIG_H ++#define EU_CONFIG_H 1 ++ + #ifdef USE_LOCKS + # include + # include +@@ -178,3 +181,17 @@ 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 @@ @@ -298,7 +642,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@ @@ -306,7 +650,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@ @@ -314,9 +658,9 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -179,9 +181,9 @@ top_build_prefix = @top_build_prefix@ - 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) @@ -328,7 +672,7 @@ libeu_a_SOURCES = xstrndup.c xmalloc.c next_prime.c \ --- elfutils/libasm/ChangeLog +++ elfutils/libasm/ChangeLog -@@ -58,6 +58,11 @@ +@@ -63,6 +63,11 @@ * asm_error.c: Add new error ASM_E_IOERROR. * libasmP.h: Add ASM_E_IOERROR definition. @@ -359,7 +703,7 @@ -I$(top_srcdir)/lib --- elfutils/libasm/Makefile.in +++ elfutils/libasm/Makefile.in -@@ -127,6 +127,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@ @@ -367,7 +711,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -156,6 +157,7 @@ SHELL = @SHELL@ +@@ -157,6 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = 1 @@ -375,9 +719,9 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -213,9 +215,9 @@ top_build_prefix = @top_build_prefix@ - 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 @@ -389,7 +733,19 @@ -I$(top_srcdir)/lib --- elfutils/libcpu/ChangeLog +++ elfutils/libcpu/ChangeLog -@@ -307,6 +307,11 @@ +@@ -1,3 +1,11 @@ ++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. ++ + 2009-01-01 Ulrich Drepper + + * i386_parse.y (instrtable_out): Optimize match_data table by not +@@ -324,6 +332,11 @@ * defs/i386.doc: New file. * defs/x86_64: New file. @@ -401,8 +757,26 @@ 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 +@@ -1,6 +1,6 @@ + ## Process this file with automake to create Makefile.in + ## +-## Copyright (C) 2002, 2004, 2005, 2007, 2008 Red Hat, Inc. ++## Copyright (C) 2002, 2004, 2005, 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 @@ -30,7 +30,8 @@ AM_CFLAGS = -fmudflap else AM_CFLAGS = @@ -413,9 +787,18 @@ $($(*F)_CFLAGS) \ $(if $($(*F)_no_Werror),,-Werror) INCLUDES = -I$(srcdir) -I$(srcdir)/../lib -I$(srcdir)/../libelf \ +@@ -70,7 +71,7 @@ libeu = ../lib/libeu.a + + i386_lex_CFLAGS = -Wno-unused-label -Wno-unused-function -Wno-sign-compare + i386_parse.o: i386_parse.c i386.mnemonics +-i386_parse_CFLAGS = -DNMNES=$$(wc -l < i386.mnemonics) ++i386_parse_CFLAGS = -DNMNES="`wc -l < i386.mnemonics`" + i386_lex.o: i386_parse.h + i386_gendis_LDADD = $(libeu) -lm $(libmudflap) + --- 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@ @@ -423,7 +806,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = lex.$( ++ ++ * Makefile.am ($(srcdir)/known-dwarf.h): Target renamed back. ++ Put these rules under if MAINTAINER_MODE. ++ + 2009-01-22 Roland McGrath + + * dwarf.h: Add DW_OP_GNU_encoded_addr. +@@ -542,6 +547,11 @@ 2005-05-31 Roland McGrath @@ -478,9 +879,26 @@ INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib VERSION = 1 +@@ -85,11 +86,13 @@ libdw_a_SOURCES = dwarf_begin.c dwarf_be + libdw_visit_scopes.c \ + dwarf_entry_breakpoints.c + +-BUILT_SOURCES = known-dwarf.h +-CLEANFILES = known-dwarf.h +-known-dwarf.h: $(top_srcdir)/config/known-dwarf.awk $(srcdir)/dwarf.h ++if MAINTAINER_MODE ++BUILT_SOURCES = $(srcdir)/known-dwarf.h ++MAINTAINERCLEANFILES = $(srcdir)/known-dwarf.h ++$(srcdir)/known-dwarf.h: $(top_srcdir)/config/known-dwarf.awk $(srcdir)/dwarf.h + $(AWK) -f $^ > $@.new + mv -f $@.new $@ ++endif + + if !MUDFLAP + libdw_pic_a_SOURCES = --- 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@ @@ -488,7 +906,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 @@ -496,9 +914,9 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -250,9 +252,10 @@ top_build_prefix = @top_build_prefix@ - 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 @@ -509,9 +927,49 @@ INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib COMPILE.os = $(filter-out -fprofile-arcs, $(filter-out -ftest-coverage, \ $(COMPILE))) +@@ -299,8 +302,8 @@ libdw_a_SOURCES = dwarf_begin.c dwarf_be + libdw_visit_scopes.c \ + dwarf_entry_breakpoints.c + +-BUILT_SOURCES = known-dwarf.h +-CLEANFILES = known-dwarf.h ++@MAINTAINER_MODE_TRUE@BUILT_SOURCES = $(srcdir)/known-dwarf.h ++@MAINTAINER_MODE_TRUE@MAINTAINERCLEANFILES = $(srcdir)/known-dwarf.h + @MUDFLAP_FALSE@libdw_pic_a_SOURCES = + @MUDFLAP_FALSE@am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os) + @MUDFLAP_FALSE@libdw_so_SOURCES = +@@ -635,7 +638,6 @@ mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + + clean-generic: +- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + + distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) +@@ -644,6 +646,7 @@ maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) ++ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + clean: clean-am + + clean-am: clean-generic clean-libLIBRARIES clean-noinstLIBRARIES \ +@@ -720,9 +723,9 @@ uninstall-am: uninstall-includeHEADERS u + ps ps-am tags uninstall uninstall-am uninstall-includeHEADERS \ + uninstall-libLIBRARIES uninstall-pkgincludeHEADERS + +-known-dwarf.h: $(top_srcdir)/config/known-dwarf.awk $(srcdir)/dwarf.h +- $(AWK) -f $^ > $@.new +- mv -f $@.new $@ ++@MAINTAINER_MODE_TRUE@$(srcdir)/known-dwarf.h: $(top_srcdir)/config/known-dwarf.awk $(srcdir)/dwarf.h ++@MAINTAINER_MODE_TRUE@ $(AWK) -f $^ > $@.new ++@MAINTAINER_MODE_TRUE@ mv -f $@.new $@ + @MUDFLAP_FALSE@libdw.so: $(srcdir)/libdw.map libdw_pic.a \ + @MUDFLAP_FALSE@ ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \ + @MUDFLAP_FALSE@ ../libelf/libelf.so --- elfutils/libdwfl/ChangeLog +++ elfutils/libdwfl/ChangeLog -@@ -936,6 +936,11 @@ +@@ -987,6 +987,11 @@ 2005-07-21 Roland McGrath @@ -542,7 +1000,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@ @@ -550,7 +1008,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 @@ -558,9 +1016,9 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -217,9 +219,9 @@ top_build_prefix = @top_build_prefix@ - 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 @@ -603,7 +1061,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@ @@ -611,7 +1069,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 @@ -619,9 +1077,9 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -209,9 +211,9 @@ top_build_prefix = @top_build_prefix@ - 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 @@ -633,18 +1091,18 @@ --- elfutils/libelf/ChangeLog +++ elfutils/libelf/ChangeLog -@@ -477,6 +477,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. +@@ -515,6 +515,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) @@ -686,7 +1144,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@ @@ -694,7 +1152,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 @@ -702,9 +1160,9 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -257,10 +259,10 @@ top_build_prefix = @top_build_prefix@ - 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 \ @@ -717,7 +1175,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@ @@ -725,7 +1183,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@ @@ -735,7 +1193,7 @@ YACC = @YACC@ --- elfutils/Makefile.in +++ elfutils/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@ @@ -743,7 +1201,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -138,6 +139,7 @@ SHELL = @SHELL@ +@@ -139,6 +140,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -751,9 +1209,38 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ +--- elfutils/src/addr2line.c ++++ elfutils/src/addr2line.c +@@ -376,7 +376,7 @@ handle_address (const char *string, Dwfl + bool parsed = false; + int n; + char *name = NULL; +- if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &n) == 2 ++ if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &n) == 2 + && string[n] == '\0') + { + /* It was (section)+offset. This makes sense if there is +@@ -417,7 +417,7 @@ handle_address (const char *string, Dwfl + } + } + } +- else if (sscanf (string, "%m[^-+]%" PRIiMAX "%n", &name, &addr, &n) == 2 ++ else if (sscanf (string, "%a[^-+]%" PRIiMAX "%n", &name, &addr, &n) == 2 + && string[n] == '\0') + { + /* It was symbol+offset. */ --- elfutils/src/ChangeLog +++ elfutils/src/ChangeLog -@@ -76,6 +76,11 @@ +@@ -12,6 +12,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 +@@ -195,6 +197,11 @@ that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really is valid in RELRO. @@ -765,7 +1252,7 @@ 2008-02-29 Roland McGrath * readelf.c (print_attributes): Add a cast. -@@ -327,6 +332,8 @@ +@@ -446,6 +453,8 @@ * readelf.c (hex_dump): Fix rounding error in whitespace calculation. @@ -774,7 +1261,7 @@ 2007-10-15 Roland McGrath * make-debug-archive.in: New file. -@@ -766,6 +773,10 @@ +@@ -885,6 +894,10 @@ * elflint.c (valid_e_machine): Add EM_ALPHA. Reported by Christian Aichinger . @@ -785,7 +1272,7 @@ 2006-08-08 Ulrich Drepper * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB. -@@ -842,6 +853,10 @@ +@@ -961,6 +974,10 @@ * Makefile.am: Add hacks to create dependency files for non-generic linker. @@ -796,7 +1283,7 @@ 2006-06-12 Ulrich Drepper * ldgeneric.c (ld_generic_generate_sections): Don't create .interp -@@ -1190,6 +1205,11 @@ +@@ -1309,6 +1326,11 @@ * readelf.c (print_debug_loc_section): Fix indentation for larger address size. @@ -810,7 +1297,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 @@ -839,10 +1326,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 @@ -854,7 +1341,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@ @@ -862,7 +1349,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@ @@ -870,24 +1357,24 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -d -@@ -289,13 +291,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 \ -@@ -339,6 +341,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 + @@ -898,7 +1385,7 @@ size_LDADD = $(libelf) $(libeu) $(libmudflap) --- elfutils/src/readelf.c +++ elfutils/src/readelf.c -@@ -6424,7 +6424,7 @@ dump_archive_index (Elf *elf, const char +@@ -7385,7 +7385,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)) @@ -988,7 +1475,7 @@ cannot set access and modification date of '%s'"), fname); --- elfutils/tests/ChangeLog +++ elfutils/tests/ChangeLog -@@ -84,6 +84,8 @@ +@@ -95,6 +95,8 @@ 2008-01-21 Roland McGrath @@ -997,7 +1484,7 @@ * testfile45.S.bz2: Add tests for cltq, cqto. * testfile45.expect.bz2: Adjust. -@@ -792,6 +794,11 @@ +@@ -803,6 +805,11 @@ * Makefile.am (TESTS): Add run-elflint-test.sh. (EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2. @@ -1040,7 +1527,7 @@ endif --- elfutils/tests/Makefile.in +++ elfutils/tests/Makefile.in -@@ -341,6 +341,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@ @@ -1048,7 +1535,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -370,6 +371,7 @@ SHELL = @SHELL@ +@@ -371,6 +372,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -1056,10 +1543,10 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -426,10 +428,10 @@ target_alias = @target_alias@ - top_build_prefix = @top_build_prefix@ +@@ -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 1c3d3e7..3766df5 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 +@@ -507,6 +507,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 +@@ -1297,6 +1297,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. +@@ -1342,6 +1352,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) +@@ -319,10 +322,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[] = +@@ -344,10 +356,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 +@@ -612,7 +620,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 +@@ -650,7 +659,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 +@@ -670,7 +679,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 +@@ -1000,9 +1010,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 +@@ -1012,7 +1024,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 +@@ -1026,7 +1040,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 +@@ -1186,7 +1202,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 +@@ -1409,7 +1426,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 +@@ -1459,7 +1477,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 +@@ -1562,7 +1581,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 +@@ -1572,7 +1592,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 +@@ -1853,6 +1873,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 +@@ -1879,6 +1901,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 +@@ -1921,7 +1949,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 +@@ -1932,18 +1960,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 +@@ -1973,18 +2011,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 +@@ -2009,7 +2057,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 +@@ -2681,8 +2729,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 +@@ -1130,6 +1130,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 +@@ -1142,8 +1144,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 +@@ -1294,7 +1296,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, +@@ -1309,6 +1312,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, +@@ -1318,9 +1326,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 +@@ -1820,6 +1826,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 +@@ -1830,15 +1843,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, +@@ -2074,7 +2084,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, +@@ -2085,9 +2101,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 +@@ -2140,8 +2154,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 +@@ -2153,9 +2173,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 +@@ -2417,8 +2435,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 +@@ -2430,9 +2454,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, +@@ -2484,7 +2506,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, +@@ -2497,9 +2529,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 +@@ -4058,6 +4088,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.spec b/elfutils.spec index de61463..6de87eb 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,4 +1,4 @@ -%define eu_version 0.138 +%define eu_version 0.139 %define eu_release 1 %if %{?_with_compat:1}%{!?_with_compat:0} @@ -33,8 +33,8 @@ License: GPLv2 with exceptions Group: Development/Tools URL: https://fedorahosted.org/elfutils/ Source: http://fedorahosted.org/releases/e/l/elfutils/%{name}-%{version}.tar.bz2 -Patch1: elfutils-portability.patch -Patch2: elfutils-robustify.patch +Patch1: elfutils-robustify.patch +Patch2: elfutils-portability.patch Requires: elfutils-libelf-%{_arch} = %{version}-%{release} Requires: elfutils-libs-%{_arch} = %{version}-%{release} @@ -50,6 +50,19 @@ BuildRequires: glibc-headers >= 2.3.4-11 BuildRequires: gcc >= 3.2 %endif +%define use_zlib 0 +%if 0%{?fedora} >= 5 +%define use_zlib 1 +%endif +%if 0%{?rhel} >= 5 +%define use_zlib 1 +%endif + +%if %{use_zlib} +BuildRequires: zlib-devel >= 1.2.2.3 +BuildRequires: bzip2-devel +%endif + %define _gnu %{nil} %define _program_prefix eu- @@ -142,19 +155,19 @@ for libelf. %prep %setup -q -%if !0%{?scanf_has_m} -sed -i.scanf-m -e 's/%m/%a/' tests/line2addr.c -%endif +%patch1 -p1 -b .robustify %if %{compat} -%patch1 -p1 -b .portability +%patch2 -p1 -b .portability sleep 1 find . \( -name Makefile.in -o -name aclocal.m4 \) -print | xargs touch sleep 1 find . \( -name configure -o -name config.h.in \) -print | xargs touch +%else +%if !0%{?scanf_has_m} +sed -i.scanf-m -e 's/%m/%a/g' src/addr2line.c tests/line2addr.c +%endif %endif - -%patch2 -p1 -b .robustify find . -name \*.sh ! -perm -0100 -print | xargs chmod +x @@ -263,6 +276,17 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/libelf.a %changelog +* Fri Jan 23 2009 Roland McGrath - 0.139-1 +- 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. (#472136) + +* Thu Jan 1 2009 Roland McGrath - 0.138-2 +- Fix libelf regression. + * Wed Dec 31 2008 Roland McGrath - 0.138-1 - Update to 0.138 - Install header file for applications to use in diff --git a/sources b/sources index 6e5fa80..8dfff15 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -1a846d275cb6c8ab995fa0fa877113ff elfutils-0.138.tar.bz2 +9cfc12ac0d6d14968e253639fa957946 elfutils-0.139.tar.bz2 diff --git a/upstream-key.gpg b/upstream-key.gpg index 850e6e6..5ba3b5d 100644 --- a/upstream-key.gpg +++ b/upstream-key.gpg @@ -1,123 +1,109 @@ +pub 1024D/7EBBD625 2003-01-10 +uid Roland McGrath +uid Roland McGrath +uid Roland McGrath +uid Roland McGrath +sub 2048g/17998A93 2003-01-10 + pub 1024D/79FF4474 2001-08-24 uid Ulrich Drepper uid Ulrich Drepper -uid [jpeg image of size 2203] sub 2048g/07FA6550 2001-08-24 -----BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.4.7 (GNU/Linux) +Version: GnuPG v1.4.5 (GNU/Linux) -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 gTKAnym+PwCfbnwIeEZfbBWgonv4/I3aNNm3FdQ= -=rhf6 +=2IML -----END PGP PUBLIC KEY BLOCK----- From 67363c47927be78091bc49c5c93e865e1aeebde3 Mon Sep 17 00:00:00 2001 From: roland Date: Mon, 16 Feb 2009 22:00:39 +0000 Subject: [PATCH 09/13] Update to 0.140 --- .cvsignore | 2 +- elfutils-0.139.tar.bz2.sig | Bin 65 -> 0 bytes elfutils-portability.patch | 398 +++++++------------------------------ elfutils-robustify.patch | 78 ++++---- elfutils.spec | 12 +- sources | 2 +- 6 files changed, 125 insertions(+), 367 deletions(-) delete mode 100644 elfutils-0.139.tar.bz2.sig diff --git a/.cvsignore b/.cvsignore index 27a80ff..9627477 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -elfutils-0.139.tar.bz2 +elfutils-0.140.tar.bz2 diff --git a/elfutils-0.139.tar.bz2.sig b/elfutils-0.139.tar.bz2.sig deleted file mode 100644 index 4f317460a23ad1c0de091e34fb76f13c5c85e255..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 65 zcmV-H0KWf-KLZ5-NqLeP+V?dIe!JEs5dt910G=eLHLffl-+l^8m0EUXmxH~`NGkxJ XSCD0bVe}~>QoTwc46L8#Y5%n5Ep;1i diff --git a/elfutils-portability.patch b/elfutils-portability.patch index 545e9b2..4c3a131 100644 --- a/elfutils-portability.patch +++ b/elfutils-portability.patch @@ -1,6 +1,9 @@ --- elfutils/backends/ChangeLog +++ elfutils/backends/ChangeLog -@@ -1,3 +1,7 @@ +@@ -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). @@ -8,7 +11,7 @@ 2008-10-04 Ulrich Drepper * i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and -@@ -325,6 +329,11 @@ +@@ -330,6 +334,11 @@ * sparc_init.c: Likewise. * x86_64_init.c: Likewise. @@ -20,7 +23,7 @@ 2005-11-19 Roland McGrath * ppc64_reloc.def: REL30 -> ADDR30. -@@ -347,6 +356,9 @@ +@@ -352,6 +361,9 @@ * Makefile.am (uninstall): Don't try to remove $(pkgincludedir). (CLEANFILES): Add libebl_$(m).so. @@ -114,20 +117,15 @@ # XXX Should not be needed... --- elfutils/ChangeLog +++ elfutils/ChangeLog -@@ -1,3 +1,12 @@ -+2009-01-23 Roland McGrath -+ +@@ -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 -+ building with compiler support but no working runtime support. -+ - 2009-01-22 Ulrich Drepper + * configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3. - * Makefile.am (rpm): The tarball is now bzip2-compressed. -@@ -73,6 +82,10 @@ + * 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. @@ -138,7 +136,7 @@ 2005-11-18 Roland McGrath * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable. -@@ -120,6 +133,17 @@ +@@ -127,6 +133,17 @@ * Makefile.am (all_SUBDIRS): Add libdwfl. * configure.ac: Write libdwfl/Makefile. @@ -204,31 +202,38 @@ LEXLIB LEX_OUTPUT_ROOT LEX -@@ -4041,13 +4043,15 @@ $as_echo "$as_me: error: gcc with C99 su +@@ -4041,6 +4043,152 @@ $as_echo "$as_me: error: gcc with C99 su fi --{ $as_echo "$as_me:$LINENO: checking for gcc with TLS support" >&5 --$as_echo_n "checking for gcc with TLS support... " >&6; } --if test "${ac_cv_tls+set}" = set; then +{ $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 - $as_echo_n "(cached) " >&6 - else -- cat >conftest.$ac_ext <<_ACEOF --__thread int a; int foo (int b) { return a + b; } ++ $as_echo_n "(cached) " >&6 ++else + old_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wextra" +cat >conftest.$ac_ext <<_ACEOF +void foo (void) { } - _ACEOF - rm -f conftest.$ac_objext - if { (ac_try="$ac_compile" -@@ -4067,6 +4071,172 @@ $as_echo "$ac_try_echo") >&5 - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then ++_ACEOF ++rm -f conftest.$ac_objext ++if { (ac_try="$ac_compile" ++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_compile") 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_objext; then + ac_cv_cc_wextra=yes +else + $as_echo "$as_me: failed program was:" >&5 @@ -347,73 +352,15 @@ +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 -+ $as_echo_n "(cached) " >&6 -+else -+ # 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. -+save_CFLAGS="$CFLAGS" -+save_LDFLAGS="$LDFLAGS" -+CFLAGS="-fpic $CFLAGS" -+LDFLAGS="-shared -Wl,-z,defs,-z,relro $LDFLAGS" -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#undef __thread -+static __thread int a; int foo (int b) { return a + b; } -+int -+main () -+{ -+exit (foo (0)); -+ ; -+ 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_tls=yes - else - $as_echo "$as_me: failed program was:" >&5 -@@ -4075,14 +4245,27 @@ sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_tls=no - fi - --rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+rm -rf conftest.dSYM -+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ -+ conftest$ac_exeext conftest.$ac_ext -+CFLAGS="$save_CFLAGS" -+LDFLAGS="$save_LDFLAGS" - 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: gcc with TLS support required" >&5 --$as_echo "$as_me: error: gcc with TLS support required" >&2;} +- { { $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;} @@ -429,80 +376,12 @@ fi -@@ -4673,9 +4856,9 @@ if test "${with_zlib+set}" = set; then - fi - - if test $with_zlib != no; then -- { $as_echo "$as_me:$LINENO: checking for library containing gzdopen" >&5 --$as_echo_n "checking for library containing gzdopen... " >&6; } --if test "${ac_cv_search_gzdopen+set}" = set; then -+ { $as_echo "$as_me:$LINENO: checking for library containing gzdirect" >&5 -+$as_echo_n "checking for library containing gzdirect... " >&6; } -+if test "${ac_cv_search_gzdirect+set}" = set; then - $as_echo_n "(cached) " >&6 - else - ac_func_search_save_LIBS=$LIBS -@@ -4692,11 +4875,11 @@ cat >>conftest.$ac_ext <<_ACEOF - #ifdef __cplusplus - extern "C" - #endif --char gzdopen (); -+char gzdirect (); - int - main () - { --return gzdopen (); -+return gzdirect (); - ; - return 0; - } -@@ -4729,7 +4912,7 @@ $as_echo "$ac_try_echo") >&5 - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then -- ac_cv_search_gzdopen=$ac_res -+ ac_cv_search_gzdirect=$ac_res - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 -@@ -4740,21 +4923,21 @@ fi - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext -- if test "${ac_cv_search_gzdopen+set}" = set; then -+ if test "${ac_cv_search_gzdirect+set}" = set; then - break - fi - done --if test "${ac_cv_search_gzdopen+set}" = set; then -+if test "${ac_cv_search_gzdirect+set}" = set; then - : - else -- ac_cv_search_gzdopen=no -+ ac_cv_search_gzdirect=no - fi - rm conftest.$ac_ext - LIBS=$ac_func_search_save_LIBS - fi --{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_gzdopen" >&5 --$as_echo "$ac_cv_search_gzdopen" >&6; } --ac_res=$ac_cv_search_gzdopen -+{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_gzdirect" >&5 -+$as_echo "$ac_cv_search_gzdirect" >&6; } -+ac_res=$ac_cv_search_gzdirect - if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - with_zlib=yes --- elfutils/configure.ac +++ elfutils/configure.ac -@@ -74,12 +74,58 @@ 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])) --AC_CACHE_CHECK([for gcc with TLS support], ac_cv_tls, [dnl --AC_COMPILE_IFELSE([dnl --__thread int a; int foo (int b) { return a + b; }], -- ac_cv_tls=yes, ac_cv_tls=no)]) +AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl +old_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wextra" @@ -536,22 +415,14 @@ +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. -+save_CFLAGS="$CFLAGS" -+save_LDFLAGS="$LDFLAGS" -+CFLAGS="-fpic $CFLAGS" -+LDFLAGS="-shared -Wl,-z,defs,-z,relro $LDFLAGS" -+AC_LINK_IFELSE([dnl -+AC_LANG_PROGRAM([[#undef __thread -+static __thread int a; int foo (int b) { return a + b; }]], -+ [[exit (foo (0));]])], -+ ac_cv_tls=yes, ac_cv_tls=no) -+CFLAGS="$save_CFLAGS" -+LDFLAGS="$save_LDFLAGS"]) + 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([gcc with TLS support required])) +- 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 */], @@ -559,29 +430,18 @@ LOCALEDIR=$datadir AC_SUBST(LOCALEDIR) -@@ -193,7 +239,7 @@ dnl Test for zlib and bzlib, gives ZLIB/ - dnl conditional and config.h USE_ZLIB/USE_BZLIB #define. - save_LIBS="$LIBS" - LIBS= --eu_ZIPLIB(z,Z,z,gzdopen,gzip) -+eu_ZIPLIB(z,Z,z,gzdirect,gzip) - eu_ZIPLIB(bz,BZ,bz2,BZ2_bzdopen,bzip2) - zip_LIBS="$LIBS" - LIBS="$save_LIBS" --- elfutils/lib/ChangeLog +++ elfutils/lib/ChangeLog -@@ -1,3 +1,10 @@ -+2009-01-23 Roland McGrath -+ +@@ -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 + * eu-config.h: Add multiple inclusion protection. - * system.h (ARGP_PROGRAM_VERSION_HOOK_DEF): Define. -@@ -52,6 +59,11 @@ + 2009-01-17 Ulrich Drepper +@@ -56,6 +59,11 @@ * Makefile.am (libeu_a_SOURCES): Add it. * system.h: Declare crc32_file. @@ -595,21 +455,10 @@ * Makefile.am: Use -ffunction-sections for xmalloc.c. --- elfutils/lib/eu-config.h +++ elfutils/lib/eu-config.h -@@ -46,6 +46,9 @@ - Network licensing program, please visit www.openinventionnetwork.com - . */ - -+#ifndef EU_CONFIG_H -+#define EU_CONFIG_H 1 -+ - #ifdef USE_LOCKS - # include - # include -@@ -178,3 +181,17 @@ asm (".section predict_data, \"aw\"; .pr - +@@ -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)) @@ -621,8 +470,8 @@ +} +#endif /* HAVE_BUILTIN_POPCOUNT */ + -+ -+#endif /* eu-config.h */ + + #endif /* eu-config.h */ --- elfutils/lib/Makefile.am +++ elfutils/lib/Makefile.am @@ -25,12 +25,13 @@ @@ -733,19 +582,16 @@ -I$(top_srcdir)/lib --- elfutils/libcpu/ChangeLog +++ elfutils/libcpu/ChangeLog -@@ -1,3 +1,11 @@ -+2009-01-23 Roland McGrath -+ +@@ -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. -+ - 2009-01-01 Ulrich Drepper + * Makefile.am (i386_parse_CFLAGS): Use quotes around command + substitution that can produce leading whitespace. - * i386_parse.y (instrtable_out): Optimize match_data table by not -@@ -324,6 +332,11 @@ +@@ -329,6 +332,11 @@ * defs/i386.doc: New file. * defs/x86_64: New file. @@ -769,14 +615,6 @@ else --- elfutils/libcpu/Makefile.am +++ elfutils/libcpu/Makefile.am -@@ -1,6 +1,6 @@ - ## Process this file with automake to create Makefile.in - ## --## Copyright (C) 2002, 2004, 2005, 2007, 2008 Red Hat, Inc. -+## Copyright (C) 2002, 2004, 2005, 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 @@ -30,7 +30,8 @@ AM_CFLAGS = -fmudflap else AM_CFLAGS = @@ -787,15 +625,6 @@ $($(*F)_CFLAGS) \ $(if $($(*F)_no_Werror),,-Werror) INCLUDES = -I$(srcdir) -I$(srcdir)/../lib -I$(srcdir)/../libelf \ -@@ -70,7 +71,7 @@ libeu = ../lib/libeu.a - - i386_lex_CFLAGS = -Wno-unused-label -Wno-unused-function -Wno-sign-compare - i386_parse.o: i386_parse.c i386.mnemonics --i386_parse_CFLAGS = -DNMNES=$$(wc -l < i386.mnemonics) -+i386_parse_CFLAGS = -DNMNES="`wc -l < i386.mnemonics`" - i386_lex.o: i386_parse.h - i386_gendis_LDADD = $(libeu) -lm $(libmudflap) - --- elfutils/libcpu/Makefile.in +++ elfutils/libcpu/Makefile.in @@ -110,6 +110,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -828,27 +657,9 @@ @MUDFLAP_TRUE@ -std=gnu99 -fpic $($(*F)_CFLAGS) $(if \ @MUDFLAP_TRUE@ $($(*F)_no_Werror),,-Werror) INCLUDES = -I$(srcdir) -I$(srcdir)/../lib -I$(srcdir)/../libelf \ -@@ -215,7 +217,7 @@ i386_gendis_SOURCES = i386_gendis.c i386 - i386_lex_no_Werror = yes - libeu = ../lib/libeu.a - i386_lex_CFLAGS = -Wno-unused-label -Wno-unused-function -Wno-sign-compare --i386_parse_CFLAGS = -DNMNES=$$(wc -l < i386.mnemonics) -+i386_parse_CFLAGS = -DNMNES="`wc -l < i386.mnemonics`" - i386_gendis_LDADD = $(libeu) -lm $(libmudflap) - noinst_HEADERS = memory-access.h i386_parse.h i386_data.h - EXTRA_DIST = defs/i386 --- elfutils/libdw/ChangeLog +++ elfutils/libdw/ChangeLog -@@ -1,3 +1,8 @@ -+2009-01-23 Roland McGrath -+ -+ * Makefile.am ($(srcdir)/known-dwarf.h): Target renamed back. -+ Put these rules under if MAINTAINER_MODE. -+ - 2009-01-22 Roland McGrath - - * dwarf.h: Add DW_OP_GNU_encoded_addr. -@@ -542,6 +547,11 @@ +@@ -562,6 +562,11 @@ 2005-05-31 Roland McGrath @@ -879,23 +690,6 @@ INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib VERSION = 1 -@@ -85,11 +86,13 @@ libdw_a_SOURCES = dwarf_begin.c dwarf_be - libdw_visit_scopes.c \ - dwarf_entry_breakpoints.c - --BUILT_SOURCES = known-dwarf.h --CLEANFILES = known-dwarf.h --known-dwarf.h: $(top_srcdir)/config/known-dwarf.awk $(srcdir)/dwarf.h -+if MAINTAINER_MODE -+BUILT_SOURCES = $(srcdir)/known-dwarf.h -+MAINTAINERCLEANFILES = $(srcdir)/known-dwarf.h -+$(srcdir)/known-dwarf.h: $(top_srcdir)/config/known-dwarf.awk $(srcdir)/dwarf.h - $(AWK) -f $^ > $@.new - mv -f $@.new $@ -+endif - - if !MUDFLAP - libdw_pic_a_SOURCES = --- elfutils/libdw/Makefile.in +++ elfutils/libdw/Makefile.in @@ -165,6 +165,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -927,49 +721,9 @@ INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib COMPILE.os = $(filter-out -fprofile-arcs, $(filter-out -ftest-coverage, \ $(COMPILE))) -@@ -299,8 +302,8 @@ libdw_a_SOURCES = dwarf_begin.c dwarf_be - libdw_visit_scopes.c \ - dwarf_entry_breakpoints.c - --BUILT_SOURCES = known-dwarf.h --CLEANFILES = known-dwarf.h -+@MAINTAINER_MODE_TRUE@BUILT_SOURCES = $(srcdir)/known-dwarf.h -+@MAINTAINER_MODE_TRUE@MAINTAINERCLEANFILES = $(srcdir)/known-dwarf.h - @MUDFLAP_FALSE@libdw_pic_a_SOURCES = - @MUDFLAP_FALSE@am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os) - @MUDFLAP_FALSE@libdw_so_SOURCES = -@@ -635,7 +638,6 @@ mostlyclean-generic: - -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) - - clean-generic: -- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - - distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -@@ -644,6 +646,7 @@ maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) - clean: clean-am - - clean-am: clean-generic clean-libLIBRARIES clean-noinstLIBRARIES \ -@@ -720,9 +723,9 @@ uninstall-am: uninstall-includeHEADERS u - ps ps-am tags uninstall uninstall-am uninstall-includeHEADERS \ - uninstall-libLIBRARIES uninstall-pkgincludeHEADERS - --known-dwarf.h: $(top_srcdir)/config/known-dwarf.awk $(srcdir)/dwarf.h -- $(AWK) -f $^ > $@.new -- mv -f $@.new $@ -+@MAINTAINER_MODE_TRUE@$(srcdir)/known-dwarf.h: $(top_srcdir)/config/known-dwarf.awk $(srcdir)/dwarf.h -+@MAINTAINER_MODE_TRUE@ $(AWK) -f $^ > $@.new -+@MAINTAINER_MODE_TRUE@ mv -f $@.new $@ - @MUDFLAP_FALSE@libdw.so: $(srcdir)/libdw.map libdw_pic.a \ - @MUDFLAP_FALSE@ ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \ - @MUDFLAP_FALSE@ ../libelf/libelf.so --- elfutils/libdwfl/ChangeLog +++ elfutils/libdwfl/ChangeLog -@@ -987,6 +987,11 @@ +@@ -1013,6 +1013,11 @@ 2005-07-21 Roland McGrath @@ -1030,7 +784,7 @@ --- elfutils/libebl/ChangeLog +++ elfutils/libebl/ChangeLog -@@ -558,6 +558,11 @@ +@@ -563,6 +563,11 @@ * Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency tracking works right. @@ -1091,7 +845,7 @@ --- elfutils/libelf/ChangeLog +++ elfutils/libelf/ChangeLog -@@ -515,6 +515,11 @@ +@@ -529,6 +529,11 @@ * elf.h: Update from glibc. @@ -1231,7 +985,7 @@ /* It was symbol+offset. */ --- elfutils/src/ChangeLog +++ elfutils/src/ChangeLog -@@ -12,6 +12,8 @@ +@@ -62,6 +62,8 @@ * readelf.c (print_debug_frame_section): Use t instead of j formats for ptrdiff_t OFFSET. @@ -1240,7 +994,7 @@ 2009-01-21 Ulrich Drepper * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section -@@ -195,6 +197,11 @@ +@@ -245,6 +247,11 @@ that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really is valid in RELRO. @@ -1252,7 +1006,7 @@ 2008-02-29 Roland McGrath * readelf.c (print_attributes): Add a cast. -@@ -446,6 +453,8 @@ +@@ -496,6 +503,8 @@ * readelf.c (hex_dump): Fix rounding error in whitespace calculation. @@ -1261,7 +1015,7 @@ 2007-10-15 Roland McGrath * make-debug-archive.in: New file. -@@ -885,6 +894,10 @@ +@@ -935,6 +944,10 @@ * elflint.c (valid_e_machine): Add EM_ALPHA. Reported by Christian Aichinger . @@ -1272,7 +1026,7 @@ 2006-08-08 Ulrich Drepper * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB. -@@ -961,6 +974,10 @@ +@@ -1011,6 +1024,10 @@ * Makefile.am: Add hacks to create dependency files for non-generic linker. @@ -1283,7 +1037,7 @@ 2006-06-12 Ulrich Drepper * ldgeneric.c (ld_generic_generate_sections): Don't create .interp -@@ -1309,6 +1326,11 @@ +@@ -1359,6 +1376,11 @@ * readelf.c (print_debug_loc_section): Fix indentation for larger address size. @@ -1385,7 +1139,7 @@ size_LDADD = $(libelf) $(libeu) $(libmudflap) --- elfutils/src/readelf.c +++ elfutils/src/readelf.c -@@ -7385,7 +7385,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)) diff --git a/elfutils-robustify.patch b/elfutils-robustify.patch index 3766df5..ec6d76e 100644 --- a/elfutils-robustify.patch +++ b/elfutils-robustify.patch @@ -1,6 +1,6 @@ --- elfutils/libelf/ChangeLog +++ elfutils/libelf/ChangeLog -@@ -507,6 +507,49 @@ +@@ -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. @@ -792,7 +792,7 @@ #endif /* libelfP.h */ --- elfutils/src/ChangeLog +++ elfutils/src/ChangeLog -@@ -1297,6 +1297,16 @@ +@@ -1347,6 +1347,16 @@ object symbols or symbols with unknown type. (check_rel): Likewise. @@ -809,7 +809,7 @@ 2005-06-08 Roland McGrath * readelf.c (print_ops): Add consts. -@@ -1342,6 +1352,19 @@ +@@ -1392,6 +1402,19 @@ * readelf.c (dwarf_tag_string): Add new tags. @@ -841,7 +841,7 @@ int main (int argc, char *argv[]) -@@ -319,10 +322,19 @@ section_name (Ebl *ebl, int idx) +@@ -318,10 +321,19 @@ section_name (Ebl *ebl, int idx) { GElf_Shdr shdr_mem; GElf_Shdr *shdr; @@ -862,7 +862,7 @@ } -@@ -344,10 +356,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])) @@ -873,7 +873,7 @@ static void check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size) { -@@ -612,7 +620,8 @@ section [%2d] '%s': symbol table cannot +@@ -611,7 +619,8 @@ section [%2d] '%s': symbol table cannot } } @@ -883,7 +883,7 @@ ERROR (gettext ("\ section [%2u] '%s': entry size is does not match ElfXX_Sym\n"), idx, section_name (ebl, idx)); -@@ -650,7 +659,7 @@ section [%2d] '%s': XINDEX for zeroth en +@@ -649,7 +658,7 @@ section [%2d] '%s': XINDEX for zeroth en xndxscnidx, section_name (ebl, xndxscnidx)); } @@ -892,7 +892,7 @@ { sym = gelf_getsymshndx (data, xndxdata, cnt, &sym_mem, &xndx); if (sym == NULL) -@@ -670,7 +679,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); @@ -902,7 +902,7 @@ } if (sym->st_shndx == SHN_XINDEX) -@@ -1000,9 +1010,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); @@ -916,7 +916,7 @@ { /* Found the dynamic section. Look through it. */ Elf_Data *d = elf_getdata (scn, NULL); -@@ -1012,7 +1024,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); @@ -927,7 +927,7 @@ if (dyn->d_tag == DT_RELCOUNT) { -@@ -1026,7 +1040,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? */ @@ -938,7 +938,7 @@ ERROR (gettext ("\ section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"), idx, section_name (ebl, idx), -@@ -1186,7 +1202,8 @@ section [%2d] '%s': no relocations for m +@@ -1185,7 +1201,8 @@ section [%2d] '%s': no relocations for m } } @@ -948,7 +948,7 @@ 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"), -@@ -1409,7 +1426,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; @@ -958,7 +958,7 @@ { GElf_Rela rela_mem; GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem); -@@ -1459,7 +1477,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; @@ -968,7 +968,7 @@ { GElf_Rel rel_mem; GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem); -@@ -1562,7 +1581,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)); @@ -978,7 +978,7 @@ ERROR (gettext ("\ section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"), idx, section_name (ebl, idx)); -@@ -1572,7 +1592,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; @@ -987,7 +987,7 @@ { GElf_Dyn dyn_mem; GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dyn_mem); -@@ -1853,6 +1873,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 @@ -996,7 +996,7 @@ && (shdr->sh_size / shdr->sh_entsize < symshdr->sh_size / symshdr->sh_entsize)) ERROR (gettext ("\ -@@ -1879,6 +1901,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); @@ -1009,7 +1009,7 @@ if (*((Elf32_Word *) data->d_buf) != 0) ERROR (gettext ("symbol 0 should have zero extended section index\n")); -@@ -1921,7 +1949,7 @@ section [%2d] '%s': hash table section i +@@ -1920,7 +1948,7 @@ section [%2d] '%s': hash table section i size_t maxidx = nchain; @@ -1018,7 +1018,7 @@ { size_t symsize = symshdr->sh_size / symshdr->sh_entsize; -@@ -1932,18 +1960,28 @@ section [%2d] '%s': hash table section i +@@ -1931,18 +1959,28 @@ section [%2d] '%s': hash table section i maxidx = symsize; } @@ -1049,7 +1049,7 @@ } -@@ -1973,18 +2011,28 @@ section [%2d] '%s': hash table section i +@@ -1972,18 +2010,28 @@ section [%2d] '%s': hash table section i maxidx = symsize; } @@ -1081,7 +1081,7 @@ } -@@ -2009,7 +2057,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 ("\ @@ -1090,7 +1090,7 @@ idx, section_name (ebl, idx), (long int) shdr->sh_size, (long int) ((4 + bitmask_words + nbuckets) * sizeof (Elf32_Word))); return; -@@ -2681,8 +2729,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. */ @@ -1104,7 +1104,7 @@ idx, section_name (ebl, idx), --- elfutils/src/readelf.c +++ elfutils/src/readelf.c -@@ -1130,6 +1130,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G +@@ -1136,6 +1136,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G Elf32_Word *grpref = (Elf32_Word *) data->d_buf; GElf_Sym sym_mem; @@ -1113,7 +1113,7 @@ printf ((grpref[0] & GRP_COMDAT) ? ngettext ("\ \nCOMDAT section group [%2zu] '%s' with signature '%s' contains %zu entry:\n", -@@ -1142,8 +1144,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), @@ -1124,7 +1124,7 @@ ?: gettext (""), data->d_size / sizeof (Elf32_Word) - 1); -@@ -1294,7 +1296,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); @@ -1134,7 +1134,7 @@ Elf_Data *data; size_t cnt; size_t shstrndx; -@@ -1309,6 +1312,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")); @@ -1146,7 +1146,7 @@ printf (ngettext ("\ \nDynamic segment contains %lu entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n", "\ -@@ -1318,9 +1326,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, @@ -1157,7 +1157,7 @@ fputs_unlocked (gettext (" Type Value\n"), stdout); for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt) -@@ -1820,6 +1826,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")); @@ -1171,7 +1171,7 @@ /* Now we can compute the number of entries in the section. */ unsigned int nsyms = data->d_size / (class == ELFCLASS32 ? sizeof (Elf32_Sym) -@@ -1830,15 +1843,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); @@ -1188,7 +1188,7 @@ fputs_unlocked (class == ELFCLASS32 ? gettext ("\ -@@ -2074,7 +2084,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")); @@ -1203,7 +1203,7 @@ printf (ngettext ("\ \nVersion needs section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n", "\ -@@ -2085,9 +2101,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, @@ -1214,7 +1214,7 @@ unsigned int offset = 0; for (int cnt = shdr->sh_info; --cnt >= 0; ) -@@ -2140,8 +2154,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")); @@ -1230,7 +1230,7 @@ printf (ngettext ("\ \nVersion definition section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n", "\ -@@ -2153,9 +2173,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, @@ -1241,7 +1241,7 @@ unsigned int offset = 0; for (int cnt = shdr->sh_info; --cnt >= 0; ) -@@ -2417,8 +2435,14 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G +@@ -2423,8 +2441,14 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G filename = NULL; } @@ -1257,7 +1257,7 @@ printf (ngettext ("\ \nVersion symbols section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'", "\ -@@ -2430,9 +2454,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, @@ -1268,7 +1268,7 @@ /* 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) -@@ -2484,7 +2506,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]]; @@ -1287,7 +1287,7 @@ 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", "\ -@@ -2497,9 +2529,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, @@ -1298,7 +1298,7 @@ if (extrastr != NULL) fputs (extrastr, stdout); -@@ -4058,6 +4088,16 @@ print_debug_aranges_section (Dwfl_Module +@@ -4104,6 +4134,16 @@ print_debug_aranges_section (Dwfl_Module return; } diff --git a/elfutils.spec b/elfutils.spec index 6de87eb..04f0d9b 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,4 +1,4 @@ -%define eu_version 0.139 +%define eu_version 0.140 %define eu_release 1 %if %{?_with_compat:1}%{!?_with_compat:0} @@ -194,9 +194,9 @@ chmod +x ${RPM_BUILD_ROOT}%{_prefix}/%{_lib}/lib*.so* chmod +x ${RPM_BUILD_ROOT}%{_prefix}/%{_lib}/elfutils/lib*.so* # XXX Nuke unpackaged files -{ cd ${RPM_BUILD_ROOT} - rm -f .%{_bindir}/eu-ld -} +(cd ${RPM_BUILD_ROOT} + rm -f .%{_bindir}/eu-ld +) %check make -s check @@ -276,6 +276,10 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/libelf.a %changelog +* Sun Feb 15 2009 Roland McGrath - 0.140-1 +- Update to 0.140 + - libelf: Fix regression in creation of section header. (#484946) + * Fri Jan 23 2009 Roland McGrath - 0.139-1 - Update to 0.139 - libcpu: Add Intel SSE4 disassembler support diff --git a/sources b/sources index 8dfff15..3d851fa 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9cfc12ac0d6d14968e253639fa957946 elfutils-0.139.tar.bz2 +d4d64f9c05ba127a5a8b55beb6d88ab2 elfutils-0.140.tar.bz2 From 554ad6c28b8d45fca1da9425423361c20a866547 Mon Sep 17 00:00:00 2001 From: roland Date: Fri, 24 Apr 2009 20:52:24 +0000 Subject: [PATCH 10/13] Update to 0.141 --- .cvsignore | 2 +- elfutils-portability.patch | 105 +++++++++++++++++-------------------- elfutils-robustify.patch | 28 +++++----- elfutils.spec | 21 ++++++-- sources | 2 +- 5 files changed, 82 insertions(+), 76 deletions(-) diff --git a/.cvsignore b/.cvsignore index 9627477..264d3c0 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -elfutils-0.140.tar.bz2 +elfutils-0.141.tar.bz2 diff --git a/elfutils-portability.patch b/elfutils-portability.patch index 4c3a131..79dc4fa 100644 --- a/elfutils-portability.patch +++ b/elfutils-portability.patch @@ -1,6 +1,6 @@ --- elfutils/backends/ChangeLog +++ elfutils/backends/ChangeLog -@@ -3,6 +3,10 @@ +@@ -33,6 +33,10 @@ * ppc_attrs.c (ppc_check_object_attribute): Handle tag GNU_Power_ABI_Struct_Return. @@ -11,7 +11,7 @@ 2008-10-04 Ulrich Drepper * i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and -@@ -330,6 +334,11 @@ +@@ -360,6 +364,11 @@ * sparc_init.c: Likewise. * x86_64_init.c: Likewise. @@ -23,7 +23,7 @@ 2005-11-19 Roland McGrath * ppc64_reloc.def: REL30 -> ADDR30. -@@ -352,6 +361,9 @@ +@@ -382,6 +391,9 @@ * Makefile.am (uninstall): Don't try to remove $(pkgincludedir). (CLEANFILES): Add libebl_$(m).so. @@ -35,14 +35,6 @@ --- 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 @@ ## . ## @@ -67,7 +59,7 @@ 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 +@@ -115,7 +116,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,$^) \ @@ -78,7 +70,7 @@ # XXX Should not be needed... --- elfutils/backends/Makefile.in +++ elfutils/backends/Makefile.in -@@ -156,6 +156,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -158,6 +158,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -86,7 +78,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -185,6 +186,7 @@ SHELL = @SHELL@ +@@ -187,6 +188,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -94,7 +86,7 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -243,9 +245,9 @@ top_builddir = @top_builddir@ +@@ -245,9 +247,9 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ zip_LIBS = @zip_LIBS@ @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \ @@ -106,7 +98,7 @@ 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 +@@ -650,7 +652,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,$^) \ @@ -117,7 +109,8 @@ # XXX Should not be needed... --- elfutils/ChangeLog +++ elfutils/ChangeLog -@@ -1,5 +1,7 @@ +@@ -9,6 +9,8 @@ + 2009-01-23 Roland McGrath + * configure.ac: Check for __builtin_popcount. @@ -125,7 +118,7 @@ * 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 @@ +@@ -89,6 +91,10 @@ * configure.ac: Add dummy automake conditional to get dependencies for non-generic linker right. See src/Makefile.am. @@ -136,7 +129,7 @@ 2005-11-18 Roland McGrath * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable. -@@ -127,6 +133,17 @@ +@@ -136,6 +142,17 @@ * Makefile.am (all_SUBDIRS): Add libdwfl. * configure.ac: Write libdwfl/Makefile. @@ -582,7 +575,8 @@ -I$(top_srcdir)/lib --- elfutils/libcpu/ChangeLog +++ elfutils/libcpu/ChangeLog -@@ -1,5 +1,8 @@ +@@ -5,6 +5,9 @@ + 2009-01-23 Roland McGrath + * i386_disasm.c (i386_disasm): Add abort after assert-constant for old @@ -591,7 +585,7 @@ * Makefile.am (i386_parse_CFLAGS): Use quotes around command substitution that can produce leading whitespace. -@@ -329,6 +332,11 @@ +@@ -334,6 +337,11 @@ * defs/i386.doc: New file. * defs/x86_64: New file. @@ -622,9 +616,9 @@ -AM_CFLAGS += -Wall -Wshadow -Wunused -Wextra -std=gnu99 -fpic \ +WEXTRA = @WEXTRA@ +AM_CFLAGS += -Wall -Wshadow -Wunused $(WEXTRA) -std=gnu99 -fpic \ + -fdollars-in-identifiers \ $($(*F)_CFLAGS) \ $(if $($(*F)_no_Werror),,-Werror) - INCLUDES = -I$(srcdir) -I$(srcdir)/../lib -I$(srcdir)/../libelf \ --- elfutils/libcpu/Makefile.in +++ elfutils/libcpu/Makefile.in @@ -110,6 +110,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -643,23 +637,25 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -196,10 +198,10 @@ top_build_prefix = @top_build_prefix@ +@@ -196,10 +198,11 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ zip_LIBS = @zip_LIBS@ -@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Wunused -Wextra -std=gnu99 \ --@MUDFLAP_FALSE@ -fpic $($(*F)_CFLAGS) $(if \ -+@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Wunused $(WEXTRA) \ -+@MUDFLAP_FALSE@ -std=gnu99 -fpic $($(*F)_CFLAGS) $(if \ - @MUDFLAP_FALSE@ $($(*F)_no_Werror),,-Werror) +-@MUDFLAP_FALSE@ -fpic -fdollars-in-identifiers $($(*F)_CFLAGS) \ +-@MUDFLAP_FALSE@ $(if $($(*F)_no_Werror),,-Werror) -@MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Wshadow -Wunused -Wextra \ ++@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Wunused $(WEXTRA) \ ++@MUDFLAP_FALSE@ -std=gnu99 -fpic -fdollars-in-identifiers \ ++@MUDFLAP_FALSE@ $($(*F)_CFLAGS) $(if \ ++@MUDFLAP_FALSE@ $($(*F)_no_Werror),,-Werror) +@MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Wshadow -Wunused $(WEXTRA) \ - @MUDFLAP_TRUE@ -std=gnu99 -fpic $($(*F)_CFLAGS) $(if \ + @MUDFLAP_TRUE@ -std=gnu99 -fpic -fdollars-in-identifiers \ + @MUDFLAP_TRUE@ $($(*F)_CFLAGS) $(if \ @MUDFLAP_TRUE@ $($(*F)_no_Werror),,-Werror) - INCLUDES = -I$(srcdir) -I$(srcdir)/../lib -I$(srcdir)/../libelf \ --- elfutils/libdw/ChangeLog +++ elfutils/libdw/ChangeLog -@@ -562,6 +562,11 @@ +@@ -571,6 +571,11 @@ 2005-05-31 Roland McGrath @@ -723,7 +719,7 @@ $(COMPILE))) --- elfutils/libdwfl/ChangeLog +++ elfutils/libdwfl/ChangeLog -@@ -1013,6 +1013,11 @@ +@@ -1076,6 +1076,11 @@ 2005-07-21 Roland McGrath @@ -754,7 +750,7 @@ VERSION = 1 --- elfutils/libdwfl/Makefile.in +++ elfutils/libdwfl/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@ @@ -762,7 +758,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 = 1 @@ -770,7 +766,7 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -242,9 +244,9 @@ top_builddir = @top_builddir@ +@@ -243,9 +245,9 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ zip_LIBS = @zip_LIBS@ @MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wshadow -Wunused -Wformat=2 \ @@ -784,7 +780,7 @@ --- elfutils/libebl/ChangeLog +++ elfutils/libebl/ChangeLog -@@ -563,6 +563,11 @@ +@@ -569,6 +569,11 @@ * Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency tracking works right. @@ -845,7 +841,7 @@ --- elfutils/libelf/ChangeLog +++ elfutils/libelf/ChangeLog -@@ -529,6 +529,11 @@ +@@ -537,6 +537,11 @@ * elf.h: Update from glibc. @@ -965,19 +961,14 @@ YACC = @YACC@ --- elfutils/src/addr2line.c +++ elfutils/src/addr2line.c -@@ -376,7 +376,7 @@ handle_address (const char *string, Dwfl +@@ -447,10 +447,10 @@ handle_address (const char *string, Dwfl bool parsed = false; int n; char *name = NULL; - if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &n) == 2 + if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &n) == 2 && string[n] == '\0') - { - /* It was (section)+offset. This makes sense if there is -@@ -417,7 +417,7 @@ handle_address (const char *string, Dwfl - } - } - } + parsed = adjust_to_section (name, &addr, dwfl); - else if (sscanf (string, "%m[^-+]%" PRIiMAX "%n", &name, &addr, &n) == 2 + else if (sscanf (string, "%a[^-+]%" PRIiMAX "%n", &name, &addr, &n) == 2 && string[n] == '\0') @@ -985,7 +976,7 @@ /* It was symbol+offset. */ --- elfutils/src/ChangeLog +++ elfutils/src/ChangeLog -@@ -62,6 +62,8 @@ +@@ -91,6 +91,8 @@ * readelf.c (print_debug_frame_section): Use t instead of j formats for ptrdiff_t OFFSET. @@ -994,7 +985,7 @@ 2009-01-21 Ulrich Drepper * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section -@@ -245,6 +247,11 @@ +@@ -274,6 +276,11 @@ that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really is valid in RELRO. @@ -1006,7 +997,7 @@ 2008-02-29 Roland McGrath * readelf.c (print_attributes): Add a cast. -@@ -496,6 +503,8 @@ +@@ -525,6 +532,8 @@ * readelf.c (hex_dump): Fix rounding error in whitespace calculation. @@ -1015,7 +1006,7 @@ 2007-10-15 Roland McGrath * make-debug-archive.in: New file. -@@ -935,6 +944,10 @@ +@@ -964,6 +973,10 @@ * elflint.c (valid_e_machine): Add EM_ALPHA. Reported by Christian Aichinger . @@ -1026,7 +1017,7 @@ 2006-08-08 Ulrich Drepper * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB. -@@ -1011,6 +1024,10 @@ +@@ -1040,6 +1053,10 @@ * Makefile.am: Add hacks to create dependency files for non-generic linker. @@ -1037,7 +1028,7 @@ 2006-06-12 Ulrich Drepper * ldgeneric.c (ld_generic_generate_sections): Don't create .interp -@@ -1359,6 +1376,11 @@ +@@ -1388,6 +1405,11 @@ * readelf.c (print_debug_loc_section): Fix indentation for larger address size. @@ -1139,7 +1130,7 @@ size_LDADD = $(libelf) $(libeu) $(libmudflap) --- elfutils/src/readelf.c +++ elfutils/src/readelf.c -@@ -7436,7 +7436,7 @@ dump_archive_index (Elf *elf, const char +@@ -7443,7 +7443,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)) @@ -1209,7 +1200,7 @@ } /* Open the file. */ -@@ -1745,7 +1761,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -1746,7 +1762,7 @@ handle_elf (int fd, Elf *elf, const char /* If requested, preserve the timestamp. */ if (tvp != NULL) { @@ -1218,7 +1209,7 @@ { error (0, errno, gettext ("\ cannot set access and modification date of '%s'"), -@@ -1802,7 +1818,7 @@ handle_ar (int fd, Elf *elf, const char +@@ -1803,7 +1819,7 @@ handle_ar (int fd, Elf *elf, const char if (tvp != NULL) { @@ -1229,7 +1220,7 @@ cannot set access and modification date of '%s'"), fname); --- elfutils/tests/ChangeLog +++ elfutils/tests/ChangeLog -@@ -95,6 +95,8 @@ +@@ -106,6 +106,8 @@ 2008-01-21 Roland McGrath @@ -1238,7 +1229,7 @@ * testfile45.S.bz2: Add tests for cltq, cqto. * testfile45.expect.bz2: Adjust. -@@ -803,6 +805,11 @@ +@@ -814,6 +816,11 @@ * Makefile.am (TESTS): Add run-elflint-test.sh. (EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2. @@ -1281,7 +1272,7 @@ endif --- elfutils/tests/Makefile.in +++ elfutils/tests/Makefile.in -@@ -342,6 +342,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -343,6 +343,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -1289,7 +1280,7 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -371,6 +372,7 @@ SHELL = @SHELL@ +@@ -372,6 +373,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -1297,7 +1288,7 @@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ YACC = @YACC@ -@@ -428,10 +430,10 @@ top_build_prefix = @top_build_prefix@ +@@ -429,10 +431,10 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ zip_LIBS = @zip_LIBS@ diff --git a/elfutils-robustify.patch b/elfutils-robustify.patch index ec6d76e..c238f52 100644 --- a/elfutils-robustify.patch +++ b/elfutils-robustify.patch @@ -1,6 +1,6 @@ --- elfutils/libelf/ChangeLog +++ elfutils/libelf/ChangeLog -@@ -521,6 +521,49 @@ +@@ -529,6 +529,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. @@ -792,7 +792,7 @@ #endif /* libelfP.h */ --- elfutils/src/ChangeLog +++ elfutils/src/ChangeLog -@@ -1347,6 +1347,16 @@ +@@ -1376,6 +1376,16 @@ object symbols or symbols with unknown type. (check_rel): Likewise. @@ -809,7 +809,7 @@ 2005-06-08 Roland McGrath * readelf.c (print_ops): Add consts. -@@ -1392,6 +1402,19 @@ +@@ -1421,6 +1431,19 @@ * readelf.c (dwarf_tag_string): Add new tags. @@ -1298,7 +1298,7 @@ if (extrastr != NULL) fputs (extrastr, stdout); -@@ -4104,6 +4134,16 @@ print_debug_aranges_section (Dwfl_Module +@@ -4107,6 +4137,16 @@ print_debug_aranges_section (Dwfl_Module return; } @@ -1451,7 +1451,7 @@ /* Mark the section as investigated. */ shdr_info[cnt].idx = 2; -@@ -954,7 +978,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -955,7 +979,7 @@ handle_elf (int fd, Elf *elf, const char error (EXIT_FAILURE, 0, gettext ("while generating output file: %s"), elf_errmsg (-1)); @@ -1460,7 +1460,7 @@ /* Add this name to the section header string table. */ shdr_info[cnt].se = ebl_strtabadd (shst, shdr_info[cnt].name, 0); -@@ -991,7 +1015,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -992,7 +1016,7 @@ handle_elf (int fd, Elf *elf, const char error (EXIT_FAILURE, 0, gettext ("while create section header section: %s"), elf_errmsg (-1)); @@ -1469,7 +1469,7 @@ shdr_info[cnt].data = elf_newdata (shdr_info[cnt].newscn); if (shdr_info[cnt].data == NULL) -@@ -1047,7 +1071,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -1048,7 +1072,7 @@ handle_elf (int fd, Elf *elf, const char error (EXIT_FAILURE, 0, gettext ("while create section header section: %s"), elf_errmsg (-1)); @@ -1478,7 +1478,7 @@ /* Finalize the string table and fill in the correct indices in the section headers. */ -@@ -1137,20 +1161,20 @@ handle_elf (int fd, Elf *elf, const char +@@ -1138,20 +1162,20 @@ handle_elf (int fd, Elf *elf, const char shndxdata = elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn, NULL); @@ -1502,7 +1502,7 @@ >= shdr_info[cnt].data->d_size / elsize); } -@@ -1205,7 +1229,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -1206,7 +1230,7 @@ handle_elf (int fd, Elf *elf, const char sec = shdr_info[sym->st_shndx].idx; else { @@ -1511,7 +1511,7 @@ sec = shdr_info[xshndx].idx; } -@@ -1226,7 +1250,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -1227,7 +1251,7 @@ handle_elf (int fd, Elf *elf, const char nxshndx = sec; } @@ -1520,7 +1520,7 @@ if ((inner != destidx || nshndx != sym->st_shndx || (shndxdata != NULL && nxshndx != xshndx)) -@@ -1250,7 +1274,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -1251,7 +1275,7 @@ handle_elf (int fd, Elf *elf, const char || shdr_info[cnt].debug_data == NULL) /* This is a section symbol for a section which has been removed. */ @@ -1529,7 +1529,7 @@ } if (destidx != inner) -@@ -1437,11 +1461,11 @@ handle_elf (int fd, Elf *elf, const char +@@ -1438,11 +1462,11 @@ handle_elf (int fd, Elf *elf, const char { GElf_Sym sym_mem; GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem); @@ -1543,7 +1543,7 @@ size_t hidx = elf_hash (name) % nbucket; if (bucket[hidx] == 0) -@@ -1460,7 +1484,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -1461,7 +1485,7 @@ handle_elf (int fd, Elf *elf, const char else { /* Alpha and S390 64-bit use 64-bit SHT_HASH entries. */ @@ -1552,7 +1552,7 @@ == sizeof (Elf64_Xword)); Elf64_Xword *bucket = (Elf64_Xword *) hashd->d_buf; -@@ -1491,11 +1515,11 @@ handle_elf (int fd, Elf *elf, const char +@@ -1492,11 +1516,11 @@ handle_elf (int fd, Elf *elf, const char { GElf_Sym sym_mem; GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem); diff --git a/elfutils.spec b/elfutils.spec index 04f0d9b..7b51df8 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,4 +1,4 @@ -%define eu_version 0.140 +%define eu_version 0.141 %define eu_release 1 %if %{?_with_compat:1}%{!?_with_compat:0} @@ -27,7 +27,7 @@ Version: %{eu_version} %if !%{compat} Release: %{eu_release}%{?dist} %else -Release: 0.%{eu_release} +Release: 0.%{eu_release}.1 %endif License: GPLv2 with exceptions Group: Development/Tools @@ -276,6 +276,21 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/libelf.a %changelog +* Thu Apr 23 2009 Roland McGrath - 0.141-1 +- Update to 0.141 + - libebl: sparc backend fixes (#490585) + some more arm backend support + - libdwfl: fix dwfl_module_build_id for prelinked DSO case (#489439) + fixes in core file support (#494858) + dwfl_module_getsym interface improved for non-address symbols + - eu-strip: fix infinite loop on strange inputs with -f + - eu-addr2line: take -j/--section=NAME option for binutils compatibility + (same effect as '(NAME)0x123' syntax already supported) +- Resolves: RHBZ #495213, RHBZ #465872, RHBZ #470055, RHBZ #484623 + +* Tue Feb 24 2009 Fedora Release Engineering - 0.140-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + * Sun Feb 15 2009 Roland McGrath - 0.140-1 - Update to 0.140 - libelf: Fix regression in creation of section header. (#484946) @@ -284,7 +299,7 @@ rm -rf ${RPM_BUILD_ROOT} - 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. + 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. (#472136) diff --git a/sources b/sources index 3d851fa..7e662e2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d4d64f9c05ba127a5a8b55beb6d88ab2 elfutils-0.140.tar.bz2 +2d0fe5651c0de1fd28e7dd006effe7d1 elfutils-0.141.tar.bz2 From 9e2904bce6b5f711efe85a610375fc5f94b6f85c Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 26 Nov 2009 01:22:58 +0000 Subject: [PATCH 11/13] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8d35a02..8ba0592 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ UPSTREAM_FILES = $(NAME)-$(VERSION).tar.bz2 upstream:; define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From 096a52edea0c586cd7d62ca46a0da8624a93e0b8 Mon Sep 17 00:00:00 2001 From: roland Date: Tue, 4 May 2010 01:56:32 +0000 Subject: [PATCH 12/13] Removed unused Makefile cruft of yore. --- README.elfutils | 76 ----------------------------------------- systemtap-elfutils.repo | 5 --- 2 files changed, 81 deletions(-) delete mode 100644 README.elfutils delete mode 100644 systemtap-elfutils.repo diff --git a/README.elfutils b/README.elfutils deleted file mode 100644 index 730d93a..0000000 --- a/README.elfutils +++ /dev/null @@ -1,76 +0,0 @@ -THIS IS HERE ONLY TO SUPPORT SYSTEMTAP DEVELOPMENT. IT IS NOT FOR GENERAL USE. - -Building systemtap requires a recent development version of elfutils, -which provides libraries for making use of debugging information. - -This is unfinished work in active development. This code is not intended -for general consumption in its present form. Development of these -libraries is simultaneous with Systemtap development. The Systemtap code -will require new versions as things evolve; the systemtap.spec.in file in -the systemtap source tree should always indicate the minimum version of -elfutils libraries that will suffice. We will make an effort to make a -compatible version available here, that you can use for compiling Systemtap. - -Current elfutils can always be found in Fedora Core Development, AKA Rawhide. -If you are interested in the elfutils code in general or for any purpose -other than developing Systemtap, please see http://fedora.redhat.com/ about -getting involved with Fedora Core Development directly. - -To use the elfutils libraries to build Systemtap, you can either use -installed libraries, or you can build elfutils from source as part of the -systemtap build. To use installed libraries, you'll need to have the -current elfutils version installed on your system where the compiler will -find it with whatever build flags you pass systemtap's configure script. -Unless your system already has the current elfutils installed -(i.e. Rawhide), you'll have to install a nonstandard build either via RPM -or by hand with "make" as detailed below. To build the elfutils source -locally as part of the systemtap build, see systemtap's README about the ---with-elfutils=... option to systemtap's configure. - -You can find the rawhide rpms updated daily on a variety of sites -(see http://fedora.redhat.com/download/mirrors.html) under core/development. -What's distributed in this directory is made trivially from those same sources. - -The vanilla elfutils code, in elfutils-VERSION.tar.gz and what the rawhide -RPMs ordinarily build, can only be built using GCC 4 and a recent glibc. -Fedora Core 4 is the only released system meeting the requirements. - -To rebuild the rawhide src.rpm on an older system, you can use: - - rpmbuild --with compat --rebuild elfutils-VERSION-N.src.rpm - -The SRPMS/elfutils-VERSION-0.N.src.rpm provided here is exactly the same as -the elfutils-VERSION-N.src.rpm from Rawhide except that it doesn't require -that you specify --with compat to build on an older system. - -We have done this for you for a few architectures, and those RPMs are -available here. These were built on RHEL3, and so their requirements -should not be too demanding. We must remind you that this is unsupported, -pre-beta development code. Furthermore, these builds are completely -unofficial, unsupported, unsigned, unlikely to have been tested, -unequivocally not guaranteed not to ruin your whole day, and we really -cannot recommend that anyone install them on their system. Do so at your -own risk. All that said, here they is, and if you copy this file: - - ftp://sources.redhat.com/pub/systemtap/elfutils/systemtap-elfutils.repo - -into your /etc/yum.repos.d/ directory, then you can get them all with just: - - yum install elfutils-devel - - -To compile elfutils from source by hand, simply use elfutils-VERSION.tar.gz -and follow the usual procedure for GNU configure conventions. The patch -available here has to be applied before you can compile on an older system: - - tar xzf elfutils-VERSION.tar.gz - patch -p1 -d elfutils-VERSION < elfutils-portability.patch - cd elfutils-VERSION - ./configure --program-prefix=eu-devel- - make && make check && make install - -(That of course installs things under /usr/local, unlike the RPMs.) - - -Caveat emptor. Carpe noctem. -Reply to . diff --git a/systemtap-elfutils.repo b/systemtap-elfutils.repo deleted file mode 100644 index 96d326b..0000000 --- a/systemtap-elfutils.repo +++ /dev/null @@ -1,5 +0,0 @@ -[systemtap-elfutils] -name=FOR SYSTEMTAP DEVELOPMENT ONLY -baseurl=ftp://sources.redhat.com/pub/systemtap/elfutils/ -enabled=1 -gpgcheck=0 From 9b9d6f1d2f508bc2ebe997aede3820f96f8e8bb4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 28 Jul 2010 13:41:21 +0000 Subject: [PATCH 13/13] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 98 ---------------------------------------- branch | 1 - 3 files changed, 99 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index 8ba0592..0000000 --- a/Makefile +++ /dev/null @@ -1,98 +0,0 @@ -# Makefile for source rpm: elfutils -# $Id$ -NAME := elfutils -SPECFILE = elfutils.spec - -all: - -UPSTREAM_CHECKS := sig -UPSTREAM_FILES = $(NAME)-$(VERSION).tar.bz2 -upstream:; - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) - -ifneq (,$(CURL)) -CURL += -k -endif - -patches := $(patsubst %,elfutils-%.patch,robustify portability) -all: $(patches) - -branch-portability = portable -branch-master = elfutils-$(VERSION) - -elfutils-%/configure: .git/refs/heads/* Makefile - @rm -rf $(@D) - git archive --prefix=$(@D)/ $(firstword $(branch-$*) $*) | tar xf - - cd $(@D) && autoreconf -i && rm -rf autom4te.cache - -elfutils-%.patch: elfutils-master/configure elfutils-%/configure - diff --exclude='.gitignore' -Nrpu $(^D) | \ - filterdiff --remove-timestamps --strip=1 --addprefix=elfutils/ > $@.new - mv $@.new $@ - -elfutils-portable.spec: elfutils.spec - (echo '%define _with_compat 1'; sed 's/ check$$/& || :/' $<) > $@.new - mv -f $@.new $@ - -portable-r = 0.$(subst $(DIST),,$(RELEASE)) -portable-vr = $(VERSION)-$(portable-r) -portable.srpm = elfutils-$(portable-vr).src.rpm -$(portable.srpm): elfutils-portable.spec $(patches) \ - elfutils-$(VERSION).tar.bz2 - $(RPM_WITH_DIRS) --nodeps -bs $< - -portable-srpm: $(portable.srpm) - -portable-dist = 3.0E-scratch -portable-build = \ - $(redhat)/brewroot/packages/elfutils/$(VERSION)/$(portable-r) - -ifeq (,$(wildcard /mnt/redhat/brewroot/packages/elfutils)) -redhat = datadump.devel.redhat.com::redhat -rsync-to = devserv.devel.redhat.com:dist/elfutils/devel/systemtap-dist/ -build-dep = $(portable.srpm) -else -redhat = /mnt/redhat -$(portable-build): $(portable.srpm) - brew build $(BUILD_FLAGS) dist-$(portable-dist) $< -rsync-to = $(public) -build-dep = $(portable-build)/src/$(portable.srpm) -portable-build: $(portable-build) -$(build-dep): $(portable-build) -endif - -dist-files = README.elfutils systemtap-elfutils.repo -rsync-files = --exclude=tests --exclude=data $(portable-build)/ -public = sources.redhat.com:/sourceware/ftp/anonftp/pub/systemtap/elfutils/ - -RSYNC = RSYNC_RSH=ssh rsync - -systemtap-dist: $(build-dep) $(dist-files) - @mkdir -p $@ - $(RSYNC) -a --delete --progress -v $(rsync-files) systemtap-dist/ - ln $(dist-files) systemtap-dist/ - ln -v `rpm -qlp $<` systemtap-dist/ - -systemtap-dist-createrepo: systemtap-dist -ifneq ($(wildcard /usr/bin/createrepo),) - createrepo -q `cd $<; /bin/pwd` -endif - -systemtap-sync: systemtap-dist-createrepo - $(RSYNC) -az --delete --progress -v systemtap-dist/ $(rsync-to) diff --git a/branch b/branch deleted file mode 100644 index 1c26f78..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -F-9