From 86b493d370fb878c106f923821bacfae4911fcad Mon Sep 17 00:00:00 2001 From: James Antill Date: Mon, 27 Feb 2023 13:12:05 -0500 Subject: [PATCH] Import rpm: c8s --- .gitignore | 2 + elfutils-0.176-dts.patch | 1536 ++++++++++++++++++ elfutils-0.176-elf-update.patch | 664 ++++++++ elfutils-0.176-gcc-pr88835.patch | 28 + elfutils-0.176-strip-symbols-illformed.patch | 26 + elfutils-0.176-xlate-note.patch | 486 ++++++ elfutils-dts-libs-version.patch | 78 + elfutils.spec | 1347 +++++++++++++++ libasm.a | 5 + libasm.so | 5 + libdw.a | 7 + libdw.so | 7 + libelf.a | 7 + libelf.so | 6 + sources | 1 + 15 files changed, 4205 insertions(+) create mode 100644 .gitignore create mode 100644 elfutils-0.176-dts.patch create mode 100644 elfutils-0.176-elf-update.patch create mode 100644 elfutils-0.176-gcc-pr88835.patch create mode 100644 elfutils-0.176-strip-symbols-illformed.patch create mode 100644 elfutils-0.176-xlate-note.patch create mode 100644 elfutils-dts-libs-version.patch create mode 100644 elfutils.spec create mode 100644 libasm.a create mode 100644 libasm.so create mode 100644 libdw.a create mode 100644 libdw.so create mode 100644 libelf.a create mode 100644 libelf.so create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9d89fc3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/elfutils-0.176.tar.bz2 +/elfutils-0.176.tar.bz2 diff --git a/elfutils-0.176-dts.patch b/elfutils-0.176-dts.patch new file mode 100644 index 0000000..4f1fc0d --- /dev/null +++ b/elfutils-0.176-dts.patch @@ -0,0 +1,1536 @@ +diff --git a/backends/Makefile.am b/backends/Makefile.am +index 2126a2e..3a4e56e 100644 +--- a/backends/Makefile.am ++++ b/backends/Makefile.am +@@ -41,12 +41,38 @@ libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \ + libebl_m68k_pic.a libebl_bpf_pic.a libebl_riscv_pic.a + noinst_LIBRARIES = $(libebl_pic) + noinst_DATA = $(libebl_pic:_pic.a=.so) ++lib_LIBRARIES = libebl_static_pic.a + + + libelf = ../libelf/libelf.so + libdw = ../libdw/libdw.so + libeu = ../lib/libeu.a + ++# The following is minimal set of backends that we link with libdw to ++# avoid dlopen. Note repeats files below because some backends reuse ++# each others files. ++static_SRCS = i386_init.c i386_symbol.c i386_corenote.c i386_cfi.c \ ++ i386_retval.c i386_regs.c i386_auxv.c i386_syscall.c \ ++ i386_initreg.c i386_unwind.c \ ++ x86_64_init.c x86_64_symbol.c x86_64_corenote.c x86_64_cfi.c \ ++ x86_64_retval.c x86_64_regs.c x86_64_syscall.c \ ++ x86_64_initreg.c x86_64_unwind.c x32_corenote.c \ ++ ia64_init.c ia64_symbol.c ia64_regs.c ia64_retval.c \ ++ aarch64_init.c aarch64_regs.c aarch64_symbol.c \ ++ aarch64_corenote.c aarch64_retval.c aarch64_cfi.c \ ++ aarch64_initreg.c aarch64_unwind.c \ ++ ppc_init.c ppc_symbol.c ppc_retval.c ppc_regs.c \ ++ ppc_corenote.c ppc_auxv.c ppc_attrs.c ppc_syscall.c \ ++ ppc_cfi.c ppc_initreg.c \ ++ ppc64_init.c ppc64_symbol.c ppc64_retval.c ppc64_corenote.c \ ++ ppc64_resolve_sym.c ppc64_unwind.c \ ++ s390_init.c s390_symbol.c s390_regs.c s390_retval.c \ ++ s390_corenote.c s390x_corenote.c s390_cfi.c s390_initreg.c \ ++ s390_unwind.c bpf_init.c bpf_regs.c bpf_symbol.c ++ ++libebl_static_pic_a_SOURCES = $(static_SRCS) ++am_libebl_static_pic_a_OBJECTS = $(static_SRCS:.c=.os) ++ + i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c i386_cfi.c \ + i386_retval.c i386_regs.c i386_auxv.c i386_syscall.c \ + i386_initreg.c i386_unwind.c +diff --git a/configure.ac b/configure.ac +index b4e012d..54ad07a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -25,6 +25,12 @@ m4_ifndef([AC_PACKAGE_URL], + [Define to home page for this package]) + AC_SUBST([PACKAGE_URL], ["http://elfutils.org/"])]) + ++dnl Workaround for older autoconf < 2.64 ++m4_ifndef([AC_PACKAGE_URL], ++ [AC_DEFINE([PACKAGE_URL], ["http://elfutils.org/"], ++ [Define to home page for this package]) ++ AC_SUBST([PACKAGE_URL], ["http://elfutils.org/"])]) ++ + # We want eu- as default program prefix if none was given by the user. + # But if the user explicitly provided --program-prefix="" then pretend + # it wasn't set at all (NONE). We want to test this really early before +diff --git a/libasm/Makefile.am b/libasm/Makefile.am +index 19fef50..fcc7ffc 100644 +--- a/libasm/Makefile.am ++++ b/libasm/Makefile.am +@@ -38,6 +38,7 @@ noinst_LIBRARIES = libasm_pic.a + noinst_PROGRAMS = $(noinst_LIBRARIES:_pic.a=.so) + pkginclude_HEADERS = libasm.h + ++libasm_a_CFLAGS = -fPIC -fvisibility=hidden $(AM_CFLAGS) + libasm_a_SOURCES = asm_begin.c asm_abort.c asm_end.c asm_error.c \ + asm_getelf.c asm_newscn.c asm_newscn_ingrp.c \ + asm_newsubscn.c asm_newsym.c asm_newcomsym.c \ +diff --git a/libcpu/Makefile.am b/libcpu/Makefile.am +index 4c8778d..f0a1cb8 100644 +--- a/libcpu/Makefile.am ++++ b/libcpu/Makefile.am +@@ -36,9 +36,11 @@ LEX_OUTPUT_ROOT = lex.$( $@T +diff --git a/libdw/Makefile.am b/libdw/Makefile.am +index 7a3d532..166e37c 100644 +--- a/libdw/Makefile.am ++++ b/libdw/Makefile.am +@@ -35,12 +35,13 @@ AM_CPPFLAGS += -I$(srcdir)/../libelf -I$(srcdir)/../libdwelf + VERSION = 1 + + lib_LIBRARIES = libdw.a +-noinst_LIBRARIES = libdw_pic.a +-noinst_PROGRAMS = $(noinst_LIBRARIES:_pic.a=.so) ++noinst_LIBRARIES = libdw_pic.a libdw_static_pic.a ++noinst_PROGRAMS = libdw.so + + include_HEADERS = dwarf.h + pkginclude_HEADERS = libdw.h known-dwarf.h + ++libdw_a_CFLAGS = -fPIC -fvisibility=hidden $(AM_CFLAGS) + libdw_a_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \ + dwarf_getpubnames.c dwarf_getabbrev.c dwarf_tag.c \ + dwarf_error.c dwarf_nextcu.c dwarf_diename.c dwarf_offdie.c \ +@@ -94,6 +95,25 @@ libdw_a_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \ + libdw_find_split_unit.c dwarf_cu_info.c \ + dwarf_next_lines.c + ++# Minimal library with symbols needed by those libebl backends that we ++# ship statically. This is so that e.g. strip doesn't end up bringing ++# in the whole of libdw, and depending on libbz2, liblzma, etc. ++libdw_static_pic_a_SOURCES = libdw_form.c dwarf_child.c dwarf_attr.c \ ++ dwarf_attr_integrate.c dwarf_formref_die.c dwarf_error.c \ ++ dwarf_tag.c dwarf_formref.c \ ++ dwarf_abbrev_hash.c dwarf_sig8_hash.c \ ++ dwarf_formudata.c libdw_findcu.c dwarf_offdie.c \ ++ dwarf_getabbrev.c dwarf_nextcu.c libdw_alloc.c \ ++ dwarf_hasattr_integrate.c dwarf_hasattr.c \ ++ dwarf_aggregate_size.c dwarf_siblingof.c dwarf_formsdata.c \ ++ dwarf_srclang.c dwarf_formflag.c dwarf_diecu.c \ ++ dwarf_bytesize.c dwarf_bitsize.c dwarf_peel_type.c \ ++ dwarf_default_lower_bound.c libdw_find_split_unit.c \ ++ dwarf_getalt.c dwarf_haschildren.c \ ++ dwarf_begin.c dwarf_begin_elf.c dwarf_end.c frame-cache.c \ ++ dwarf_get_units.c dwarf_formstring.c \ ++ ../libdwelf/dwelf_dwarf_gnu_debugaltlink.c ++ + if MAINTAINER_MODE + BUILT_SOURCES = $(srcdir)/known-dwarf.h + MAINTAINERCLEANFILES = $(srcdir)/known-dwarf.h +@@ -104,9 +124,12 @@ endif + + libdw_pic_a_SOURCES = + am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os) ++am_libdw_static_pic_a_OBJECTS = $(libdw_static_pic_a_SOURCES:.c=.os) + + libdw_so_LIBS = libdw_pic.a ../libdwelf/libdwelf_pic.a \ +- ../libdwfl/libdwfl_pic.a ../libebl/libebl.a ++ ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \ ++ ../backends/libebl_static_pic.a \ ++ ../libcpu/libcpu_static_pic.a + libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so + libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS) + libdw_so_SOURCES = +diff --git a/libdwelf/Makefile.am b/libdwelf/Makefile.am +index a7933fd..da418e6 100644 +--- a/libdwelf/Makefile.am ++++ b/libdwelf/Makefile.am +@@ -39,6 +39,7 @@ noinst_LIBRARIES = libdwelf.a libdwelf_pic.a + pkginclude_HEADERS = libdwelf.h + noinst_HEADERS = libdwelfP.h + ++libdwelf_a_CFLAGS = -fPIC -fvisibility=hidden $(AM_CFLAGS) + libdwelf_a_SOURCES = dwelf_elf_gnu_debuglink.c dwelf_dwarf_gnu_debugaltlink.c \ + dwelf_elf_gnu_build_id.c dwelf_scn_gnu_compressed_size.c \ + dwelf_strtab.c dwelf_elf_begin.c +diff --git a/libdwfl/Makefile.am b/libdwfl/Makefile.am +index 89ca92e..d9d13b2 100644 +--- a/libdwfl/Makefile.am ++++ b/libdwfl/Makefile.am +@@ -39,6 +39,7 @@ noinst_LIBRARIES += libdwfl_pic.a + + pkginclude_HEADERS = libdwfl.h + ++libdwfl_a_CFLAGS = -fPIC -fvisibility=hidden $(AM_CFLAGS) + libdwfl_a_SOURCES = dwfl_begin.c dwfl_end.c dwfl_error.c dwfl_version.c \ + dwfl_module.c dwfl_report_elf.c relocate.c \ + dwfl_module_build_id.c dwfl_module_report_build_id.c \ +diff --git a/libebl/Makefile.am b/libebl/Makefile.am +index 737de6b..ecebdd0 100644 +--- a/libebl/Makefile.am ++++ b/libebl/Makefile.am +@@ -56,6 +56,7 @@ gen_SOURCES = eblopenbackend.c eblclosebackend.c \ + eblunwind.c eblresolvesym.c eblcheckreloctargettype.c \ + ebl_data_marker_symbol.c + ++libebl_a_CFLAGS = -fvisibility=hidden $(AM_CFLAGS) + libebl_a_SOURCES = $(gen_SOURCES) + + noinst_HEADERS = libeblP.h ebl-hooks.h +diff --git a/libebl/eblclosebackend.c b/libebl/eblclosebackend.c +index 67fbdfe..501e5c7 100644 +--- a/libebl/eblclosebackend.c ++++ b/libebl/eblclosebackend.c +@@ -44,10 +44,6 @@ ebl_closebackend (Ebl *ebl) + /* Run the destructor. */ + ebl->destr (ebl); + +- /* Close the dynamically loaded object. */ +- if (ebl->dlhandle != NULL) +- (void) dlclose (ebl->dlhandle); +- + /* Free the resources. */ + free (ebl); + } +diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c +index d54b720..74251ea 100644 +--- a/libebl/eblopenbackend.c ++++ b/libebl/eblopenbackend.c +@@ -41,6 +41,14 @@ + #include + #include + ++const char *i386_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen); ++const char *x86_64_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen); ++const char *ppc_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen); ++const char *ppc64_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen); ++const char *ia64_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen); ++const char *s390_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen); ++const char *aarch64_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen); ++const char *bpf_init (Elf *elf, GElf_Half machine, Ebl *eh, size_t ehlen); + + /* This table should contain the complete list of architectures as far + as the ELF specification is concerned. */ +@@ -48,7 +56,7 @@ + arrays to avoid relocations. */ + static const struct + { +- const char *dsoname; ++ ebl_bhinit_t initptr; + const char *emulation; + const char *prefix; + int prefix_len; +@@ -57,84 +65,84 @@ static const struct + int data; + } machines[] = + { +- { "i386", "elf_i386", "i386", 4, EM_386, ELFCLASS32, ELFDATA2LSB }, +- { "ia64", "elf_ia64", "ia64", 4, EM_IA_64, ELFCLASS64, ELFDATA2LSB }, +- { "alpha", "elf_alpha", "alpha", 5, EM_ALPHA, ELFCLASS64, ELFDATA2LSB }, +- { "x86_64", "elf_x86_64", "x86_64", 6, EM_X86_64, ELFCLASS64, ELFDATA2LSB }, +- { "ppc", "elf_ppc", "ppc", 3, EM_PPC, ELFCLASS32, ELFDATA2MSB }, +- { "ppc64", "elf_ppc64", "ppc64", 5, EM_PPC64, ELFCLASS64, ELFDATA2MSB }, +- { "tilegx", "elf_tilegx", "tilegx", 6, EM_TILEGX, ELFCLASS64, ELFDATA2LSB }, ++ { i386_init, "elf_i386", "i386", 4, EM_386, ELFCLASS32, ELFDATA2LSB }, ++ { ia64_init, "elf_ia64", "ia64", 4, EM_IA_64, ELFCLASS64, ELFDATA2LSB }, ++ { NULL, "elf_alpha", "alpha", 5, EM_ALPHA, ELFCLASS64, ELFDATA2LSB }, ++ { x86_64_init, "elf_x86_64", "x86_64", 6, EM_X86_64, ELFCLASS64, ELFDATA2LSB }, ++ { ppc_init, "elf_ppc", "ppc", 3, EM_PPC, ELFCLASS32, ELFDATA2MSB }, ++ { ppc64_init, "elf_ppc64", "ppc64", 5, EM_PPC64, ELFCLASS64, ELFDATA2MSB }, ++ { NULL, "elf_tilegx", "tilegx", 6, EM_TILEGX, ELFCLASS64, ELFDATA2LSB }, + // XXX class and machine fields need to be filled in for all archs. +- { "sh", "elf_sh", "sh", 2, EM_SH, 0, 0 }, +- { "arm", "ebl_arm", "arm", 3, EM_ARM, 0, 0 }, +- { "sparc", "elf_sparcv9", "sparc", 5, EM_SPARCV9, 0, 0 }, +- { "sparc", "elf_sparc", "sparc", 5, EM_SPARC, 0, 0 }, +- { "sparc", "elf_sparcv8plus", "sparc", 5, EM_SPARC32PLUS, 0, 0 }, +- { "s390", "ebl_s390", "s390", 4, EM_S390, 0, 0 }, +- +- { "m32", "elf_m32", "m32", 3, EM_M32, 0, 0 }, +- { "m68k", "elf_m68k", "m68k", 4, EM_68K, ELFCLASS32, ELFDATA2MSB }, +- { "m88k", "elf_m88k", "m88k", 4, EM_88K, 0, 0 }, +- { "i860", "elf_i860", "i860", 4, EM_860, 0, 0 }, +- { "s370", "ebl_s370", "s370", 4, EM_S370, 0, 0 }, +- { "parisc", "elf_parisc", "parisc", 6, EM_PARISC, 0, 0 }, +- { "vpp500", "elf_vpp500", "vpp500", 5, EM_VPP500, 0, 0 }, +- { "sparc", "elf_v8plus", "v8plus", 6, EM_SPARC32PLUS, 0, 0 }, +- { "i960", "elf_i960", "i960", 4, EM_960, 0, 0 }, +- { "v800", "ebl_v800", "v800", 4, EM_V800, 0, 0 }, +- { "fr20", "ebl_fr20", "fr20", 4, EM_FR20, 0, 0 }, +- { "rh32", "ebl_rh32", "rh32", 4, EM_RH32, 0, 0 }, +- { "rce", "ebl_rce", "rce", 3, EM_RCE, 0, 0 }, +- { "tricore", "elf_tricore", "tricore", 7, EM_TRICORE, 0, 0 }, +- { "arc", "elf_arc", "arc", 3, EM_ARC, 0, 0 }, +- { "h8", "elf_h8_300", "h8_300", 6, EM_H8_300, 0, 0 }, +- { "h8", "elf_h8_300h", "h8_300h", 6, EM_H8_300H, 0, 0 }, +- { "h8", "elf_h8s", "h8s", 6, EM_H8S, 0, 0 }, +- { "h8", "elf_h8_500", "h8_500", 6, EM_H8_500, 0, 0 }, +- { "coldfire", "elf_coldfire", "coldfire", 8, EM_COLDFIRE, 0, 0 }, +- { "m68k", "elf_68hc12", "68hc12", 6, EM_68HC12, 0, 0 }, +- { "mma", "elf_mma", "mma", 3, EM_MMA, 0, 0 }, +- { "pcp", "elf_pcp", "pcp", 3, EM_PCP, 0, 0 }, +- { "ncpu", "elf_ncpu", "ncpu", 4, EM_NCPU, 0, 0 }, +- { "ndr1", "elf_ndr1", "ndr1", 4, EM_NDR1, 0, 0 }, +- { "starcore", "elf_starcore", "starcore", 8, EM_STARCORE, 0, 0 }, +- { "me16", "elf_me16", "em16", 4, EM_ME16, 0, 0 }, +- { "st100", "elf_st100", "st100", 5, EM_ST100, 0, 0 }, +- { "tinyj", "elf_tinyj", "tinyj", 5, EM_TINYJ, 0, 0 }, +- { "pdsp", "elf_pdsp", "pdsp", 4, EM_PDSP, 0, 0 }, +- { "fx66", "elf_fx66", "fx66", 4, EM_FX66, 0, 0 }, +- { "st9plus", "elf_st9plus", "st9plus", 7, EM_ST9PLUS, 0, 0 }, +- { "st7", "elf_st7", "st7", 3, EM_ST7, 0, 0 }, +- { "m68k", "elf_68hc16", "68hc16", 6, EM_68HC16, 0, 0 }, +- { "m68k", "elf_68hc11", "68hc11", 6, EM_68HC11, 0, 0 }, +- { "m68k", "elf_68hc08", "68hc08", 6, EM_68HC08, 0, 0 }, +- { "m68k", "elf_68hc05", "68hc05", 6, EM_68HC05, 0, 0 }, +- { "svx", "elf_svx", "svx", 3, EM_SVX, 0, 0 }, +- { "st19", "elf_st19", "st19", 4, EM_ST19, 0, 0 }, +- { "vax", "elf_vax", "vax", 3, EM_VAX, 0, 0 }, +- { "cris", "elf_cris", "cris", 4, EM_CRIS, 0, 0 }, +- { "javelin", "elf_javelin", "javelin", 7, EM_JAVELIN, 0, 0 }, +- { "firepath", "elf_firepath", "firepath", 8, EM_FIREPATH, 0, 0 }, +- { "zsp", "elf_zsp", "zsp", 3, EM_ZSP, 0, 0 }, +- { "mmix", "elf_mmix", "mmix", 4, EM_MMIX, 0, 0 }, +- { "hunay", "elf_huany", "huany", 5, EM_HUANY, 0, 0 }, +- { "prism", "elf_prism", "prism", 5, EM_PRISM, 0, 0 }, +- { "avr", "elf_avr", "avr", 3, EM_AVR, 0, 0 }, +- { "fr30", "elf_fr30", "fr30", 4, EM_FR30, 0, 0 }, +- { "dv10", "elf_dv10", "dv10", 4, EM_D10V, 0, 0 }, +- { "dv30", "elf_dv30", "dv30", 4, EM_D30V, 0, 0 }, +- { "v850", "elf_v850", "v850", 4, EM_V850, 0, 0 }, +- { "m32r", "elf_m32r", "m32r", 4, EM_M32R, 0, 0 }, +- { "mn10300", "elf_mn10300", "mn10300", 7, EM_MN10300, 0, 0 }, +- { "mn10200", "elf_mn10200", "mn10200", 7, EM_MN10200, 0, 0 }, +- { "pj", "elf_pj", "pj", 2, EM_PJ, 0, 0 }, +- { "openrisc", "elf_openrisc", "openrisc", 8, EM_OPENRISC, 0, 0 }, +- { "arc", "elf_arc_a5", "arc_a5", 6, EM_ARC_A5, 0, 0 }, +- { "xtensa", "elf_xtensa", "xtensa", 6, EM_XTENSA, 0, 0 }, +- { "aarch64", "elf_aarch64", "aarch64", 7, EM_AARCH64, ELFCLASS64, 0 }, +- { "bpf", "elf_bpf", "bpf", 3, EM_BPF, 0, 0 }, +- { "riscv", "elf_riscv", "riscv", 5, EM_RISCV, ELFCLASS64, ELFDATA2LSB }, +- { "riscv", "elf_riscv", "riscv", 5, EM_RISCV, ELFCLASS32, ELFDATA2LSB }, ++ { NULL, "elf_sh", "sh", 2, EM_SH, 0, 0 }, ++ { NULL, "ebl_arm", "arm", 3, EM_ARM, 0, 0 }, ++ { NULL, "elf_sparcv9", "sparc", 5, EM_SPARCV9, 0, 0 }, ++ { NULL, "elf_sparc", "sparc", 5, EM_SPARC, 0, 0 }, ++ { NULL, "elf_sparcv8plus", "sparc", 5, EM_SPARC32PLUS, 0, 0 }, ++ { s390_init, "ebl_s390", "s390", 4, EM_S390, 0, 0 }, ++ ++ { NULL, "elf_m32", "m32", 3, EM_M32, 0, 0 }, ++ { NULL, "elf_m68k", "m68k", 4, EM_68K, ELFCLASS32, ELFDATA2MSB }, ++ { NULL, "elf_m88k", "m88k", 4, EM_88K, 0, 0 }, ++ { NULL, "elf_i860", "i860", 4, EM_860, 0, 0 }, ++ { NULL, "ebl_s370", "s370", 4, EM_S370, 0, 0 }, ++ { NULL, "elf_parisc", "parisc", 6, EM_PARISC, 0, 0 }, ++ { NULL, "elf_vpp500", "vpp500", 5, EM_VPP500, 0, 0 }, ++ { NULL, "elf_v8plus", "v8plus", 6, EM_SPARC32PLUS, 0, 0 }, ++ { NULL, "elf_i960", "i960", 4, EM_960, 0, 0 }, ++ { NULL, "ebl_v800", "v800", 4, EM_V800, 0, 0 }, ++ { NULL, "ebl_fr20", "fr20", 4, EM_FR20, 0, 0 }, ++ { NULL, "ebl_rh32", "rh32", 4, EM_RH32, 0, 0 }, ++ { NULL, "ebl_rce", "rce", 3, EM_RCE, 0, 0 }, ++ { NULL, "elf_tricore", "tricore", 7, EM_TRICORE, 0, 0 }, ++ { NULL, "elf_arc", "arc", 3, EM_ARC, 0, 0 }, ++ { NULL, "elf_h8_300", "h8_300", 6, EM_H8_300, 0, 0 }, ++ { NULL, "elf_h8_300h", "h8_300h", 6, EM_H8_300H, 0, 0 }, ++ { NULL, "elf_h8s", "h8s", 6, EM_H8S, 0, 0 }, ++ { NULL, "elf_h8_500", "h8_500", 6, EM_H8_500, 0, 0 }, ++ { NULL, "elf_coldfire", "coldfire", 8, EM_COLDFIRE, 0, 0 }, ++ { NULL, "elf_68hc12", "68hc12", 6, EM_68HC12, 0, 0 }, ++ { NULL, "elf_mma", "mma", 3, EM_MMA, 0, 0 }, ++ { NULL, "elf_pcp", "pcp", 3, EM_PCP, 0, 0 }, ++ { NULL, "elf_ncpu", "ncpu", 4, EM_NCPU, 0, 0 }, ++ { NULL, "elf_ndr1", "ndr1", 4, EM_NDR1, 0, 0 }, ++ { NULL, "elf_starcore", "starcore", 8, EM_STARCORE, 0, 0 }, ++ { NULL, "elf_me16", "em16", 4, EM_ME16, 0, 0 }, ++ { NULL, "elf_st100", "st100", 5, EM_ST100, 0, 0 }, ++ { NULL, "elf_tinyj", "tinyj", 5, EM_TINYJ, 0, 0 }, ++ { NULL, "elf_pdsp", "pdsp", 4, EM_PDSP, 0, 0 }, ++ { NULL, "elf_fx66", "fx66", 4, EM_FX66, 0, 0 }, ++ { NULL, "elf_st9plus", "st9plus", 7, EM_ST9PLUS, 0, 0 }, ++ { NULL, "elf_st7", "st7", 3, EM_ST7, 0, 0 }, ++ { NULL, "elf_68hc16", "68hc16", 6, EM_68HC16, 0, 0 }, ++ { NULL, "elf_68hc11", "68hc11", 6, EM_68HC11, 0, 0 }, ++ { NULL, "elf_68hc08", "68hc08", 6, EM_68HC08, 0, 0 }, ++ { NULL, "elf_68hc05", "68hc05", 6, EM_68HC05, 0, 0 }, ++ { NULL, "elf_svx", "svx", 3, EM_SVX, 0, 0 }, ++ { NULL, "elf_st19", "st19", 4, EM_ST19, 0, 0 }, ++ { NULL, "elf_vax", "vax", 3, EM_VAX, 0, 0 }, ++ { NULL, "elf_cris", "cris", 4, EM_CRIS, 0, 0 }, ++ { NULL, "elf_javelin", "javelin", 7, EM_JAVELIN, 0, 0 }, ++ { NULL, "elf_firepath", "firepath", 8, EM_FIREPATH, 0, 0 }, ++ { NULL, "elf_zsp", "zsp", 3, EM_ZSP, 0, 0 }, ++ { NULL, "elf_mmix", "mmix", 4, EM_MMIX, 0, 0 }, ++ { NULL, "elf_huany", "huany", 5, EM_HUANY, 0, 0 }, ++ { NULL, "elf_prism", "prism", 5, EM_PRISM, 0, 0 }, ++ { NULL, "elf_avr", "avr", 3, EM_AVR, 0, 0 }, ++ { NULL, "elf_fr30", "fr30", 4, EM_FR30, 0, 0 }, ++ { NULL, "elf_dv10", "dv10", 4, EM_D10V, 0, 0 }, ++ { NULL, "elf_dv30", "dv30", 4, EM_D30V, 0, 0 }, ++ { NULL, "elf_v850", "v850", 4, EM_V850, 0, 0 }, ++ { NULL, "elf_m32r", "m32r", 4, EM_M32R, 0, 0 }, ++ { NULL, "elf_mn10300", "mn10300", 7, EM_MN10300, 0, 0 }, ++ { NULL, "elf_mn10200", "mn10200", 7, EM_MN10200, 0, 0 }, ++ { NULL, "elf_pj", "pj", 2, EM_PJ, 0, 0 }, ++ { NULL, "elf_openrisc", "openrisc", 8, EM_OPENRISC, 0, 0 }, ++ { NULL, "elf_arc_a5", "arc_a5", 6, EM_ARC_A5, 0, 0 }, ++ { NULL, "elf_xtensa", "xtensa", 6, EM_XTENSA, 0, 0 }, ++ { aarch64_init, "elf_aarch64", "aarch64", 7, EM_AARCH64, ELFCLASS64, 0 }, ++ { bpf_init, "elf_bpf", "bpf", 3, EM_BPF, 0, 0 }, ++ { NULL, "elf_riscv", "riscv", 5, EM_RISCV, ELFCLASS64, ELFDATA2LSB }, ++ { NULL, "elf_riscv", "riscv", 5, EM_RISCV, ELFCLASS32, ELFDATA2LSB }, + }; + #define nmachines (sizeof (machines) / sizeof (machines[0])) + +@@ -318,46 +326,17 @@ openbackend (Elf *elf, const char *emulation, GElf_Half machine) + #endif + #define ORIGINDIR "$ORIGIN/../$LIB/" LIBEBL_SUBDIR "/" + +- /* Give it a try. At least the machine type matches. First +- try to load the module. */ +- char dsoname[100]; +- strcpy (stpcpy (stpcpy (dsoname, ORIGINDIR "libebl_"), +- machines[cnt].dsoname), +- ".so"); +- +- void *h = dlopen (dsoname, RTLD_LAZY); +- if (h == NULL) +- { +- strcpy (stpcpy (stpcpy (dsoname, "libebl_"), +- machines[cnt].dsoname), +- ".so"); +- h = dlopen (dsoname, RTLD_LAZY); +- } +- +- /* Try without an explicit path. */ +- if (h != NULL) ++ ebl_bhinit_t initp = machines[cnt].initptr; ++ if (1) + { +- /* We managed to load the object. Now see whether the +- initialization function likes our file. */ + static const char version[] = MODVERSION; + const char *modversion; +- ebl_bhinit_t initp; +- +- // We use a static number to help the compiler see we don't +- // overflow the stack with an arbitrary number. +- assert (machines[cnt].prefix_len <= MAX_PREFIX_LEN); +- char symname[MAX_PREFIX_LEN + sizeof "_init"]; +- +- strcpy (mempcpy (symname, machines[cnt].prefix, +- machines[cnt].prefix_len), "_init"); +- +- initp = (ebl_bhinit_t) dlsym (h, symname); + if (initp != NULL + && (modversion = initp (elf, machine, result, sizeof (Ebl))) + && strcmp (version, modversion) == 0) + { + /* We found a module to handle our file. */ +- result->dlhandle = h; ++ result->dlhandle = NULL; + result->elf = elf; + + /* A few entries are mandatory. */ +@@ -366,9 +345,6 @@ openbackend (Elf *elf, const char *emulation, GElf_Half machine) + + return result; + } +- +- /* Not the module we need. */ +- (void) dlclose (h); + } + + /* We cannot find a DSO but the emulation/machine ID matches. +diff --git a/libelf/Makefile.am b/libelf/Makefile.am +index d5d63f7..0d8679f 100644 +--- a/libelf/Makefile.am ++++ b/libelf/Makefile.am +@@ -51,6 +51,7 @@ endif + + pkginclude_HEADERS = elf-knowledge.h + ++libelf_a_CFLAGS = -fPIC -fvisibility=hidden $(AM_CFLAGS) + libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \ + elf_begin.c elf_next.c elf_rand.c elf_end.c elf_kind.c \ + gelf_getclass.c elf_getbase.c elf_getident.c \ +diff --git a/src/Makefile.am b/src/Makefile.am +index 2b1c0dc..657b21a 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -47,7 +47,8 @@ libasm = ../libasm/libasm.so + libdw = ../libdw/libdw.so + libelf = ../libelf/libelf.so + endif +-libebl = ../libebl/libebl.a ++libebl = ../libebl/libebl.a ../backends/libebl_static_pic.a ../libcpu/libcpu_static_pic.a ++libdw_static = ../libdw/libdw_static_pic.a + libeu = ../lib/libeu.a + + if DEMANGLE +@@ -67,16 +68,17 @@ ranlib_no_Wstack_usage = yes + ar_no_Wstack_usage = yes + unstrip_no_Wstack_usage = yes + ++ + readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl + nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl \ + $(demanglelib) + size_LDADD = $(libelf) $(libeu) $(argp_LDADD) + strip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) -ldl +-elflint_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl ++elflint_LDADD = $(libebl) $(libdw_static) $(libelf) $(libeu) $(argp_LDADD) -ldl + findtextrel_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) + addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(demanglelib) +-elfcmp_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl +-objdump_LDADD = $(libasm) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl ++elfcmp_LDADD = $(libebl) $(libdw_static) $(libeu) $(libelf) $(argp_LDADD) -ldl ++objdump_LDADD = $(libasm) $(libebl) $(libdw_static) $(libelf) $(libeu) $(argp_LDADD) -ldl + ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) + strings_LDADD = $(libelf) $(libeu) $(argp_LDADD) + ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 1b0c7d3..c74a6c1 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -86,9 +86,8 @@ TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile test-nlist \ + newscn run-strip-test.sh run-strip-test2.sh \ + run-strip-test3.sh run-strip-test4.sh run-strip-test5.sh \ + run-strip-test6.sh run-strip-test7.sh run-strip-test8.sh \ +- run-strip-test9.sh run-strip-test10.sh run-strip-test11.sh \ +- run-strip-test12.sh \ +- run-strip-nothing.sh run-strip-g.sh run-annobingroup.sh \ ++ run-strip-test9.sh run-strip-test10.sh \ ++ run-strip-nothing.sh run-strip-g.sh \ + run-strip-groups.sh run-strip-reloc.sh run-strip-strmerge.sh \ + run-strip-nobitsalign.sh run-strip-remove-keep.sh \ + run-unstrip-test.sh run-unstrip-test2.sh run-unstrip-test3.sh \ +@@ -480,7 +479,8 @@ libdw = ../libdw/libdw.so + libelf = ../libelf/libelf.so + libasm = ../libasm/libasm.so + endif +-libebl = ../libebl/libebl.a ++libebl = ../libebl/libebl.a ../backends/libebl_static_pic.a ../libcpu/libcpu_static_pic.a ++libdw_static = ../libdw/libdw_static_pic.a + libeu = ../lib/libeu.a + endif !STANDALONE + +@@ -510,6 +510,7 @@ get_files_LDADD = $(libdw) $(libelf) + next_files_LDADD = $(libdw) $(libelf) + get_aranges_LDADD = $(libdw) $(libelf) + allfcts_LDADD = $(libdw) $(libelf) ++line2addr_no_Wformat = yes + line2addr_LDADD = $(libdw) $(argp_LDADD) + addrscopes_LDADD = $(libdw) $(argp_LDADD) + funcscopes_LDADD = $(libdw) $(argp_LDADD) +diff --git a/tests/run-addrcfi.sh b/tests/run-addrcfi.sh +index fd89d02..76db7d2 100755 +--- a/tests/run-addrcfi.sh ++++ b/tests/run-addrcfi.sh +@@ -3521,82 +3521,6 @@ testrun_compare ${abs_builddir}/addrcfi -e testfiles390x 0x0000000080000510 <<\E + handle_cfi no CFI (.debug_frame): no error + EOF + +-# EM_ARM (function bar 0x00008510) +-# Note. Only in .debug_frame, the .eh_frame is actually empty. +-# Same as s390 and ppc above. +-testfiles testfilearm +-testrun_compare ${abs_builddir}/addrcfi -e testfilearm 0x00008510 <<\EOF +-dwarf_cfi_addrframe (.eh_frame): no matching address range +-.debug_frame has 0x8510 => [0x8510, 0x8524): +- return address in reg14 +- CFA location expression: bregx(13) +- integer reg0 (r0): undefined +- integer reg1 (r1): undefined +- integer reg2 (r2): undefined +- integer reg3 (r3): undefined +- integer reg4 (r4): same_value +- integer reg5 (r5): same_value +- integer reg6 (r6): same_value +- integer reg7 (r7): same_value +- integer reg8 (r8): same_value +- integer reg9 (r9): undefined +- integer reg10 (r10): same_value +- integer reg11 (r11): same_value +- integer reg12 (r12): undefined +- integer reg13 (sp): location expression: call_frame_cfa stack_value +- integer reg14 (lr): same_value +- integer reg15 (pc): location expression: regx(14) +- FPA reg16 (f0): undefined +- FPA reg17 (f1): undefined +- FPA reg18 (f2): undefined +- FPA reg19 (f3): undefined +- FPA reg20 (f4): undefined +- FPA reg21 (f5): undefined +- FPA reg22 (f6): undefined +- FPA reg23 (f7): undefined +- FPA reg96 (f0): undefined +- FPA reg97 (f1): undefined +- FPA reg98 (f2): undefined +- FPA reg99 (f3): undefined +- FPA reg100 (f4): undefined +- FPA reg101 (f5): undefined +- FPA reg102 (f6): undefined +- FPA reg103 (f7): undefined +- integer reg128 (spsr): undefined +- VFP reg256 (d0): undefined +- VFP reg257 (d1): undefined +- VFP reg258 (d2): undefined +- VFP reg259 (d3): undefined +- VFP reg260 (d4): undefined +- VFP reg261 (d5): undefined +- VFP reg262 (d6): undefined +- VFP reg263 (d7): undefined +- VFP reg264 (d8): same_value +- VFP reg265 (d9): same_value +- VFP reg266 (d10): same_value +- VFP reg267 (d11): same_value +- VFP reg268 (d12): same_value +- VFP reg269 (d13): same_value +- VFP reg270 (d14): same_value +- VFP reg271 (d15): same_value +- VFP reg272 (d16): undefined +- VFP reg273 (d17): undefined +- VFP reg274 (d18): undefined +- VFP reg275 (d19): undefined +- VFP reg276 (d20): undefined +- VFP reg277 (d21): undefined +- VFP reg278 (d22): undefined +- VFP reg279 (d23): undefined +- VFP reg280 (d24): undefined +- VFP reg281 (d25): undefined +- VFP reg282 (d26): undefined +- VFP reg283 (d27): undefined +- VFP reg284 (d28): undefined +- VFP reg285 (d29): undefined +- VFP reg286 (d30): undefined +- VFP reg287 (d31): undefined +-EOF +- + # EM_AARCH64 (function bar 0x400550) + # Same as arm, 390 and ppc above. + # Note missing coverage in .eh_frame. +diff --git a/tests/run-allregs.sh b/tests/run-allregs.sh +index 1422bd6..0d2eb52 100755 +--- a/tests/run-allregs.sh ++++ b/tests/run-allregs.sh +@@ -2344,387 +2344,6 @@ control registers: + 65: %pswa (pswa), address 64 bits + EOF + +-regs_test testfile30 <<\EOF +-integer registers: +- 0: %g0 (g0), signed 32 bits +- 1: %g1 (g1), signed 32 bits +- 2: %g2 (g2), signed 32 bits +- 3: %g3 (g3), signed 32 bits +- 4: %g4 (g4), signed 32 bits +- 5: %g5 (g5), signed 32 bits +- 6: %g6 (g6), signed 32 bits +- 7: %g7 (g7), signed 32 bits +- 8: %o0 (o0), signed 32 bits +- 9: %o1 (o1), signed 32 bits +- 10: %o2 (o2), signed 32 bits +- 11: %o3 (o3), signed 32 bits +- 12: %o4 (o4), signed 32 bits +- 13: %o5 (o5), signed 32 bits +- 14: %o6 (o6), address 32 bits +- 15: %o7 (o7), signed 32 bits +- 16: %l0 (l0), signed 32 bits +- 17: %l1 (l1), signed 32 bits +- 18: %l2 (l2), signed 32 bits +- 19: %l3 (l3), signed 32 bits +- 20: %l4 (l4), signed 32 bits +- 21: %l5 (l5), signed 32 bits +- 22: %l6 (l6), signed 32 bits +- 23: %l7 (l7), signed 32 bits +- 24: %i0 (i0), signed 32 bits +- 25: %i1 (i1), signed 32 bits +- 26: %i2 (i2), signed 32 bits +- 27: %i3 (i3), signed 32 bits +- 28: %i4 (i4), signed 32 bits +- 29: %i5 (i5), signed 32 bits +- 30: %i6 (i6), address 32 bits +- 31: %i7 (i7), signed 32 bits +-FPU registers: +- 32: %f0 (f0), float 32 bits +- 33: %f1 (f1), float 32 bits +- 34: %f2 (f2), float 32 bits +- 35: %f3 (f3), float 32 bits +- 36: %f4 (f4), float 32 bits +- 37: %f5 (f5), float 32 bits +- 38: %f6 (f6), float 32 bits +- 39: %f7 (f7), float 32 bits +- 40: %f8 (f8), float 32 bits +- 41: %f9 (f9), float 32 bits +- 42: %f10 (f10), float 32 bits +- 43: %f11 (f11), float 32 bits +- 44: %f12 (f12), float 32 bits +- 45: %f13 (f13), float 32 bits +- 46: %f14 (f14), float 32 bits +- 47: %f15 (f15), float 32 bits +- 48: %f16 (f16), float 32 bits +- 49: %f17 (f17), float 32 bits +- 50: %f18 (f18), float 32 bits +- 51: %f19 (f19), float 32 bits +- 52: %f20 (f20), float 32 bits +- 53: %f21 (f21), float 32 bits +- 54: %f22 (f22), float 32 bits +- 55: %f23 (f23), float 32 bits +- 56: %f24 (f24), float 32 bits +- 57: %f25 (f25), float 32 bits +- 58: %f26 (f26), float 32 bits +- 59: %f27 (f27), float 32 bits +- 60: %f28 (f28), float 32 bits +- 61: %f29 (f29), float 32 bits +- 62: %f30 (f30), float 32 bits +- 63: %f31 (f31), float 32 bits +-control registers: +- 64: %y (y), unsigned 32 bits +- 65: %psr (psr), unsigned 32 bits +- 66: %wim (wim), unsigned 32 bits +- 67: %tbr (tbr), unsigned 32 bits +- 68: %pc (pc), address 32 bits +- 69: %npc (npc), address 32 bits +- 70: %fsr (fsr), unsigned 32 bits +- 71: %csr (csr), unsigned 32 bits +-EOF +- +-regs_test testfile31 <<\EOF +-integer registers: +- 0: %g0 (g0), signed 64 bits +- 1: %g1 (g1), signed 64 bits +- 2: %g2 (g2), signed 64 bits +- 3: %g3 (g3), signed 64 bits +- 4: %g4 (g4), signed 64 bits +- 5: %g5 (g5), signed 64 bits +- 6: %g6 (g6), signed 64 bits +- 7: %g7 (g7), signed 64 bits +- 8: %o0 (o0), signed 64 bits +- 9: %o1 (o1), signed 64 bits +- 10: %o2 (o2), signed 64 bits +- 11: %o3 (o3), signed 64 bits +- 12: %o4 (o4), signed 64 bits +- 13: %o5 (o5), signed 64 bits +- 14: %o6 (o6), address 64 bits +- 15: %o7 (o7), signed 64 bits +- 16: %l0 (l0), signed 64 bits +- 17: %l1 (l1), signed 64 bits +- 18: %l2 (l2), signed 64 bits +- 19: %l3 (l3), signed 64 bits +- 20: %l4 (l4), signed 64 bits +- 21: %l5 (l5), signed 64 bits +- 22: %l6 (l6), signed 64 bits +- 23: %l7 (l7), signed 64 bits +- 24: %i0 (i0), signed 64 bits +- 25: %i1 (i1), signed 64 bits +- 26: %i2 (i2), signed 64 bits +- 27: %i3 (i3), signed 64 bits +- 28: %i4 (i4), signed 64 bits +- 29: %i5 (i5), signed 64 bits +- 30: %i6 (i6), address 64 bits +- 31: %i7 (i7), signed 64 bits +-FPU registers: +- 32: %f0 (f0), float 32 bits +- 33: %f1 (f1), float 32 bits +- 34: %f2 (f2), float 32 bits +- 35: %f3 (f3), float 32 bits +- 36: %f4 (f4), float 32 bits +- 37: %f5 (f5), float 32 bits +- 38: %f6 (f6), float 32 bits +- 39: %f7 (f7), float 32 bits +- 40: %f8 (f8), float 32 bits +- 41: %f9 (f9), float 32 bits +- 42: %f10 (f10), float 32 bits +- 43: %f11 (f11), float 32 bits +- 44: %f12 (f12), float 32 bits +- 45: %f13 (f13), float 32 bits +- 46: %f14 (f14), float 32 bits +- 47: %f15 (f15), float 32 bits +- 48: %f16 (f16), float 32 bits +- 49: %f17 (f17), float 32 bits +- 50: %f18 (f18), float 32 bits +- 51: %f19 (f19), float 32 bits +- 52: %f20 (f20), float 32 bits +- 53: %f21 (f21), float 32 bits +- 54: %f22 (f22), float 32 bits +- 55: %f23 (f23), float 32 bits +- 56: %f24 (f24), float 32 bits +- 57: %f25 (f25), float 32 bits +- 58: %f26 (f26), float 32 bits +- 59: %f27 (f27), float 32 bits +- 60: %f28 (f28), float 32 bits +- 61: %f29 (f29), float 32 bits +- 62: %f30 (f30), float 32 bits +- 63: %f31 (f31), float 32 bits +- 64: %f32 (f32), float 64 bits +- 65: %f34 (f34), float 64 bits +- 66: %f36 (f36), float 64 bits +- 67: %f38 (f38), float 64 bits +- 68: %f40 (f40), float 64 bits +- 69: %f42 (f42), float 64 bits +- 70: %f44 (f44), float 64 bits +- 71: %f46 (f46), float 64 bits +- 72: %f48 (f48), float 64 bits +- 73: %f50 (f50), float 64 bits +- 74: %f52 (f52), float 64 bits +- 75: %f54 (f54), float 64 bits +- 76: %f56 (f56), float 64 bits +- 77: %f58 (f58), float 64 bits +- 78: %f60 (f60), float 64 bits +- 79: %f62 (f62), float 64 bits +-control registers: +- 80: %pc (pc), address 64 bits +- 81: %npc (npc), address 64 bits +- 82: %state (state), unsigned 64 bits +- 83: %fsr (fsr), unsigned 64 bits +- 84: %fprs (fprs), unsigned 64 bits +- 85: %y (y), unsigned 64 bits +-EOF +- +-regs_test testfile10 <<\EOF +-integer registers: +- 0: $v0 (v0), signed 64 bits +- 1: $t0 (t0), signed 64 bits +- 2: $t1 (t1), signed 64 bits +- 3: $t2 (t2), signed 64 bits +- 4: $t3 (t3), signed 64 bits +- 5: $t4 (t4), signed 64 bits +- 6: $t5 (t5), signed 64 bits +- 7: $t6 (t6), signed 64 bits +- 8: $t7 (t7), signed 64 bits +- 9: $s0 (s0), signed 64 bits +- 10: $s1 (s1), signed 64 bits +- 11: $s2 (s2), signed 64 bits +- 12: $s3 (s3), signed 64 bits +- 13: $s4 (s4), signed 64 bits +- 14: $s5 (s5), signed 64 bits +- 15: $s6 (s6), signed 64 bits +- 16: $a0 (a0), signed 64 bits +- 17: $a1 (a1), signed 64 bits +- 18: $a2 (a2), signed 64 bits +- 19: $a3 (a3), signed 64 bits +- 20: $a4 (a4), signed 64 bits +- 21: $a5 (a5), signed 64 bits +- 22: $t8 (t8), signed 64 bits +- 23: $t9 (t9), signed 64 bits +- 24: $t10 (t10), signed 64 bits +- 25: $t11 (t11), signed 64 bits +- 26: $ra (ra), address 64 bits +- 27: $t12 (t12), signed 64 bits +- 28: $at (at), signed 64 bits +- 29: $gp (gp), address 64 bits +- 30: $sp (sp), address 64 bits +- 31: $zero (zero), signed 64 bits +- 64: $pc (pc), address 64 bits +- 66: $unique (unique), address 64 bits +-FPU registers: +- 32: $f0 (f0), float 64 bits +- 33: $f1 (f1), float 64 bits +- 34: $f2 (f2), float 64 bits +- 35: $f3 (f3), float 64 bits +- 36: $f4 (f4), float 64 bits +- 37: $f5 (f5), float 64 bits +- 38: $f6 (f6), float 64 bits +- 39: $f7 (f7), float 64 bits +- 40: $f8 (f8), float 64 bits +- 41: $f9 (f9), float 64 bits +- 42: $f10 (f10), float 64 bits +- 43: $f11 (f11), float 64 bits +- 44: $f12 (f12), float 64 bits +- 45: $f13 (f13), float 64 bits +- 46: $f14 (f14), float 64 bits +- 47: $f15 (f15), float 64 bits +- 48: $f16 (f16), float 64 bits +- 49: $f17 (f17), float 64 bits +- 50: $f18 (f18), float 64 bits +- 51: $f19 (f19), float 64 bits +- 52: $f20 (f20), float 64 bits +- 53: $f21 (f21), float 64 bits +- 54: $f22 (f22), float 64 bits +- 55: $f23 (f23), float 64 bits +- 56: $f24 (f24), float 64 bits +- 57: $f25 (f25), float 64 bits +- 58: $f26 (f26), float 64 bits +- 59: $f27 (f27), float 64 bits +- 60: $f28 (f28), float 64 bits +- 61: $f29 (f29), float 64 bits +- 62: $f30 (f30), float 64 bits +- 63: $fpcr (fpcr), unsigned 64 bits +-EOF +- +-regs_test testfile60 <<\EOF +-integer registers: +- 0: r0 (r0), signed 64 bits +- 1: r1 (r1), signed 64 bits +- 2: r2 (r2), signed 64 bits +- 3: r3 (r3), signed 64 bits +- 4: r4 (r4), signed 64 bits +- 5: r5 (r5), signed 64 bits +- 6: r6 (r6), signed 64 bits +- 7: r7 (r7), signed 64 bits +- 8: r8 (r8), signed 64 bits +- 9: r9 (r9), signed 64 bits +- 10: r10 (r10), signed 64 bits +- 11: r11 (r11), signed 64 bits +- 12: r12 (r12), signed 64 bits +- 13: r13 (r13), signed 64 bits +- 14: r14 (r14), signed 64 bits +- 15: r15 (r15), signed 64 bits +- 16: r16 (r16), signed 64 bits +- 17: r17 (r17), signed 64 bits +- 18: r18 (r18), signed 64 bits +- 19: r19 (r19), signed 64 bits +- 20: r20 (r20), signed 64 bits +- 21: r21 (r21), signed 64 bits +- 22: r22 (r22), signed 64 bits +- 23: r23 (r23), signed 64 bits +- 24: r24 (r24), signed 64 bits +- 25: r25 (r25), signed 64 bits +- 26: r26 (r26), signed 64 bits +- 27: r27 (r27), signed 64 bits +- 28: r28 (r28), signed 64 bits +- 29: r29 (r29), signed 64 bits +- 30: r30 (r30), signed 64 bits +- 31: r31 (r31), signed 64 bits +- 32: r32 (r32), signed 64 bits +- 33: r33 (r33), signed 64 bits +- 34: r34 (r34), signed 64 bits +- 35: r35 (r35), signed 64 bits +- 36: r36 (r36), signed 64 bits +- 37: r37 (r37), signed 64 bits +- 38: r38 (r38), signed 64 bits +- 39: r39 (r39), signed 64 bits +- 40: r40 (r40), signed 64 bits +- 41: r41 (r41), signed 64 bits +- 42: r42 (r42), signed 64 bits +- 43: r43 (r43), signed 64 bits +- 44: r44 (r44), signed 64 bits +- 45: r45 (r45), signed 64 bits +- 46: r46 (r46), signed 64 bits +- 47: r47 (r47), signed 64 bits +- 48: r48 (r48), signed 64 bits +- 49: r49 (r49), signed 64 bits +- 50: r50 (r50), signed 64 bits +- 51: r51 (r51), signed 64 bits +- 52: r52 (r52), signed 64 bits +- 53: tp (tp), address 64 bits +- 54: sp (sp), address 64 bits +- 55: lr (lr), address 64 bits +- 56: sn (sn), unsigned 64 bits +- 57: idn0 (idn0), unsigned 64 bits +- 58: idn1 (idn1), unsigned 64 bits +- 59: udn0 (udn0), unsigned 64 bits +- 60: udn1 (udn1), unsigned 64 bits +- 61: udn2 (udn2), unsigned 64 bits +- 62: udn3 (udn3), unsigned 64 bits +- 63: zero (zero), unsigned 64 bits +- 64: pc (pc), address 64 bits +-EOF +- +-regs_test testfile61 <<\EOF +-integer registers: +- 0: r0 (r0), signed 32 bits +- 1: r1 (r1), signed 32 bits +- 2: r2 (r2), signed 32 bits +- 3: r3 (r3), signed 32 bits +- 4: r4 (r4), signed 32 bits +- 5: r5 (r5), signed 32 bits +- 6: r6 (r6), signed 32 bits +- 7: r7 (r7), signed 32 bits +- 8: r8 (r8), signed 32 bits +- 9: r9 (r9), signed 32 bits +- 10: r10 (r10), signed 32 bits +- 11: r11 (r11), signed 32 bits +- 12: r12 (r12), signed 32 bits +- 13: sp (sp), address 32 bits +- 14: lr (lr), address 32 bits +- 15: pc (pc), address 32 bits +- 128: spsr (spsr), unsigned 32 bits +-FPA registers: +- 16: f0 (f0), float 96 bits +- 17: f1 (f1), float 96 bits +- 18: f2 (f2), float 96 bits +- 19: f3 (f3), float 96 bits +- 20: f4 (f4), float 96 bits +- 21: f5 (f5), float 96 bits +- 22: f6 (f6), float 96 bits +- 23: f7 (f7), float 96 bits +- 96: f0 (f0), float 96 bits +- 97: f1 (f1), float 96 bits +- 98: f2 (f2), float 96 bits +- 99: f3 (f3), float 96 bits +- 100: f4 (f4), float 96 bits +- 101: f5 (f5), float 96 bits +- 102: f6 (f6), float 96 bits +- 103: f7 (f7), float 96 bits +-VFP registers: +- 256: d0 (d0), float 64 bits +- 257: d1 (d1), float 64 bits +- 258: d2 (d2), float 64 bits +- 259: d3 (d3), float 64 bits +- 260: d4 (d4), float 64 bits +- 261: d5 (d5), float 64 bits +- 262: d6 (d6), float 64 bits +- 263: d7 (d7), float 64 bits +- 264: d8 (d8), float 64 bits +- 265: d9 (d9), float 64 bits +- 266: d10 (d10), float 64 bits +- 267: d11 (d11), float 64 bits +- 268: d12 (d12), float 64 bits +- 269: d13 (d13), float 64 bits +- 270: d14 (d14), float 64 bits +- 271: d15 (d15), float 64 bits +- 272: d16 (d16), float 64 bits +- 273: d17 (d17), float 64 bits +- 274: d18 (d18), float 64 bits +- 275: d19 (d19), float 64 bits +- 276: d20 (d20), float 64 bits +- 277: d21 (d21), float 64 bits +- 278: d22 (d22), float 64 bits +- 279: d23 (d23), float 64 bits +- 280: d24 (d24), float 64 bits +- 281: d25 (d25), float 64 bits +- 282: d26 (d26), float 64 bits +- 283: d27 (d27), float 64 bits +- 284: d28 (d28), float 64 bits +- 285: d29 (d29), float 64 bits +- 286: d30 (d30), float 64 bits +- 287: d31 (d31), float 64 bits +-EOF +- + # See run-readelf-mixed-corenote.sh for instructions to regenerate + # this core file. + regs_test testfile_aarch64_core <<\EOF +@@ -2871,106 +2490,4 @@ x87 registers: + 40: %st7 (st7), float 80 bits + EOF + +-# See run-readelf-mixed-corenote.sh for instructions to regenerate +-# this core file. +-regs_test testfile-m68k-core <<\EOF +-integer registers: +- 0: %d0 (d0), signed 32 bits +- 1: %d1 (d1), signed 32 bits +- 2: %d2 (d2), signed 32 bits +- 3: %d3 (d3), signed 32 bits +- 4: %d4 (d4), signed 32 bits +- 5: %d5 (d5), signed 32 bits +- 6: %d6 (d6), signed 32 bits +- 7: %d7 (d7), signed 32 bits +- 8: %a0 (a0), address 32 bits +- 9: %a1 (a1), address 32 bits +- 10: %a2 (a2), address 32 bits +- 11: %a3 (a3), address 32 bits +- 12: %a4 (a4), address 32 bits +- 13: %a5 (a5), address 32 bits +- 14: %a6 (a6), address 32 bits +- 15: %a7 (a7), address 32 bits +- 24: %pc (pc), address 32 bits +-FPU registers: +- 16: %fp0 (fp0), float 96 bits +- 17: %fp1 (fp1), float 96 bits +- 18: %fp2 (fp2), float 96 bits +- 19: %fp3 (fp3), float 96 bits +- 20: %fp4 (fp4), float 96 bits +- 21: %fp5 (fp5), float 96 bits +- 22: %fp6 (fp6), float 96 bits +- 23: %fp7 (fp7), float 96 bits +-EOF +- +-# See run-readelf-mixed-corenote.sh for instructions to regenerate +-# this core file. +-regs_test testfile-riscv64-core <<\EOF +-integer registers: +- 0: zero (zero), signed 64 bits +- 1: ra (ra), address 64 bits +- 2: sp (sp), address 64 bits +- 3: gp (gp), address 64 bits +- 4: tp (tp), address 64 bits +- 5: t0 (t0), signed 64 bits +- 6: t1 (t1), signed 64 bits +- 7: t2 (t2), signed 64 bits +- 8: s0 (s0), signed 64 bits +- 9: s1 (s1), signed 64 bits +- 10: a0 (a0), signed 64 bits +- 11: a1 (a1), signed 64 bits +- 12: a2 (a2), signed 64 bits +- 13: a3 (a3), signed 64 bits +- 14: a4 (a4), signed 64 bits +- 15: a5 (a5), signed 64 bits +- 16: a6 (a6), signed 64 bits +- 17: a7 (a7), signed 64 bits +- 18: s2 (s2), signed 64 bits +- 19: s3 (s3), signed 64 bits +- 20: s4 (s4), signed 64 bits +- 21: s5 (s5), signed 64 bits +- 22: s6 (s6), signed 64 bits +- 23: s7 (s7), signed 64 bits +- 24: s8 (s8), signed 64 bits +- 25: s9 (s9), signed 64 bits +- 26: s10 (s10), signed 64 bits +- 27: s11 (s11), signed 64 bits +- 28: t3 (t3), signed 64 bits +- 29: t4 (t4), signed 64 bits +- 30: t5 (t5), signed 64 bits +- 31: t6 (t6), signed 64 bits +-FPU registers: +- 32: ft0 (ft0), float 64 bits +- 33: ft1 (ft1), float 64 bits +- 34: ft2 (ft2), float 64 bits +- 35: ft3 (ft3), float 64 bits +- 36: ft4 (ft4), float 64 bits +- 37: ft5 (ft5), float 64 bits +- 38: ft6 (ft6), float 64 bits +- 39: ft7 (ft7), float 64 bits +- 40: fs0 (fs0), float 64 bits +- 41: fs1 (fs1), float 64 bits +- 42: fa0 (fa0), float 64 bits +- 43: fa1 (fa1), float 64 bits +- 44: fa2 (fa2), float 64 bits +- 45: fa3 (fa3), float 64 bits +- 46: fa4 (fa4), float 64 bits +- 47: fa5 (fa5), float 64 bits +- 48: fa6 (fa6), float 64 bits +- 49: fa7 (fa7), float 64 bits +- 50: fs2 (fs2), float 64 bits +- 51: fs3 (fs3), float 64 bits +- 52: fs4 (fs4), float 64 bits +- 53: fs5 (fs5), float 64 bits +- 54: fs6 (fs6), float 64 bits +- 55: fs7 (fs7), float 64 bits +- 56: fs8 (fs8), float 64 bits +- 57: fs9 (fs9), float 64 bits +- 58: fs10 (fs10), float 64 bits +- 59: fs11 (fs11), float 64 bits +- 60: ft8 (ft8), float 64 bits +- 61: ft9 (ft9), float 64 bits +- 62: ft10 (ft10), float 64 bits +- 63: ft11 (ft11), float 64 bits +-EOF + exit 0 +diff --git a/tests/run-arextract.sh b/tests/run-arextract.sh +index 44f4a52..0532952 100755 +--- a/tests/run-arextract.sh ++++ b/tests/run-arextract.sh +@@ -26,7 +26,7 @@ if test -f $archive; then + echo -n "Extracting symbols... $ac_c" + + # The files we are looking at. +- for f in ${abs_top_builddir}/libelf/*.o; do ++ for f in ${abs_top_builddir}/libelf/libelf_a-*.o; do + testrun ${abs_builddir}/arextract $archive `basename $f` arextract.test || exit 1 + cmp $f arextract.test || { + echo "Extraction of $1 failed" +diff --git a/tests/run-dwarfcfi.sh b/tests/run-dwarfcfi.sh +index 98fa171..87691ae 100755 +--- a/tests/run-dwarfcfi.sh ++++ b/tests/run-dwarfcfi.sh +@@ -98,23 +98,6 @@ testrun_compare ${abs_builddir}/dwarfcfi testfileppc64-debugframe 0x000000001000 + reg9: undefined + EOF + +-testfiles testfilearm-debugframe +-testrun_compare ${abs_builddir}/dwarfcfi testfilearm-debugframe 0x00008510 <<\EOF +-0x8510 => [0x8510, 0x8524): +- return address in reg14 +- CFA location expression: bregx(13) +- reg0: undefined +- reg1: undefined +- reg2: undefined +- reg3: undefined +- reg4: same_value +- reg5: same_value +- reg6: same_value +- reg7: same_value +- reg8: same_value +- reg9: undefined +-EOF +- + testfiles testfileaarch64-debugframe + testrun_compare ${abs_builddir}/dwarfcfi testfileaarch64-debugframe 0x400550 <<\EOF + 0x400550 => [0x400550, 0x400568): +diff --git a/tests/run-elflint-test.sh b/tests/run-elflint-test.sh +index caf172a..bd88611 100755 +--- a/tests/run-elflint-test.sh ++++ b/tests/run-elflint-test.sh +@@ -31,12 +31,14 @@ testfiles testfile33 + testrun ${abs_top_builddir}/src/elflint -q testfile33 + + testfiles testfile42 +-testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testfile42 ++# sparc unsupported ++#testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testfile42 + + # Contains debuginfo, compress it, recheck + tempfiles testfile42z + testrun ${abs_top_builddir}/src/elfcompress -f -q -o testfile42z testfile42 +-testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testfile42z ++# sparc unsupported ++#testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testfile42z + + testfiles testfile46 + testrun ${abs_top_builddir}/src/elflint -q testfile46 +diff --git a/tests/run-readelf-A.sh b/tests/run-readelf-A.sh +index b7432be..46e7a42 100755 +--- a/tests/run-readelf-A.sh ++++ b/tests/run-readelf-A.sh +@@ -18,51 +18,19 @@ + + . $srcdir/test-subr.sh + +-# See run-addrcfi.sh for testfilearm. +- + # = testfileppc32attrs.s = + # .gnu_attribute 8,1 + # .gnu_attribute 12,1 + # + # gcc -m32 -c testfileppc32attrs.s + +-# = testfilesparc64attrs.s = +-# .gnu_attribute 4,0x0aaaaaaa +-# .gnu_attribute 8,0x00000055 +-# +-# gcc -c testfilesparc64attrs.s +- + # = testfileppc64attrs.s = + # .gnu_attribute 4,3 + # + # gcc -c testfileppc64attrs.s + +-testfiles testfilearm testfileppc32attrs.o testfilesparc64attrs.o testfileppc64attrs.o + +-testrun_compare ${abs_top_builddir}/src/readelf -A testfilearm <<\EOF +- +-Object attributes section [27] '.ARM.attributes' of 53 bytes at offset 0x718: +- Owner Size +- aeabi 52 +- File: 42 +- CPU_name: 7-A +- CPU_arch: v7 +- CPU_arch_profile: Application +- ARM_ISA_use: Yes +- THUMB_ISA_use: Thumb-2 +- VFP_arch: VFPv3-D16 +- ABI_PCS_wchar_t: 4 +- ABI_FP_rounding: Needed +- ABI_FP_denormal: Needed +- ABI_FP_exceptions: Needed +- ABI_FP_number_model: IEEE 754 +- ABI_align8_needed: Yes +- ABI_align8_preserved: Yes, except leaf SP +- ABI_enum_size: int +- ABI_HardFP_use: SP and DP +- ABI_VFP_args: VFP registers +- CPU_unaligned_access: v6 +-EOF ++testfiles testfileppc32attrs.o testfileppc64attrs.o + + testrun_compare ${abs_top_builddir}/src/readelf -A testfileppc32attrs.o <<\EOF + +@@ -74,16 +42,6 @@ Object attributes section [ 4] '.gnu.attributes' of 18 bytes at offset 0x34: + GNU_Power_ABI_Struct_Return: r3/r4 + EOF + +-testrun_compare ${abs_top_builddir}/src/readelf -A testfilesparc64attrs.o <<\EOF +- +-Object attributes section [ 4] '.gnu.attributes' of 21 bytes at offset 0x40: +- Owner Size +- gnu 20 +- File: 12 +- GNU_Sparc_HWCAPS: div32,v8plus,vis,asi_blk_init,vis3,random,fjfmau,asi_cache_sparing,des,camellia,sha1,sha512,mont,cbcond +- GNU_Sparc_HWCAPS2: fjathplus,adp,mwait,xmont +-EOF +- + testrun_compare ${abs_top_builddir}/src/readelf -A testfileppc64attrs.o <<\EOF + + Object attributes section [ 4] '.gnu.attributes' of 16 bytes at offset 0x40: +diff --git a/tests/run-readelf-mixed-corenote.sh b/tests/run-readelf-mixed-corenote.sh +index c960f1d..382ea14 100755 +--- a/tests/run-readelf-mixed-corenote.sh ++++ b/tests/run-readelf-mixed-corenote.sh +@@ -18,73 +18,6 @@ + + . $srcdir/test-subr.sh + +-testfiles testfile63 +- +-testrun_compare ${abs_top_builddir}/src/readelf -n testfile63 <<\EOF +- +-Note segment of 892 bytes at offset 0x274: +- Owner Data size Type +- CORE 148 PRSTATUS +- info.si_signo: 11, info.si_code: 0, info.si_errno: 0, cursig: 11 +- sigpend: <> +- sighold: <> +- pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063 +- utime: 0.000000, stime: 0.010000, cutime: 0.000000, cstime: 0.000000 +- orig_r0: -1, fpvalid: 1 +- r0: 1 r1: -1091672508 r2: -1091672500 +- r3: 0 r4: 0 r5: 0 +- r6: 33728 r7: 0 r8: 0 +- r9: 0 r10: -1225703496 r11: -1091672844 +- r12: 0 sp: 0xbeee64f4 lr: 0xb6dc3f48 +- pc: 0x00008500 spsr: 0x60000010 +- CORE 124 PRPSINFO +- state: 0, sname: R, zomb: 0, nice: 0, flag: 0x00400500 +- uid: 0, gid: 0, pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063 +- fname: a.out, psargs: ./a.out +- CORE 144 AUXV +- HWCAP: 0xe8d7 +- PAGESZ: 4096 +- CLKTCK: 100 +- PHDR: 0x8034 +- PHENT: 32 +- PHNUM: 8 +- BASE: 0xb6eee000 +- FLAGS: 0 +- ENTRY: 0x83c0 +- UID: 0 +- EUID: 0 +- GID: 0 +- EGID: 0 +- SECURE: 0 +- RANDOM: 0xbeee674e +- EXECFN: 0xbeee6ff4 +- PLATFORM: 0xbeee675e +- NULL +- CORE 116 FPREGSET +- f0: 0x000000000000000000000000 f1: 0x000000000000000000000000 +- f2: 0x000000000000000000000000 f3: 0x000000000000000000000000 +- f4: 0x000000000000000000000000 f5: 0x000000000000000000000000 +- f6: 0x000000000000000000000000 f7: 0x000000000000000000000000 +- LINUX 260 ARM_VFP +- fpscr: 0x00000000 +- d0: 0x0000000000000000 d1: 0x0000000000000000 +- d2: 0x0000000000000000 d3: 0x0000000000000000 +- d4: 0x0000000000000000 d5: 0x0000000000000000 +- d6: 0x0000000000000000 d7: 0x0000000000000000 +- d8: 0x0000000000000000 d9: 0x0000000000000000 +- d10: 0x0000000000000000 d11: 0x0000000000000000 +- d12: 0x0000000000000000 d13: 0x0000000000000000 +- d14: 0x0000000000000000 d15: 0x0000000000000000 +- d16: 0x0000000000000000 d17: 0x0000000000000000 +- d18: 0x0000000000000000 d19: 0x0000000000000000 +- d20: 0x0000000000000000 d21: 0x0000000000000000 +- d22: 0x0000000000000000 d23: 0x0000000000000000 +- d24: 0x0000000000000000 d25: 0x0000000000000000 +- d26: 0x0000000000000000 d27: 0x0000000000000000 +- d28: 0x0000000000000000 d29: 0x0000000000000000 +- d30: 0x0000000000000000 d31: 0x0000000000000000 +-EOF +- + testfiles testfile67 + testrun_compare ${abs_top_builddir}/src/readelf -n testfile67 <<\EOF + +@@ -582,138 +515,4 @@ Note segment of 2548 bytes at offset 0x234: + LINUX 832 X86_XSTATE + EOF + +-# To reproduce this core dump, do this on an m68k machine: +-# $ gcc -x c <(echo 'int main () { return *(int *)0x12345678; }') +-# $ ./a.out +-testfiles testfile-m68k-core +-testrun_compare ${abs_top_builddir}/src/readelf -n testfile-m68k-core <<\EOF +- +-Note segment of 1056 bytes at offset 0x1f4: +- Owner Data size Type +- CORE 154 PRSTATUS +- info.si_signo: 11, info.si_code: 0, info.si_errno: 0, cursig: 11 +- sigpend: <> +- sighold: <> +- pid: 1963, ppid: 1084, pgrp: 1963, sid: 1084 +- utime: 0.000000, stime: 0.010000, cutime: 0.000000, cstime: 0.000000 +- fpvalid: 1 +- d1: 1 d2: 0 d3: -2146476616 d4: -2146476616 +- d5: 0 d6: -2147393212 d7: -2144827216 a0: 0x12345678 +- a1: 0xefe71460 a2: 0x00000000 a3: 0x80288df8 a4: 0x80000340 +- a5: 0xc017a000 a6: 0xefe71434 d0: -1073595312 a7: 0xefe71434 +- pc: 0x800003fe +- CORE 124 PRPSINFO +- state: 0, sname: R, zomb: 0, nice: 0, flag: 0x00400600 +- uid: 1000, gid: 501, pid: 1963, ppid: 1084, pgrp: 1963, sid: 1084 +- fname: a.out, psargs: ./a.out +- CORE 128 SIGINFO +- si_signo: 11, si_errno: 0, si_code: 1 +- fault address: 0x12345678 +- CORE 136 AUXV +- HWCAP: 0 +- PAGESZ: 4096 +- CLKTCK: 100 +- PHDR: 0x80000034 +- PHENT: 32 +- PHNUM: 9 +- BASE: 0xc0000000 +- FLAGS: 0 +- ENTRY: 0x80000340 +- UID: 1000 +- EUID: 1000 +- GID: 501 +- EGID: 501 +- SECURE: 0 +- RANDOM: 0xefe716d9 +- EXECFN: 0xefe71ff4 +- NULL +- CORE 281 FILE +- 10 files: +- 80000000-80001000 00000000 4096 /tmp/a.out +- 80003000-80004000 00001000 4096 /tmp/a.out +- 80004000-80005000 00002000 4096 /tmp/a.out +- c0000000-c001c000 00000000 114688 /lib/ld-2.23.so +- c001f000-c0020000 0001d000 4096 /lib/ld-2.23.so +- c0020000-c0021000 0001e000 4096 /lib/ld-2.23.so +- c0032000-c0177000 00000000 1331200 /lib/libc-2.23.so +- c0177000-c0178000 00145000 4096 /lib/libc-2.23.so +- c0178000-c017a000 00144000 8192 /lib/libc-2.23.so +- c017a000-c017e000 00146000 16384 /lib/libc-2.23.so +- CORE 108 FPREGSET +- fp0: 0x7fff0000ffffffffffffffff fp1: 0x7fff0000ffffffffffffffff +- fp2: 0x7fff0000ffffffffffffffff fp3: 0x7fff0000ffffffffffffffff +- fp4: 0x7fff0000ffffffffffffffff fp5: 0x7fff0000ffffffffffffffff +- fp6: 0x7fff0000ffffffffffffffff fp7: 0x7fff0000ffffffffffffffff +-EOF +- +-# To reproduce this core dump, do this on a riscv64 machine: +-# $ gcc -x c <(echo 'int main () { return *(int *)0x12345678; }') +-# $ ./a.out +-testfiles testfile-riscv64-core +-testrun_compare ${abs_top_builddir}/src/readelf -n testfile-riscv64-core <<\EOF +- +-Note segment of 1408 bytes at offset 0x388: +- Owner Data size Type +- CORE 376 PRSTATUS +- info.si_signo: 11, info.si_code: 0, info.si_errno: 0, cursig: 11 +- sigpend: <> +- sighold: <> +- pid: 6801, ppid: 1155, pgrp: 6801, sid: 1155 +- utime: 0.000000, stime: 0.110000, cutime: 0.000000, cstime: 0.000000 +- pc: 0x000000000001049a, fpvalid: 0 +- ra: 0x0000002000051c9a sp: 0x0000003fff981240 +- gp: 0x0000000000012828 tp: 0x00000020000311d0 +- t0: 137439068496 t1: 137439288314 +- t2: 74672 s0: 274871095888 +- s1: 66724 a0: 1 +- a1: 274871096232 a2: 274871096248 +- a3: 0 a4: 274871095928 +- a5: 305419896 a6: 137440357656 +- a7: 0 s2: 183254994416 +- s3: 137439062288 s4: 0 +- s5: 183257703888 s6: 183256061824 +- s7: 0 s8: 183252656348 +- s9: 183257666368 s10: 183257700608 +- s11: 0 t3: 130042 +- t4: 2 t5: 3 +- t6: 15632 +- CORE 136 PRPSINFO +- state: 0, sname: R, zomb: 0, nice: 0, flag: 0x0000000000400600 +- uid: 0, gid: 0, pid: 6801, ppid: 1155, pgrp: 6801, sid: 1155 +- fname: a.out, psargs: /tmp/a.out +- CORE 128 SIGINFO +- si_signo: 11, si_errno: 0, si_code: 1 +- fault address: 0x12345678 +- CORE 288 AUXV +- SYSINFO_EHDR: 0x200001d000 +- HWCAP: 0x1105 +- PAGESZ: 4096 +- CLKTCK: 100 +- PHDR: 0x10040 +- PHENT: 56 +- PHNUM: 9 +- BASE: 0x2000000000 +- FLAGS: 0 +- ENTRY: 0x103e0 +- UID: 0 +- EUID: 0 +- GID: 0 +- EGID: 0 +- SECURE: 0 +- RANDOM: 0x3fff9816d6 +- EXECFN: 0x3fff981fed +- NULL +- CORE 379 FILE +- 9 files: +- 00010000-00011000 00000000 4096 /tmp/a.out +- 00011000-00012000 00000000 4096 /tmp/a.out +- 00012000-00013000 00001000 4096 /tmp/a.out +- 2000000000-200001a000 00000000 106496 /lib64/ld-2.27.so +- 200001a000-200001b000 00019000 4096 /lib64/ld-2.27.so +- 200001b000-200001c000 0001a000 4096 /lib64/ld-2.27.so +- 2000032000-2000151000 00000000 1175552 /lib64/libc-2.27.so +- 2000151000-2000155000 0011e000 16384 /lib64/libc-2.27.so +- 2000155000-2000157000 00122000 8192 /lib64/libc-2.27.so +-EOF +- + exit 0 +diff --git a/tests/run-strip-g.sh b/tests/run-strip-g.sh +index 1303819..8024aa5 100755 +--- a/tests/run-strip-g.sh ++++ b/tests/run-strip-g.sh +@@ -49,31 +49,6 @@ if test $status -ne 1; then + exit 1 + fi + +-# arm (with data marker in .debug_frame). See tests/run-addrcfi.sh +-testfiles testfilearm +- +-echo arm strip -g to file with debug file +-testrun ${abs_top_builddir}/src/strip -g -o strip.out -f debug.out testfilearm || +- { echo "*** failed to strip -g -o strip.out -f debug.out a.out"; exit -1; } +- +-status=0 +-testrun ${abs_top_builddir}/src/readelf -S strip.out > readelf.out +-grep SYMTAB readelf.out || status=$? +-echo $status +-if test $status -ne 0; then +- echo no symtab found in strip.out +- exit 1 +-fi +- +-status=0 +-testrun ${abs_top_builddir}/src/readelf -S debug.out > readelf.out +-grep SYMTAB readelf.out || status=$? +-echo $status +-if test $status -ne 1; then +- echo symtab found in debug.out +- exit 1 +-fi +- + # aarch64 (with data marker in .debug_frame). See tests/run-addrcfi.sh + testfiles testfileaarch64 + +diff --git a/tests/run-strip-reloc.sh b/tests/run-strip-reloc.sh +index 0c6b1c2..3523f07 100755 +--- a/tests/run-strip-reloc.sh ++++ b/tests/run-strip-reloc.sh +@@ -18,7 +18,7 @@ + . $srcdir/test-subr.sh + + testfiles hello_i386.ko hello_x86_64.ko hello_ppc64.ko hello_s390.ko \ +- hello_aarch64.ko hello_m68k.ko hello_riscv64.ko ++ hello_aarch64.ko + + tempfiles readelf.out readelf.out1 readelf.out2 + tempfiles out.stripped1 out.debug1 out.stripped2 out.debug2 +@@ -117,8 +117,6 @@ runtest hello_x86_64.ko 1 + runtest hello_ppc64.ko 1 + runtest hello_s390.ko 1 + runtest hello_aarch64.ko 1 +-runtest hello_m68k.ko 1 +-runtest hello_riscv64.ko 1 + + # self test, shouldn't impact non-ET_REL files at all. + runtest ${abs_top_builddir}/src/strip 0 diff --git a/elfutils-0.176-elf-update.patch b/elfutils-0.176-elf-update.patch new file mode 100644 index 0000000..501c103 --- /dev/null +++ b/elfutils-0.176-elf-update.patch @@ -0,0 +1,664 @@ +commit d7193bd7c9dc2a979352eee7fc446dacd3e97779 +Author: Mark Wielaard +Date: Sun May 12 00:37:45 2019 +0200 + + libelf: Mark shdr_flags dirty if offset or size changes during update. + + We forgot to mark the shdr_flags dirty when only the sh_size or + sh_offset changed during elf_update (). This meant that if there were + no other shdr changes we only wrote out the section data, but didn't + write out the shdr table to the file. + + Add a testcase that puts some sections in the reverse order and then + writes out the resulting file again without doing any other + updates. This would show the issue after write out of the + (re-reversed) ELF file (the .shstrtab section offset would be wrong + causing all section names to be garbage). Also run a self test. + + Signed-off-by: Mark Wielaard + +diff --git a/libelf/elf32_updatenull.c b/libelf/elf32_updatenull.c +index 2ce6a59..303055a 100644 +--- a/libelf/elf32_updatenull.c ++++ b/libelf/elf32_updatenull.c +@@ -366,12 +366,15 @@ __elfw2(LIBELFBITS,updatenull_wrlock) (Elf *elf, int *change_bop, size_t shnum) + } + + /* See whether the section size is correct. */ ++ int size_changed = 0; + update_if_changed (shdr->sh_size, (GElf_Word) offset, +- changed); ++ size_changed); ++ changed |= size_changed; + + if (shdr->sh_type != SHT_NOBITS) + size += offset; + ++ scn->shdr_flags |= (offset_changed | size_changed); + scn->flags |= changed; + } + +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 80900e4..87428aa 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -60,7 +60,7 @@ check_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \ + fillfile dwarf_default_lower_bound dwarf-die-addr-die \ + get-units-invalid get-units-split attr-integrate-skel \ + all-dwarf-ranges unit-info next_cfi \ +- elfcopy addsections xlate_notes ++ elfcopy addsections xlate_notes elfrdwrnop + + asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \ + asm-tst6 asm-tst7 asm-tst8 asm-tst9 +@@ -157,6 +157,7 @@ TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile test-nlist \ + run-all-dwarf-ranges.sh run-unit-info.sh \ + run-reloc-bpf.sh \ + run-next-cfi.sh run-next-cfi-self.sh \ ++ run-reverse-sections.sh run-reverse-sections-self.sh \ + run-copyadd-sections.sh run-copymany-sections.sh \ + run-typeiter-many.sh run-strip-test-many.sh \ + run-strip-version.sh run-xlate-note.sh +@@ -419,6 +420,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh run-ar.sh \ + run-unit-info.sh run-next-cfi.sh run-next-cfi-self.sh \ + testfile-riscv64.bz2 testfile-riscv64-s.bz2 \ + testfile-riscv64-core.bz2 \ ++ run-reverse-sections.sh run-reverse-sections-self.sh \ + run-copyadd-sections.sh run-copymany-sections.sh \ + run-typeiter-many.sh run-strip-test-many.sh \ + testfile-debug-rel-ppc64-g.o.bz2 \ +@@ -598,6 +600,7 @@ next_cfi_LDADD = $(libelf) $(libdw) + elfcopy_LDADD = $(libelf) + addsections_LDADD = $(libelf) + xlate_notes_LDADD = $(libelf) ++elfrdwrnop_LDADD = $(libelf) + + # We want to test the libelf header against the system elf.h header. + # Don't include any -I CPPFLAGS. Except when we install our own elf.h. +diff --git a/tests/elfcopy.c b/tests/elfcopy.c +index 9000cc9..d457bad 100644 +--- a/tests/elfcopy.c ++++ b/tests/elfcopy.c +@@ -69,9 +69,11 @@ setshstrndx (Elf *elf, size_t ndx) + + /* Copies all elements of an ELF file either using mmap or read. */ + static void +-copy_elf (const char *in, const char *out, bool use_mmap) ++copy_elf (const char *in, const char *out, bool use_mmap, bool reverse_offs) + { +- printf ("\ncopy_elf: %s -> %s (%s)\n", in, out, use_mmap ? "mmap" : "read"); ++ printf ("\ncopy_elf: %s -> %s (%s,%s)\n", in, out, ++ use_mmap ? "mmap" : "read", ++ reverse_offs ? "reverse" : "same"); + + /* Existing ELF file. */ + int fda = open (in, O_RDONLY); +@@ -182,8 +184,28 @@ copy_elf (const char *in, const char *out, bool use_mmap) + } + } + ++ GElf_Off *offs = NULL; ++ size_t shnum; ++ if (reverse_offs) ++ { ++ if (elf_getshdrnum (elfa, &shnum) < 0) ++ { ++ printf ("couldn't get shdrnum: %s\n", elf_errmsg (-1)); ++ exit (1); ++ } ++ ++ offs = (GElf_Off *) malloc (shnum * sizeof (GElf_Off)); ++ if (offs == NULL) ++ { ++ printf ("couldn't allocate memory for offs\n"); ++ exit (1); ++ } ++ } ++ + /* Copy all sections, headers and data. */ + Elf_Scn *scn = NULL; ++ size_t last_off = 0; ++ GElf_Shdr last_shdr = { .sh_type = SHT_NULL }; + while ((scn = elf_nextscn (elfa, scn)) != NULL) + { + /* Get the header. */ +@@ -194,6 +216,34 @@ copy_elf (const char *in, const char *out, bool use_mmap) + exit (1); + } + ++ if (reverse_offs) ++ { ++ offs[last_off] = shdr.sh_offset; ++ ++ if (last_shdr.sh_type != SHT_NULL ++ && last_shdr.sh_addralign == shdr.sh_addralign ++ && shdr.sh_addralign == 1 ++ && last_shdr.sh_type != SHT_NOBITS ++ && shdr.sh_type != SHT_NOBITS ++ && (phnum == 0 ++ || ((shdr.sh_flags & SHF_ALLOC) == 0 ++ && (last_shdr.sh_flags & SHF_ALLOC) == 0))) ++ { ++ printf ("Swapping offsets of section %zd and %zd\n", ++ last_off, last_off + 1); ++ GElf_Word off = offs[last_off - 1]; ++ offs[last_off - 1] = off + shdr.sh_size; ++ offs[last_off] = off; ++ last_shdr.sh_type = SHT_NULL; ++ } ++ else ++ { ++ last_shdr = shdr; ++ offs[last_off] = shdr.sh_offset; ++ } ++ last_off++; ++ } ++ + /* Create new section. */ + Elf_Scn *new_scn = elf_newscn (elfb); + if (new_scn == NULL) +@@ -223,9 +273,34 @@ copy_elf (const char *in, const char *out, bool use_mmap) + } + } + +- /* Write everything to disk. If there are any phdrs then we want +- the exact same layout. Do we want ELF_F_PERMISSIVE? */ +- if (phnum > 0) ++ if (reverse_offs) ++ { ++ last_off = 0; ++ scn = NULL; ++ while ((scn = elf_nextscn (elfb, scn)) != NULL) ++ { ++ GElf_Shdr shdr; ++ if (gelf_getshdr (scn, &shdr) == NULL) ++ { ++ printf ("couldn't get shdr for updating: %s\n", elf_errmsg (-1)); ++ exit (1); ++ } ++ ++ shdr.sh_offset = offs[last_off++]; ++ ++ if (gelf_update_shdr (scn, &shdr) == 0) ++ { ++ printf ("couldn't update shdr sh_off: %s\n", elf_errmsg (-1)); ++ exit (1); ++ } ++ } ++ free (offs); ++ } ++ ++ /* Write everything to disk. If there are any phdrs, or we want to ++ update the offsets, then we want the exact same layout. Do we ++ want ELF_F_PERMISSIVE? */ ++ if (phnum > 0 || reverse_offs) + elf_flagelf (elfb, ELF_C_SET, ELF_F_LAYOUT); + if (elf_update (elfb, ELF_C_WRITE) < 0) + { +@@ -264,9 +339,9 @@ main (int argc, const char *argv[]) + elf_version (EV_CURRENT); + + /* Takes the given file, and create a new identical one. */ +- if (argc < 3 || argc > 4) ++ if (argc < 3 || argc > 5) + { +- fprintf (stderr, "elfcopy [--mmap] in.elf out.elf\n"); ++ fprintf (stderr, "elfcopy [--mmap] [--reverse-offs] in.elf out.elf\n"); + exit (1); + } + +@@ -278,9 +353,16 @@ main (int argc, const char *argv[]) + argn++; + } + ++ bool reverse_offs = false; ++ if (strcmp (argv[argn], "--reverse-offs") == 0) ++ { ++ reverse_offs = true; ++ argn++; ++ } ++ + const char *in = argv[argn++]; + const char *out = argv[argn]; +- copy_elf (in, out, use_mmap); ++ copy_elf (in, out, use_mmap, reverse_offs); + + return 0; + } +diff --git a/tests/elfrdwrnop.c b/tests/elfrdwrnop.c +new file mode 100644 +index 0000000..997150b +--- /dev/null ++++ b/tests/elfrdwrnop.c +@@ -0,0 +1,100 @@ ++/* Test program for reading and writing out the same file in-place ++ Copyright (C) 2019 Red Hat, Inc. ++ This file is part of elfutils. ++ ++ This file is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ elfutils is distributed in the hope that it will be useful, but ++ WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ELFUTILS_HEADER(elf) ++#include ++ ++ ++int ++main (int argc, const char *argv[]) ++{ ++ /* Takes the given file, and create a new identical one. */ ++ if (argc != 2) ++ { ++ fprintf (stderr, "elfrdwrnop elf-file\n"); ++ exit (1); ++ } ++ ++ elf_version (EV_CURRENT); ++ ++ const char *name = argv[1]; ++ printf ("elfrdwrdnop %s\n", name); ++ ++ int fd = open (name, O_RDWR); ++ if (fd < 0) ++ { ++ fprintf (stderr, "Couldn't open file '%s': %s\n", ++ name, strerror (errno)); ++ exit (1); ++ } ++ ++ Elf *elf = elf_begin (fd, ELF_C_RDWR, NULL); ++ if (elf == NULL) ++ { ++ fprintf (stderr, "Couldn't open ELF file '%s': %s\n", ++ name, elf_errmsg (-1)); ++ exit (1); ++ } ++ ++ /* Write everything to disk. If there are any phdrs, then we want ++ the exact same layout. */ ++ size_t phnum; ++ if (elf_getphdrnum (elf, &phnum) != 0) ++ { ++ printf ("cannot get phdrs: %s\n", elf_errmsg (-1)); ++ exit (1); ++ } ++ ++ if (phnum > 0) ++ elf_flagelf (elf, ELF_C_SET, ELF_F_LAYOUT); ++ ++ if (elf_update (elf, ELF_C_WRITE) < 0) ++ { ++ printf ("failure in elf_update: %s\n", elf_errmsg (-1)); ++ exit (1); ++ } ++ ++ if (elf_end (elf) != 0) ++ { ++ printf ("couldn't cleanup elf '%s': %s\n", name, elf_errmsg (-1)); ++ exit (1); ++ } ++ ++ if (close (fd) != 0) ++ { ++ printf ("couldn't close '%s': %s\n", name, strerror (errno)); ++ exit (1); ++ } ++ ++ return 0; ++} +diff --git a/tests/run-reverse-sections-self.sh b/tests/run-reverse-sections-self.sh +new file mode 100755 +index 0000000..71afd6a +--- /dev/null ++++ b/tests/run-reverse-sections-self.sh +@@ -0,0 +1,45 @@ ++#! /bin/sh ++# Copyright (C) 2019 Red Hat, Inc. ++# This file is part of elfutils. ++# ++# This file is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# elfutils is distributed in the hope that it will be useful, but ++# WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++. $srcdir/test-subr.sh ++ ++test_reverse_self () ++{ ++ in_file="$1" ++ base_name="$(basename ${in_file})" ++ out_file="${base_name}.rev" ++ out_file_mmap="${out_file}.mmap" ++ ++ tempfiles ${out_file} ${out_file_mmap} ++ ++ # Reverse the offsets (the files should still be the same otherwise) ++ testrun ${abs_builddir}/elfcopy --reverse-offs ${in_file} ${out_file} ++ testrun ${abs_top_builddir}/src/elfcmp ${in_file} ${out_file} ++ testrun ${abs_top_builddir}/src/elflint --gnu ${out_file} ++ # An in-place nop will likely revert them back ++ testrun ${abs_builddir}/elfrdwrnop ${out_file} ++ testrun ${abs_top_builddir}/src/elfcmp ${in_file} ${out_file} ++ testrun ${abs_top_builddir}/src/elflint --gnu ${out_file} ++} ++ ++# Only really makes sense for ET_REL files, but try all, just to check ++# it also works if we keep the order for the allocated sections. ++for file in $self_test_files; do ++ test_reverse_self $file ++done ++ ++exit 0 +diff --git a/tests/run-reverse-sections.sh b/tests/run-reverse-sections.sh +new file mode 100755 +index 0000000..102a126 +--- /dev/null ++++ b/tests/run-reverse-sections.sh +@@ -0,0 +1,69 @@ ++#! /bin/sh ++# Copyright (C) 2019 Red Hat, Inc. ++# This file is part of elfutils. ++# ++# This file is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# elfutils is distributed in the hope that it will be useful, but ++# WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++. $srcdir/test-subr.sh ++ ++test_reverse () ++{ ++ in_file="$1" ++ out_file="${in_file}.rev" ++ out_file_mmap="${out_file}.mmap" ++ ++ testfiles ${in_file} ++ tempfiles ${out_file} ${out_file_mmap} ++ ++ # Reverse the offsets (the files should still be the same otherwise) ++ testrun ${abs_builddir}/elfcopy --reverse-offs ${in_file} ${out_file} ++ testrun ${abs_top_builddir}/src/elfcmp ${in_file} ${out_file} ++ testrun ${abs_top_builddir}/src/elflint --gnu ${out_file} ++ # An in-place nop will likely revert them back ++ testrun ${abs_builddir}/elfrdwrnop ${out_file} ++ testrun ${abs_top_builddir}/src/elfcmp ${in_file} ${out_file} ++ testrun ${abs_top_builddir}/src/elflint --gnu ${out_file} ++} ++ ++# A collection of random testfiles to test 32/64bit, little/big endian ++# and non-ET_REL (with phdrs)/ET_REL (without phdrs). ++ ++# 32bit, big endian, rel ++test_reverse testfile29 ++ ++# 64bit, big endian, rel ++test_reverse testfile23 ++ ++# 32bit, little endian, rel ++test_reverse testfile9 ++ ++# 64bit, little endian, rel ++test_reverse testfile38 ++ ++# 32bit, big endian, non-rel ++test_reverse testfile26 ++ ++# 64bit, big endian, non-rel ++test_reverse testfile27 ++ ++# 32bit, little endian, non-rel ++test_reverse testfile ++ ++# 64bit, little endian, non-rel ++# Don't use testfile10. It has section headers in the middle of the file. ++# Same for testfile12. It is legal, but not the point of this testcase. ++# test_reverse testfile10 ++test_reverse testfile13 ++ ++exit 0 +diff -ru elfutils-0.176.orig/tests/Makefile.in elfutils-0.176/tests/Makefile.in +--- elfutils-0.176.orig/tests/Makefile.in 2019-06-03 14:57:17.223607024 +0200 ++++ elfutils-0.176/tests/Makefile.in 2019-06-03 14:58:32.671049626 +0200 +@@ -131,8 +131,8 @@ + get-units-invalid$(EXEEXT) get-units-split$(EXEEXT) \ + attr-integrate-skel$(EXEEXT) all-dwarf-ranges$(EXEEXT) \ + unit-info$(EXEEXT) next_cfi$(EXEEXT) elfcopy$(EXEEXT) \ +- addsections$(EXEEXT) xlate_notes$(EXEEXT) $(am__EXEEXT_1) \ +- $(am__EXEEXT_2) $(am__EXEEXT_4) ++ addsections$(EXEEXT) xlate_notes$(EXEEXT) elfrdwrnop$(EXEEXT) \ ++ $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_4) + @BIARCH_TRUE@am__append_5 = backtrace-child-biarch + TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile$(EXEEXT) \ + test-nlist$(EXEEXT) update1$(EXEEXT) update2$(EXEEXT) \ +@@ -209,7 +209,8 @@ + run-get-units-invalid.sh run-get-units-split.sh \ + run-attr-integrate-skel.sh run-all-dwarf-ranges.sh \ + run-unit-info.sh run-reloc-bpf.sh run-next-cfi.sh \ +- run-next-cfi-self.sh run-copyadd-sections.sh \ ++ run-next-cfi-self.sh run-reverse-sections.sh \ ++ run-reverse-sections-self.sh run-copyadd-sections.sh \ + run-copymany-sections.sh run-typeiter-many.sh \ + run-strip-test-many.sh run-strip-version.sh run-xlate-note.sh \ + $(am__EXEEXT_2) $(am__append_8) $(am__EXEEXT_5) +@@ -451,6 +452,9 @@ + elfputzdata_SOURCES = elfputzdata.c + elfputzdata_OBJECTS = elfputzdata.$(OBJEXT) + elfputzdata_DEPENDENCIES = $(am__DEPENDENCIES_2) ++elfrdwrnop_SOURCES = elfrdwrnop.c ++elfrdwrnop_OBJECTS = elfrdwrnop.$(OBJEXT) ++elfrdwrnop_DEPENDENCIES = $(am__DEPENDENCIES_2) + elfshphehdr_SOURCES = elfshphehdr.c + elfshphehdr_OBJECTS = elfshphehdr.$(OBJEXT) + elfshphehdr_DEPENDENCIES = $(am__DEPENDENCIES_2) +@@ -660,13 +664,13 @@ + ./$(DEPDIR)/early-offscn.Po ./$(DEPDIR)/ecp.Po \ + ./$(DEPDIR)/elfcopy.Po ./$(DEPDIR)/elfgetchdr.Po \ + ./$(DEPDIR)/elfgetzdata.Po ./$(DEPDIR)/elfputzdata.Po \ +- ./$(DEPDIR)/elfshphehdr.Po ./$(DEPDIR)/elfstrmerge.Po \ +- ./$(DEPDIR)/elfstrtab.Po ./$(DEPDIR)/emptyfile.Po \ +- ./$(DEPDIR)/fillfile.Po ./$(DEPDIR)/find-prologues.Po \ +- ./$(DEPDIR)/funcretval.Po ./$(DEPDIR)/funcscopes.Po \ +- ./$(DEPDIR)/get-aranges.Po ./$(DEPDIR)/get-files.Po \ +- ./$(DEPDIR)/get-lines.Po ./$(DEPDIR)/get-pubnames.Po \ +- ./$(DEPDIR)/get-units-invalid.Po \ ++ ./$(DEPDIR)/elfrdwrnop.Po ./$(DEPDIR)/elfshphehdr.Po \ ++ ./$(DEPDIR)/elfstrmerge.Po ./$(DEPDIR)/elfstrtab.Po \ ++ ./$(DEPDIR)/emptyfile.Po ./$(DEPDIR)/fillfile.Po \ ++ ./$(DEPDIR)/find-prologues.Po ./$(DEPDIR)/funcretval.Po \ ++ ./$(DEPDIR)/funcscopes.Po ./$(DEPDIR)/get-aranges.Po \ ++ ./$(DEPDIR)/get-files.Po ./$(DEPDIR)/get-lines.Po \ ++ ./$(DEPDIR)/get-pubnames.Po ./$(DEPDIR)/get-units-invalid.Po \ + ./$(DEPDIR)/get-units-split.Po ./$(DEPDIR)/getsrc_die.Po \ + ./$(DEPDIR)/hash.Po ./$(DEPDIR)/line2addr.Po \ + ./$(DEPDIR)/low_high_pc.Po ./$(DEPDIR)/msg_tst.Po \ +@@ -718,19 +722,19 @@ + dwfl-bug-getmodules.c dwfl-bug-report.c dwfl-proc-attach.c \ + dwfl-report-elf-align.c dwfllines.c dwflmodtest.c dwflsyms.c \ + early-offscn.c ecp.c elfcopy.c elfgetchdr.c elfgetzdata.c \ +- elfputzdata.c elfshphehdr.c elfstrmerge.c elfstrtab.c \ +- emptyfile.c fillfile.c find-prologues.c funcretval.c \ +- funcscopes.c get-aranges.c get-files.c get-lines.c \ +- get-pubnames.c get-units-invalid.c get-units-split.c \ +- getsrc_die.c hash.c line2addr.c low_high_pc.c msg_tst.c \ +- newdata.c newfile.c newscn.c next-files.c next-lines.c \ +- next_cfi.c peel_type.c rdwrmmap.c rerequest_tag.c saridx.c \ +- scnnames.c sectiondump.c show-abbrev.c show-die-info.c \ +- showptable.c strptr.c system-elf-libelf-test.c \ +- test-elf_cntl_gelf_getshdr.c test-flag-nobits.c test-nlist.c \ +- typeiter.c typeiter2.c unit-info.c update1.c update2.c \ +- update3.c update4.c varlocs.c vdsosyms.c vendorelf.c \ +- xlate_notes.c zstrptr.c ++ elfputzdata.c elfrdwrnop.c elfshphehdr.c elfstrmerge.c \ ++ elfstrtab.c emptyfile.c fillfile.c find-prologues.c \ ++ funcretval.c funcscopes.c get-aranges.c get-files.c \ ++ get-lines.c get-pubnames.c get-units-invalid.c \ ++ get-units-split.c getsrc_die.c hash.c line2addr.c \ ++ low_high_pc.c msg_tst.c newdata.c newfile.c newscn.c \ ++ next-files.c next-lines.c next_cfi.c peel_type.c rdwrmmap.c \ ++ rerequest_tag.c saridx.c scnnames.c sectiondump.c \ ++ show-abbrev.c show-die-info.c showptable.c strptr.c \ ++ system-elf-libelf-test.c test-elf_cntl_gelf_getshdr.c \ ++ test-flag-nobits.c test-nlist.c typeiter.c typeiter2.c \ ++ unit-info.c update1.c update2.c update3.c update4.c varlocs.c \ ++ vdsosyms.c vendorelf.c xlate_notes.c zstrptr.c + DIST_SOURCES = addrcfi.c addrscopes.c addsections.c aggregate_size.c \ + all-dwarf-ranges.c alldts.c allfcts.c allregs.c arextract.c \ + arls.c arsymtest.c asm-tst1.c asm-tst2.c asm-tst3.c asm-tst4.c \ +@@ -745,19 +749,19 @@ + dwfl-bug-getmodules.c dwfl-bug-report.c dwfl-proc-attach.c \ + dwfl-report-elf-align.c dwfllines.c dwflmodtest.c dwflsyms.c \ + early-offscn.c ecp.c elfcopy.c elfgetchdr.c elfgetzdata.c \ +- elfputzdata.c elfshphehdr.c elfstrmerge.c elfstrtab.c \ +- emptyfile.c fillfile.c find-prologues.c funcretval.c \ +- funcscopes.c get-aranges.c get-files.c get-lines.c \ +- get-pubnames.c get-units-invalid.c get-units-split.c \ +- getsrc_die.c hash.c line2addr.c low_high_pc.c msg_tst.c \ +- newdata.c newfile.c newscn.c next-files.c next-lines.c \ +- next_cfi.c peel_type.c rdwrmmap.c rerequest_tag.c saridx.c \ +- scnnames.c sectiondump.c show-abbrev.c show-die-info.c \ +- showptable.c strptr.c system-elf-libelf-test.c \ +- test-elf_cntl_gelf_getshdr.c test-flag-nobits.c test-nlist.c \ +- typeiter.c typeiter2.c unit-info.c update1.c update2.c \ +- update3.c update4.c varlocs.c vdsosyms.c vendorelf.c \ +- xlate_notes.c zstrptr.c ++ elfputzdata.c elfrdwrnop.c elfshphehdr.c elfstrmerge.c \ ++ elfstrtab.c emptyfile.c fillfile.c find-prologues.c \ ++ funcretval.c funcscopes.c get-aranges.c get-files.c \ ++ get-lines.c get-pubnames.c get-units-invalid.c \ ++ get-units-split.c getsrc_die.c hash.c line2addr.c \ ++ low_high_pc.c msg_tst.c newdata.c newfile.c newscn.c \ ++ next-files.c next-lines.c next_cfi.c peel_type.c rdwrmmap.c \ ++ rerequest_tag.c saridx.c scnnames.c sectiondump.c \ ++ show-abbrev.c show-die-info.c showptable.c strptr.c \ ++ system-elf-libelf-test.c test-elf_cntl_gelf_getshdr.c \ ++ test-flag-nobits.c test-nlist.c typeiter.c typeiter2.c \ ++ unit-info.c update1.c update2.c update3.c update4.c varlocs.c \ ++ vdsosyms.c vendorelf.c xlate_notes.c zstrptr.c + am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ +@@ -1405,6 +1409,7 @@ + run-unit-info.sh run-next-cfi.sh run-next-cfi-self.sh \ + testfile-riscv64.bz2 testfile-riscv64-s.bz2 \ + testfile-riscv64-core.bz2 \ ++ run-reverse-sections.sh run-reverse-sections-self.sh \ + run-copyadd-sections.sh run-copymany-sections.sh \ + run-typeiter-many.sh run-strip-test-many.sh \ + testfile-debug-rel-ppc64-g.o.bz2 \ +@@ -1566,6 +1571,7 @@ + elfcopy_LDADD = $(libelf) + addsections_LDADD = $(libelf) + xlate_notes_LDADD = $(libelf) ++elfrdwrnop_LDADD = $(libelf) + + # We want to test the libelf header against the system elf.h header. + # Don't include any -I CPPFLAGS. Except when we install our own elf.h. +@@ -1822,6 +1828,10 @@ + @rm -f elfputzdata$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(elfputzdata_OBJECTS) $(elfputzdata_LDADD) $(LIBS) + ++elfrdwrnop$(EXEEXT): $(elfrdwrnop_OBJECTS) $(elfrdwrnop_DEPENDENCIES) $(EXTRA_elfrdwrnop_DEPENDENCIES) ++ @rm -f elfrdwrnop$(EXEEXT) ++ $(AM_V_CCLD)$(LINK) $(elfrdwrnop_OBJECTS) $(elfrdwrnop_LDADD) $(LIBS) ++ + elfshphehdr$(EXEEXT): $(elfshphehdr_OBJECTS) $(elfshphehdr_DEPENDENCIES) $(EXTRA_elfshphehdr_DEPENDENCIES) + @rm -f elfshphehdr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(elfshphehdr_OBJECTS) $(elfshphehdr_LDADD) $(LIBS) +@@ -2086,6 +2096,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elfgetchdr.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elfgetzdata.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elfputzdata.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elfrdwrnop.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elfshphehdr.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elfstrmerge.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elfstrtab.Po@am__quote@ # am--include-marker +@@ -3709,6 +3720,20 @@ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) ++run-reverse-sections.sh.log: run-reverse-sections.sh ++ @p='run-reverse-sections.sh'; \ ++ b='run-reverse-sections.sh'; \ ++ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ ++ --log-file $$b.log --trs-file $$b.trs \ ++ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ ++ "$$tst" $(AM_TESTS_FD_REDIRECT) ++run-reverse-sections-self.sh.log: run-reverse-sections-self.sh ++ @p='run-reverse-sections-self.sh'; \ ++ b='run-reverse-sections-self.sh'; \ ++ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ ++ --log-file $$b.log --trs-file $$b.trs \ ++ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ ++ "$$tst" $(AM_TESTS_FD_REDIRECT) + run-copyadd-sections.sh.log: run-copyadd-sections.sh + @p='run-copyadd-sections.sh'; \ + b='run-copyadd-sections.sh'; \ +@@ -3997,6 +4022,7 @@ + -rm -f ./$(DEPDIR)/elfgetchdr.Po + -rm -f ./$(DEPDIR)/elfgetzdata.Po + -rm -f ./$(DEPDIR)/elfputzdata.Po ++ -rm -f ./$(DEPDIR)/elfrdwrnop.Po + -rm -f ./$(DEPDIR)/elfshphehdr.Po + -rm -f ./$(DEPDIR)/elfstrmerge.Po + -rm -f ./$(DEPDIR)/elfstrtab.Po +@@ -4147,6 +4173,7 @@ + -rm -f ./$(DEPDIR)/elfgetchdr.Po + -rm -f ./$(DEPDIR)/elfgetzdata.Po + -rm -f ./$(DEPDIR)/elfputzdata.Po ++ -rm -f ./$(DEPDIR)/elfrdwrnop.Po + -rm -f ./$(DEPDIR)/elfshphehdr.Po + -rm -f ./$(DEPDIR)/elfstrmerge.Po + -rm -f ./$(DEPDIR)/elfstrtab.Po +diff --git a/tests/elfcopy.c b/tests/elfcopy.c +index d457bad..4542222 100644 +--- a/tests/elfcopy.c ++++ b/tests/elfcopy.c +@@ -225,6 +225,7 @@ copy_elf (const char *in, const char *out, bool use_mmap, bool reverse_offs) + && shdr.sh_addralign == 1 + && last_shdr.sh_type != SHT_NOBITS + && shdr.sh_type != SHT_NOBITS ++ && last_shdr.sh_offset + last_shdr.sh_size == shdr.sh_offset + && (phnum == 0 + || ((shdr.sh_flags & SHF_ALLOC) == 0 + && (last_shdr.sh_flags & SHF_ALLOC) == 0))) diff --git a/elfutils-0.176-gcc-pr88835.patch b/elfutils-0.176-gcc-pr88835.patch new file mode 100644 index 0000000..6571f49 --- /dev/null +++ b/elfutils-0.176-gcc-pr88835.patch @@ -0,0 +1,28 @@ +Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88835 + +diff --git a/src/readelf.c b/src/readelf.c +index 33706bd..b55844c 100644 +--- a/src/readelf.c ++++ b/src/readelf.c +@@ -10143,7 +10143,7 @@ print_debug_str_section (Dwfl_Module *dwflmod __attribute__ ((unused)), + ++digits; + tmp >>= 4; + } +- digits = MAX (4, digits); ++ digits = MIN (16, MAX (4, digits)); + + printf (gettext ("\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n" + " %*s String\n"), +diff --git a/tests/backtrace.c b/tests/backtrace.c +index 05e8ef8..d621fbf 100644 +--- a/tests/backtrace.c ++++ b/tests/backtrace.c +@@ -185,7 +185,7 @@ frame_callback (Dwfl_Frame *state, void *frame_arg) + symname = dwfl_module_addrname (mod, pc_adjusted); + + printf ("#%2d %#" PRIx64 "%4s\t%s\n", *framenop, (uint64_t) pc, +- ! isactivation ? "- 1" : "", symname); ++ ! isactivation ? "- 1" : "", symname ?: ""); + pid_t tid = dwfl_thread_tid (thread); + callback_verify (tid, *framenop, pc, symname, dwfl); + (*framenop)++; diff --git a/elfutils-0.176-strip-symbols-illformed.patch b/elfutils-0.176-strip-symbols-illformed.patch new file mode 100644 index 0000000..a0f22c8 --- /dev/null +++ b/elfutils-0.176-strip-symbols-illformed.patch @@ -0,0 +1,26 @@ +commit f03ac75239e0981deaf4aa18f66f423bcc5ce051 +Author: Mark Wielaard +Date: Wed Mar 27 21:54:06 2019 +0100 + + strip: Files with symbols referring to non-existing sections are illformed + + The check added in commit 4540ea98c "strip: Fix check test for SHN_XINDEX + symbol" was not complete. The (extended) section index should also exist. + If it doesn't exist, mark the file as illformed. + + https://sourceware.org/bugzilla/show_bug.cgi?id=24385 + + Signed-off-by: Mark Wielaard + +diff --git a/src/strip.c b/src/strip.c +index a73009d9..4cd87506 100644 +--- a/src/strip.c ++++ b/src/strip.c +@@ -1975,6 +1975,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, + && shndxdata->d_buf != NULL); + size_t sidx = (sym->st_shndx != SHN_XINDEX + ? sym->st_shndx : xshndx); ++ elf_assert (sidx < shnum); + sec = shdr_info[sidx].idx; + + if (sec != 0) diff --git a/elfutils-0.176-xlate-note.patch b/elfutils-0.176-xlate-note.patch new file mode 100644 index 0000000..e3bbf48 --- /dev/null +++ b/elfutils-0.176-xlate-note.patch @@ -0,0 +1,486 @@ +commit 28b5f578ae772bb2404c3847e4e22ad1c407af54 +Author: Mark Wielaard +Date: Tue Apr 30 13:00:17 2019 +0200 + + libelf: If xlate can only convert the ELF note header, just do that. + + When we started parsing new style ELF_T_NHDR8 notes we added extra + checks on alignment and padding. When those failed we would stop + converting and just return the rest of the ELF Note unconverted. + In the case were we just had enough data for just the ELF Note header + and the destionation and source weren't the same we would then + accidentially throw away the Note header conversion we just did. + + Fix that by indicating we did correctly convert just the header. + + Adds testcase that compares parsing ELF notes with gelf_getnote + and parsing the raw data by hand using elf32_xlatetom using just + the Note header and ignoring the (raw) note data. + + Signed-off-by: Mark Wielaard + +diff --git a/libelf/note_xlate.h b/libelf/note_xlate.h +index bc9950f..7e2784b 100644 +--- a/libelf/note_xlate.h ++++ b/libelf/note_xlate.h +@@ -47,13 +47,25 @@ elf_cvt_note (void *dest, const void *src, size_t len, int encode, + note_len += n->n_namesz; + note_len = nhdr8 ? NOTE_ALIGN8 (note_len) : NOTE_ALIGN4 (note_len); + if (note_len > len || note_len < sizeof *n) +- break; ++ { ++ /* Header was translated, nothing else. */ ++ len -= sizeof *n; ++ src += sizeof *n; ++ dest += sizeof *n; ++ break; ++ } + + /* data as a whole needs to be aligned. */ + note_len += n->n_descsz; + note_len = nhdr8 ? NOTE_ALIGN8 (note_len) : NOTE_ALIGN4 (note_len); + if (note_len > len || note_len < sizeof *n) +- break; ++ { ++ /* Header was translated, nothing else. */ ++ len -= sizeof *n; ++ src += sizeof *n; ++ dest += sizeof *n; ++ break; ++ } + + /* Copy or skip the note data. */ + size_t note_data_len = note_len - sizeof *n; +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 1b0c7d3..498c1db 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -60,7 +60,7 @@ check_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \ + fillfile dwarf_default_lower_bound dwarf-die-addr-die \ + get-units-invalid get-units-split attr-integrate-skel \ + all-dwarf-ranges unit-info next_cfi \ +- elfcopy addsections ++ elfcopy addsections xlate_notes + + asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \ + asm-tst6 asm-tst7 asm-tst8 asm-tst9 +@@ -159,7 +159,7 @@ TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile test-nlist \ + run-next-cfi.sh run-next-cfi-self.sh \ + run-copyadd-sections.sh run-copymany-sections.sh \ + run-typeiter-many.sh run-strip-test-many.sh \ +- run-strip-version.sh ++ run-strip-version.sh run-xlate-note.sh + + if !BIARCH + export ELFUTILS_DISABLE_BIARCH = 1 +@@ -423,7 +423,8 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh run-ar.sh \ + testfile-debug-rel-ppc64-g.o.bz2 \ + testfile-debug-rel-ppc64-z.o.bz2 \ + testfile-debug-rel-ppc64.o.bz2 \ +- run-strip-version.sh testfile-version.bz2 ++ run-strip-version.sh testfile-version.bz2 \ ++ run-xlate-note.sh + + if USE_VALGRIND + valgrind_cmd='valgrind -q --leak-check=full --error-exitcode=1' +@@ -593,6 +594,7 @@ unit_info_LDADD = $(libdw) + next_cfi_LDADD = $(libelf) $(libdw) + elfcopy_LDADD = $(libelf) + addsections_LDADD = $(libelf) ++xlate_notes_LDADD = $(libelf) + + # We want to test the libelf header against the system elf.h header. + # Don't include any -I CPPFLAGS. Except when we install our own elf.h. +diff --git a/tests/run-xlate-note.sh b/tests/run-xlate-note.sh +new file mode 100755 +index 0000000..a907418 +--- /dev/null ++++ b/tests/run-xlate-note.sh +@@ -0,0 +1,93 @@ ++# Copyright (C) 2019 Red Hat, Inc. ++# This file is part of elfutils. ++# ++# This file is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# elfutils is distributed in the hope that it will be useful, but ++# WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++. $srcdir/test-subr.sh ++ ++testfiles testfileppc32 ++testrun_compare ${abs_top_builddir}/tests/xlate_notes testfileppc32 << EOF ++Notes in section 2: ++type: 1,1, namesz: 4,4, descsz: 16,16 ++Notes in section 3: ++type: 3,3, namesz: 4,4, descsz: 20,20 ++EOF ++ ++testfiles testfileppc64 ++testrun_compare ${abs_top_builddir}/tests/xlate_notes testfileppc64 << EOF ++Notes in section 2: ++type: 1,1, namesz: 4,4, descsz: 16,16 ++Notes in section 3: ++type: 3,3, namesz: 4,4, descsz: 20,20 ++EOF ++ ++testfiles testfiles390 ++testrun_compare ${abs_top_builddir}/tests/xlate_notes testfiles390 << EOF ++Notes in section 2: ++type: 1,1, namesz: 4,4, descsz: 16,16 ++Notes in section 3: ++type: 3,3, namesz: 4,4, descsz: 20,20 ++EOF ++ ++testfiles testfiles390x ++testrun_compare ${abs_top_builddir}/tests/xlate_notes testfiles390x << EOF ++Notes in section 2: ++type: 1,1, namesz: 4,4, descsz: 16,16 ++Notes in section 3: ++type: 3,3, namesz: 4,4, descsz: 20,20 ++EOF ++ ++testfiles testfileaarch64 ++testrun_compare ${abs_top_builddir}/tests/xlate_notes testfileaarch64 << EOF ++Notes in section 2: ++type: 1,1, namesz: 4,4, descsz: 16,16 ++Notes in section 3: ++type: 3,3, namesz: 4,4, descsz: 20,20 ++EOF ++ ++testfiles testfilearm ++testrun_compare ${abs_top_builddir}/tests/xlate_notes testfilearm << EOF ++Notes in section 2: ++type: 1,1, namesz: 4,4, descsz: 16,16 ++Notes in section 3: ++type: 3,3, namesz: 4,4, descsz: 20,20 ++EOF ++ ++testfiles testfile_gnu_props.32be.o ++testrun_compare ${abs_top_builddir}/tests/xlate_notes testfile_gnu_props.32be.o << EOF ++Notes in section 4: ++type: 5,5, namesz: 4,4, descsz: 12,12 ++type: 5,5, namesz: 4,4, descsz: 8,8 ++EOF ++ ++testfiles testfile_gnu_props.32le.o ++testrun_compare ${abs_top_builddir}/tests/xlate_notes testfile_gnu_props.32le.o << EOF ++Notes in section 4: ++type: 5,5, namesz: 4,4, descsz: 12,12 ++type: 5,5, namesz: 4,4, descsz: 8,8 ++EOF ++ ++testfiles testfile_gnu_props.64be.o ++testrun_compare ${abs_top_builddir}/tests/xlate_notes testfile_gnu_props.64be.o << EOF ++Notes in section 4: ++type: 5,5, namesz: 4,4, descsz: 16,16 ++type: 5,5, namesz: 4,4, descsz: 8,8 ++EOF ++ ++testfiles testfile_gnu_props.64le.o ++testrun_compare ${abs_top_builddir}/tests/xlate_notes testfile_gnu_props.64le.o << EOF ++Notes in section 4: ++type: 5,5, namesz: 4,4, descsz: 16,16 ++type: 5,5, namesz: 4,4, descsz: 8,8 ++EOF +diff --git a/tests/xlate_notes.c b/tests/xlate_notes.c +new file mode 100644 +index 0000000..90a4ae2 +--- /dev/null ++++ b/tests/xlate_notes.c +@@ -0,0 +1,157 @@ ++/* Test program for extracting ELF Note headers and getting whole notes. ++ Copyright (C) 2019 Red Hat, Inc. ++ This file is part of elfutils. ++ ++ This file is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ elfutils is distributed in the hope that it will be useful, but ++ WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ELFUTILS_HEADER(elf) ++#include ++ ++int ++main (int argc, char *argv[]) ++{ ++ if (argc != 2) ++ { ++ printf ("No ELF file given as argument\n"); ++ exit (1); ++ } ++ ++ const char *fname = argv[1]; ++ ++ // Initialize libelf. ++ elf_version (EV_CURRENT); ++ ++ /* Read the ELF from disk now. */ ++ int fd = open (fname, O_RDONLY); ++ if (fd == -1) ++ { ++ printf ("cannot open '%s': %s\n", fname, strerror (errno)); ++ exit (1); ++ } ++ ++ Elf *elf = elf_begin (fd, ELF_C_READ, NULL); ++ if (elf == NULL) ++ { ++ printf ("cannot create ELF descriptor: %s\n", elf_errmsg (-1)); ++ exit (1); ++ } ++ ++ GElf_Ehdr ehdr; ++ if (gelf_getehdr (elf, &ehdr) == NULL) ++ { ++ printf ("cannot get Ehdr: %s\n", elf_errmsg (-1)); ++ exit (1); ++ } ++ ++ /* Search for all SHT_NOTE sections. */ ++ Elf_Scn *scn = NULL; ++ while ((scn = elf_nextscn (elf, scn)) != NULL) ++ { ++ /* Get the header. */ ++ GElf_Shdr shdr; ++ if (gelf_getshdr (scn, &shdr) == NULL) ++ { ++ printf ("couldn't get shdr: %s\n", elf_errmsg (-1)); ++ exit (1); ++ } ++ ++ if (shdr.sh_type == SHT_NOTE) ++ { ++ printf ("Notes in section %zd:\n", elf_ndxscn (scn)); ++ ++ Elf_Data *raw = elf_rawdata (scn, NULL); ++ if (raw == NULL) ++ { ++ printf ("couldn't get raw data: %s\n", elf_errmsg (-1)); ++ exit (1); ++ } ++ ++ Elf_Data *data = elf_getdata (scn, NULL); ++ if (data == NULL) ++ { ++ printf ("couldn't get data: %s\n", elf_errmsg (-1)); ++ exit (1); ++ } ++ ++ size_t off = 0; ++ size_t next; ++ GElf_Nhdr nhdr; ++ size_t n_off; ++ size_t d_off; ++ while ((next = gelf_getnote (data, off, &nhdr, &n_off, &d_off)) > 0) ++ { ++ /* Now just get the note header "raw" (don't ++ copy/translate the note data). This only handles ++ traditional GNU ELF Notes, so we still use the next ++ from gelf_getnote (padding is different for new style ++ ELF_T_NHDR8 notes). */ ++ Elf32_Nhdr nh; ++ Elf_Data src = ++ { ++ .d_version = EV_CURRENT, .d_type = ELF_T_NHDR, ++ .d_size = sizeof nh ++ }; ++ Elf_Data dst = src; ++ src.d_buf = raw->d_buf + off; ++ dst.d_buf = &nh; ++ ++ if (elf32_xlatetom (&dst, &src, ehdr.e_ident[EI_DATA]) == NULL) ++ { ++ printf ("couldn't xlate note: %s\n", elf_errmsg (-1)); ++ exit (1); ++ } ++ ++ printf ("type: %" PRId32 ",%" PRId32 ++ ", namesz: %" PRId32 ",%" PRId32 ++ ", descsz: %" PRId32 ",%" PRId32 "\n", ++ nhdr.n_type, nh.n_type, ++ nhdr.n_namesz, nh.n_namesz, ++ nhdr.n_descsz, nh.n_descsz); ++ ++ if (nhdr.n_type != nh.n_type ++ || nhdr.n_namesz != nh.n_namesz ++ || nhdr.n_descsz != nh.n_descsz) ++ { ++ printf ("Nhdrs not equal!\n"); ++ exit (1); ++ } ++ ++ off = next; ++ } ++ } ++ ++ } ++ ++ if (elf_end (elf) != 0) ++ { ++ printf ("failure in elf_end: %s\n", elf_errmsg (-1)); ++ exit (1); ++ } ++ ++ close (fd); ++ ++ return 0; ++} +diff -ur elfutils-0.176.orig/tests/Makefile.in elfutils-0.176/tests/Makefile.in +--- elfutils-0.176.orig/tests/Makefile.in 2019-04-30 22:42:49.534655124 +0200 ++++ elfutils-0.176/tests/Makefile.in 2019-04-30 22:46:30.046656790 +0200 +@@ -131,8 +131,8 @@ + get-units-invalid$(EXEEXT) get-units-split$(EXEEXT) \ + attr-integrate-skel$(EXEEXT) all-dwarf-ranges$(EXEEXT) \ + unit-info$(EXEEXT) next_cfi$(EXEEXT) elfcopy$(EXEEXT) \ +- addsections$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) \ +- $(am__EXEEXT_4) ++ addsections$(EXEEXT) xlate_notes$(EXEEXT) $(am__EXEEXT_1) \ ++ $(am__EXEEXT_2) $(am__EXEEXT_4) + @BIARCH_TRUE@am__append_5 = backtrace-child-biarch + TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile$(EXEEXT) \ + test-nlist$(EXEEXT) update1$(EXEEXT) update2$(EXEEXT) \ +@@ -211,8 +211,8 @@ + run-unit-info.sh run-reloc-bpf.sh run-next-cfi.sh \ + run-next-cfi-self.sh run-copyadd-sections.sh \ + run-copymany-sections.sh run-typeiter-many.sh \ +- run-strip-test-many.sh run-strip-version.sh $(am__EXEEXT_2) \ +- $(am__append_8) $(am__EXEEXT_5) ++ run-strip-test-many.sh run-strip-version.sh run-xlate-note.sh \ ++ $(am__EXEEXT_2) $(am__append_8) $(am__EXEEXT_5) + @STANDALONE_FALSE@am__append_6 = msg_tst system-elf-libelf-test + @STANDALONE_FALSE@am__append_7 = msg_tst system-elf-libelf-test + @LZMA_TRUE@am__append_8 = run-readelf-s.sh run-dwflsyms.sh +@@ -606,6 +606,9 @@ + vendorelf_SOURCES = vendorelf.c + vendorelf_OBJECTS = vendorelf.$(OBJEXT) + vendorelf_DEPENDENCIES = $(am__DEPENDENCIES_2) ++xlate_notes_SOURCES = xlate_notes.c ++xlate_notes_OBJECTS = xlate_notes.$(OBJEXT) ++xlate_notes_DEPENDENCIES = $(am__DEPENDENCIES_2) + zstrptr_SOURCES = zstrptr.c + zstrptr_OBJECTS = zstrptr.$(OBJEXT) + zstrptr_DEPENDENCIES = $(am__DEPENDENCIES_2) +@@ -683,7 +686,7 @@ + ./$(DEPDIR)/update2.Po ./$(DEPDIR)/update3.Po \ + ./$(DEPDIR)/update4.Po ./$(DEPDIR)/varlocs.Po \ + ./$(DEPDIR)/vdsosyms.Po ./$(DEPDIR)/vendorelf.Po \ +- ./$(DEPDIR)/zstrptr.Po ++ ./$(DEPDIR)/xlate_notes.Po ./$(DEPDIR)/zstrptr.Po + am__mv = mv -f + AM_V_lt = $(am__v_lt_@AM_V@) + am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +@@ -726,7 +729,8 @@ + showptable.c strptr.c system-elf-libelf-test.c \ + test-elf_cntl_gelf_getshdr.c test-flag-nobits.c test-nlist.c \ + typeiter.c typeiter2.c unit-info.c update1.c update2.c \ +- update3.c update4.c varlocs.c vdsosyms.c vendorelf.c zstrptr.c ++ update3.c update4.c varlocs.c vdsosyms.c vendorelf.c \ ++ xlate_notes.c zstrptr.c + DIST_SOURCES = addrcfi.c addrscopes.c addsections.c aggregate_size.c \ + all-dwarf-ranges.c alldts.c allfcts.c allregs.c arextract.c \ + arls.c arsymtest.c asm-tst1.c asm-tst2.c asm-tst3.c asm-tst4.c \ +@@ -752,7 +756,8 @@ + showptable.c strptr.c system-elf-libelf-test.c \ + test-elf_cntl_gelf_getshdr.c test-flag-nobits.c test-nlist.c \ + typeiter.c typeiter2.c unit-info.c update1.c update2.c \ +- update3.c update4.c varlocs.c vdsosyms.c vendorelf.c zstrptr.c ++ update3.c update4.c varlocs.c vdsosyms.c vendorelf.c \ ++ xlate_notes.c zstrptr.c + am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ +@@ -1405,7 +1410,8 @@ + testfile-debug-rel-ppc64-g.o.bz2 \ + testfile-debug-rel-ppc64-z.o.bz2 \ + testfile-debug-rel-ppc64.o.bz2 \ +- run-strip-version.sh testfile-version.bz2 ++ run-strip-version.sh testfile-version.bz2 \ ++ run-xlate-note.sh + + @USE_VALGRIND_TRUE@valgrind_cmd = 'valgrind -q --leak-check=full --error-exitcode=1' + installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir); \ +@@ -1559,6 +1565,7 @@ + next_cfi_LDADD = $(libelf) $(libdw) + elfcopy_LDADD = $(libelf) + addsections_LDADD = $(libelf) ++xlate_notes_LDADD = $(libelf) + + # We want to test the libelf header against the system elf.h header. + # Don't include any -I CPPFLAGS. Except when we install our own elf.h. +@@ -2011,6 +2018,10 @@ + @rm -f vendorelf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(vendorelf_OBJECTS) $(vendorelf_LDADD) $(LIBS) + ++xlate_notes$(EXEEXT): $(xlate_notes_OBJECTS) $(xlate_notes_DEPENDENCIES) $(EXTRA_xlate_notes_DEPENDENCIES) ++ @rm -f xlate_notes$(EXEEXT) ++ $(AM_V_CCLD)$(LINK) $(xlate_notes_OBJECTS) $(xlate_notes_LDADD) $(LIBS) ++ + zstrptr$(EXEEXT): $(zstrptr_OBJECTS) $(zstrptr_DEPENDENCIES) $(EXTRA_zstrptr_DEPENDENCIES) + @rm -f zstrptr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(zstrptr_OBJECTS) $(zstrptr_LDADD) $(LIBS) +@@ -2124,6 +2135,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/varlocs.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vdsosyms.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vendorelf.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xlate_notes.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zstrptr.Po@am__quote@ # am--include-marker + + $(am__depfiles_remade): +@@ -3732,6 +3744,13 @@ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) ++run-xlate-note.sh.log: run-xlate-note.sh ++ @p='run-xlate-note.sh'; \ ++ b='run-xlate-note.sh'; \ ++ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ ++ --log-file $$b.log --trs-file $$b.trs \ ++ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ ++ "$$tst" $(AM_TESTS_FD_REDIRECT) + msg_tst.log: msg_tst$(EXEEXT) + @p='msg_tst$(EXEEXT)'; \ + b='msg_tst'; \ +@@ -4027,6 +4046,7 @@ + -rm -f ./$(DEPDIR)/varlocs.Po + -rm -f ./$(DEPDIR)/vdsosyms.Po + -rm -f ./$(DEPDIR)/vendorelf.Po ++ -rm -f ./$(DEPDIR)/xlate_notes.Po + -rm -f ./$(DEPDIR)/zstrptr.Po + -rm -f Makefile + distclean-am: clean-am distclean-compile distclean-generic \ +@@ -4176,6 +4196,7 @@ + -rm -f ./$(DEPDIR)/varlocs.Po + -rm -f ./$(DEPDIR)/vdsosyms.Po + -rm -f ./$(DEPDIR)/vendorelf.Po ++ -rm -f ./$(DEPDIR)/xlate_notes.Po + -rm -f ./$(DEPDIR)/zstrptr.Po + -rm -f Makefile + maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/elfutils-dts-libs-version.patch b/elfutils-dts-libs-version.patch new file mode 100644 index 0000000..7b4ccfb --- /dev/null +++ b/elfutils-dts-libs-version.patch @@ -0,0 +1,78 @@ +diff --git a/libasm/Makefile.am b/libasm/Makefile.am +index fcc7ffc..60b8ed6 100644 +--- a/libasm/Makefile.am ++++ b/libasm/Makefile.am +@@ -31,7 +31,7 @@ include $(top_srcdir)/config/eu.am + AM_CPPFLAGS += -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl -I$(top_srcdir)/libdw -I$(top_srcdir)/libdwelf + + GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include) +-VERSION = 1 ++VERSION = dts.1 + + lib_LIBRARIES = libasm.a + noinst_LIBRARIES = libasm_pic.a +diff --git a/libdw/Makefile.am b/libdw/Makefile.am +index 166e37c..e291478 100644 +--- a/libdw/Makefile.am ++++ b/libdw/Makefile.am +@@ -32,7 +32,7 @@ if BUILD_STATIC + AM_CFLAGS += $(fpic_CFLAGS) + endif + AM_CPPFLAGS += -I$(srcdir)/../libelf -I$(srcdir)/../libdwelf +-VERSION = 1 ++VERSION = dts.1 + + lib_LIBRARIES = libdw.a + noinst_LIBRARIES = libdw_pic.a libdw_static_pic.a +diff --git a/libdwelf/Makefile.am b/libdwelf/Makefile.am +index b526b7c..fbd51ba 100644 +--- a/libdwelf/Makefile.am ++++ b/libdwelf/Makefile.am +@@ -32,7 +32,7 @@ + include $(top_srcdir)/config/eu.am + AM_CPPFLAGS += -I$(srcdir)/../libelf -I$(srcdir)/../libdw \ + -I$(srcdir)/../libdwfl -I$(srcdir)/../libebl +-VERSION = 1 ++VERSION = dts.1 + + noinst_LIBRARIES = libdwelf.a libdwelf_pic.a + +diff --git a/libdwfl/Makefile.am b/libdwfl/Makefile.am +index d9d13b2..3749b51 100644 +--- a/libdwfl/Makefile.am ++++ b/libdwfl/Makefile.am +@@ -32,7 +32,7 @@ + include $(top_srcdir)/config/eu.am + AM_CPPFLAGS += -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \ + -I$(srcdir)/../libdw -I$(srcdir)/../libdwelf +-VERSION = 1 ++VERSION = dts.1 + + noinst_LIBRARIES = libdwfl.a + noinst_LIBRARIES += libdwfl_pic.a +diff --git a/libebl/Makefile.am b/libebl/Makefile.am +index ecebdd0..c411c70 100644 +--- a/libebl/Makefile.am ++++ b/libebl/Makefile.am +@@ -30,7 +30,7 @@ + include $(top_srcdir)/config/eu.am + AM_CFLAGS += $(fpic_CFLAGS) + AM_CPPFLAGS += -I$(srcdir)/../libelf -I$(srcdir)/../libdw -I$(srcdir)/../libasm +-VERSION = 1 ++VERSION = dts.1 + LIBEBL_SUBDIR = @LIBEBL_SUBDIR@ + + lib_LIBRARIES = libebl.a +diff --git a/libelf/Makefile.am b/libelf/Makefile.am +index ba4e3eb..88ce633 100644 +--- a/libelf/Makefile.am ++++ b/libelf/Makefile.am +@@ -32,7 +32,7 @@ if BUILD_STATIC + AM_CFLAGS += $(fpic_CFLAGS) + endif + GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include) +-VERSION = 1 ++VERSION = dts.1 + + lib_LIBRARIES = libelf.a + noinst_LIBRARIES = libelf_pic.a diff --git a/elfutils.spec b/elfutils.spec new file mode 100644 index 0000000..2e09300 --- /dev/null +++ b/elfutils.spec @@ -0,0 +1,1347 @@ +# For RHEL8 we need this before using any scl macro. +%global __python /usr/bin/python3 + +%{?scl:%{?scl_package:%scl_package elfutils}} + +Name: %{?scl_prefix}elfutils +Summary: A collection of utilities and DSOs to handle ELF files and DWARF data +Version: 0.176 +%global baserelease 5 +URL: http://elfutils.org/ +%global source_url ftp://sourceware.org/pub/elfutils/%{version}/ +License: GPLv3+ and (GPLv2+ or LGPLv3+) +Group: Development/Tools + +Release: %{baserelease}%{?dist} + +%global provide_yama_scope 0 + +# For DTS we never provide the default yama scope. + +%global depsuffix %{?_isa}%{!?_isa:-%{_arch}} + +Source: %{?source_url}elfutils-%{version}.tar.bz2 + +# Libraries in Developer Toolset are linked in statically to allow +# compiled binaries to run even when DTS is not installed. +# So we provide linker scripts for all libraries. +Source2: libelf.so +Source3: libdw.so +Source4: libasm.so +Source5: libelf.a +Source6: libdw.a +Source7: libasm.a + +# Patches +Patch1: elfutils-0.176-gcc-pr88835.patch +Patch2: elfutils-0.176-xlate-note.patch +Patch3: elfutils-0.176-elf-update.patch +Patch4: elfutils-0.176-strip-symbols-illformed.patch + +# DTS specific patches. +Patch100: elfutils-0.176-dts.patch +Patch101: elfutils-dts-libs-version.patch + +Requires: %{?scl_prefix}elfutils-libelf%{depsuffix} = %{version}-%{release} +Requires: %{?scl_prefix}elfutils-libs%{depsuffix} = %{version}-%{release} + +BuildRequires: gettext +BuildRequires: bison >= 1.875 +BuildRequires: flex >= 2.5.4a +BuildRequires: bzip2 +BuildRequires: gcc >= 4.4 +# For libstdc++ demangle support +BuildRequires: gcc-c++ + +BuildRequires: zlib-devel >= 1.2.2.3 +BuildRequires: bzip2-devel +BuildRequires: xz-devel + +# For DTS because the dts patch changes automake files. +BuildRequires: autoconf automake + +%{?scl:Requires:%scl_runtime} + +%global _gnu %{nil} +%global _program_prefix eu- + +# The lib[64]/elfutils directory contains the private ebl backend +# libraries. They must not be exposed as global provides. We don't +# need to filter the requires since they are only loaded with dlopen. +%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 +%global __provides_exclude ^libebl_.*\\.so.*$ +%endif + +%description +Elfutils is a collection of utilities, including stack (to show +backtraces), nm (for listing symbols from object files), size +(for listing the section sizes of an object or archive file), +strip (for discarding symbols), readelf (to see the raw ELF file +structures), elflint (to check for well-formed ELF files) and +elfcompress (to compress or decompress ELF sections). + + +%package libs +Summary: Libraries to handle compiled objects +Group: Development/Tools +License: GPLv2+ or LGPLv3+ +%if 0%{!?_isa:1} +Provides: %{?scl_prefix}elfutils-libs%{depsuffix} = %{version}-%{release} +%endif +Requires: %{?scl_prefix}elfutils-libelf%{depsuffix} = %{version}-%{release} +%if %{provide_yama_scope} +Requires: default-yama-scope +%endif + +%description libs +The elfutils-libs package contains libraries which implement DWARF, ELF, +and machine-specific ELF handling. These libraries are used by the programs +in the elfutils package. The elfutils-devel package enables building +other programs using these libraries. + +%package devel +Summary: Development libraries to handle compiled objects +Group: Development/Tools +License: GPLv2+ or LGPLv3+ +%if 0%{!?_isa:1} +Provides: %{?scl_prefix}elfutils-devel%{depsuffix} = %{version}-%{release} +%endif +Requires: %{?scl_prefix}elfutils-libelf-devel%{depsuffix} = %{version}-%{release} +Requires: zlib-devel >= 1.2.2.3 +Requires: bzip2-devel +Requires: xz-devel + +%description devel +The elfutils-devel package contains the libraries to create +applications for handling compiled objects. libebl provides some +higher-level ELF access functionality. libdw provides access to +the DWARF debugging information. libasm provides a programmable +assembler interface. + +%package libelf +Summary: Library to read and write ELF files +Group: Development/Tools +License: GPLv2+ or LGPLv3+ +%if 0%{!?_isa:1} +Provides: %{?scl_prefix}elfutils-libelf%{depsuffix} = %{version}-%{release} +%endif + +%description libelf +The elfutils-libelf package provides a DSO which allows reading and +writing ELF files on a high level. Third party programs depend on +this package to read internals of ELF files. The programs of the +elfutils package use it also to generate new ELF files. + +%package libelf-devel +Summary: Development support for libelf +Group: Development/Tools +License: GPLv2+ or LGPLv3+ +%if 0%{!?_isa:1} +Provides: %{?scl_prefix}elfutils-libelf-devel%{depsuffix} = %{version}-%{release} +%endif + +%description libelf-devel +The elfutils-libelf-devel package contains the libraries to create +applications for handling compiled objects. libelf allows you to +access the internals of the ELF object file format, so you can see the +different sections of an ELF file. + +%if %{provide_yama_scope} +%package default-yama-scope +Summary: Default yama attach scope sysctl setting +Group: Development/Tools +License: GPLv2+ or LGPLv3+ +Provides: default-yama-scope +BuildArch: noarch +# For the sysctl_apply macro +%{?systemd_requires} +BuildRequires: systemd >= 215 + +%description default-yama-scope +Yama sysctl setting to enable default attach scope settings +enabling programs to use ptrace attach, access to +/proc/PID/{mem,personality,stack,syscall}, and the syscalls +process_vm_readv and process_vm_writev which are used for +interprocess services, communication and introspection +(like synchronisation, signaling, debugging, tracing and +profiling) of processes. +%endif + +%prep +%setup -q -n elfutils-%{version} + +# Apply patches +%patch1 -p1 -b .gcc-pr88835 +%patch2 -p1 -b .xlate-note +%patch3 -p1 -b .elf-update +%patch4 -p1 -b .strip-illformed + + +# DTS specific patches +%patch100 -p1 -b .dts +%patch101 -p1 -b .versions + +autoreconf + +# In case the above patches added any new test scripts, make sure they +# are executable. +find . -name \*.sh ! -perm -0100 -print | xargs chmod +x + +%build +# Remove -Wall from default flags. The makefiles enable enough warnings +# themselves, and they use -Werror. Appending -Wall defeats the cases where +# the makefiles disable some specific warnings for specific code. +# But add -Wformat explicitly for use with -Werror=format-security which +# doesn't work without -Wformat (enabled by -Wall). +RPM_OPT_FLAGS="${RPM_OPT_FLAGS/-Wall/}" +RPM_OPT_FLAGS="${RPM_OPT_FLAGS} -Wformat" + +trap 'cat config.log' EXIT +%configure CFLAGS="$RPM_OPT_FLAGS -fexceptions" +trap '' EXIT + +# Due to static bits, our dependencies are more complex than in plain +# elfutils. We need to build things in parts. +make %{?_smp_mflags} -C lib V=1 +make %{?_smp_mflags} -C libdwfl V=1 +make %{?_smp_mflags} -C libdwelf V=1 +make %{?_smp_mflags} -C libdw libdw_pic.a libdw.a V=1 +make %{?_smp_mflags} -C libcpu V=1 +make %{?_smp_mflags} -C libebl V=1 +make %{?_smp_mflags} -C backends libebl_static_pic.a V=1 +make %{?_smp_mflags} -C libelf V=1 +make %{?_smp_mflags} -C libdw V=1 +make %{?_smp_mflags} V=1 + +%install +rm -rf ${RPM_BUILD_ROOT} +make -s install DESTDIR=${RPM_BUILD_ROOT} + +chmod +x ${RPM_BUILD_ROOT}%{_prefix}/%{_lib}/lib*.so* +chmod +x ${RPM_BUILD_ROOT}%{_prefix}/%{_lib}/elfutils/lib*.so* + +ls -ls $RPM_BUILD_ROOT%{_libdir}/lib{elf,dw,asm}.so +rm -f $RPM_BUILD_ROOT%{_libdir}/lib{elf,dw,asm}.so + +# Rename static archives to *.ar, so that brp-strip-static-archive +# doesn't find them. We still want debuginfo for other files, so we +# can't simply %%define __strip /bin/true. We do want -lelf -static +# to find libelf.a though, so we provide a linker script that brings +# in the .ar files. +find $RPM_BUILD_ROOT%{_libdir}/ -name '*.a' -exec mv -v {} {}r \; + +install -p -m 644 %{SOURCE2} %{SOURCE3} %{SOURCE4} \ + %{SOURCE5} %{SOURCE6} %{SOURCE7} $RPM_BUILD_ROOT%{_libdir}/ + +%find_lang elfutils + +%if %{provide_yama_scope} +install -Dm0644 config/10-default-yama-scope.conf ${RPM_BUILD_ROOT}%{_sysctldir}/10-default-yama-scope.conf +%endif + +%check +# Record some build root versions in build.log +uname -r; rpm -q glibc + +make -s %{?_smp_mflags} check || (cat tests/test-suite.log; false) + +# Only the latest Fedora and EPEL have these scriptlets, +# older Fedora and plain RHEL don't. +%if 0%{?ldconfig_scriptlets:1} +%ldconfig_scriptlets libs +%ldconfig_scriptlets libelf +%else +%post libs -p /sbin/ldconfig +%postun libs -p /sbin/ldconfig +%post libelf -p /sbin/ldconfig +%postun libelf -p /sbin/ldconfig +%endif + +%if %{provide_yama_scope} +%post default-yama-scope +# Due to circular dependencies might not be installed yet, so double check. +# (systemd -> elfutils-libs -> default-yama-scope -> systemd) +if [ -x /usr/lib/systemd/systemd-sysctl ] ; then +%sysctl_apply 10-default-yama-scope.conf +fi +%endif + +%files +%defattr(-,root,root) +%{!?_licensedir:%global license %%doc} +%license COPYING COPYING-GPLV2 COPYING-LGPLV3 +%doc README TODO CONTRIBUTING +%{_bindir}/eu-addr2line +%{_bindir}/eu-ar +%{_bindir}/eu-elfcmp +%{_bindir}/eu-elflint +%{_bindir}/eu-findtextrel +%{_bindir}/eu-nm +%{_bindir}/eu-objdump +%{_bindir}/eu-ranlib +%{_bindir}/eu-readelf +%{_bindir}/eu-size +%{_bindir}/eu-stack +%{_bindir}/eu-strings +%{_bindir}/eu-strip +%{_bindir}/eu-unstrip +%{_bindir}/eu-make-debug-archive +%{_bindir}/eu-elfcompress + +%files libs +%defattr(-,root,root) +%{!?_licensedir:%global license %%doc} +%license COPYING-GPLV2 COPYING-LGPLV3 +%{_libdir}/libasm-%{version}.so +%{_libdir}/libasm.so.* +%{_libdir}/libdw-%{version}.so +%{_libdir}/libdw.so.* +%dir %{_libdir}/elfutils +%{_libdir}/elfutils/lib*.so + +%files devel +%defattr(-,root,root) +%{_includedir}/dwarf.h +%dir %{_includedir}/elfutils +%{_includedir}/elfutils/elf-knowledge.h +%{_includedir}/elfutils/known-dwarf.h +%{_includedir}/elfutils/libasm.h +%{_includedir}/elfutils/libebl.h +%{_includedir}/elfutils/libdw.h +%{_includedir}/elfutils/libdwfl.h +%{_includedir}/elfutils/libdwelf.h +%{_includedir}/elfutils/version.h +%{_libdir}/libebl.ar +%{_libdir}/libasm.so +%{_libdir}/libasm.a +%{_libdir}/libasm.ar +%{_libdir}/libdw.so +%{_libdir}/libdw.a +%{_libdir}/libdw.ar +%{_libdir}/libebl_static_pic.ar +%{_libdir}/libcpu_static_pic.ar +%{_libdir}/pkgconfig/libdw.pc + +%files -f elfutils.lang libelf +%defattr(-,root,root) +%{!?_licensedir:%global license %%doc} +%license COPYING-GPLV2 COPYING-LGPLV3 +%{_libdir}/libelf-%{version}.so +%{_libdir}/libelf.so.* + +%files libelf-devel +%defattr(-,root,root) +%{_includedir}/libelf.h +%{_includedir}/gelf.h +%{_includedir}/nlist.h +%{_libdir}/libelf.so +%{_libdir}/libelf.a +%{_libdir}/libelf.ar +%{_libdir}/pkgconfig/libelf.pc + +%if %{provide_yama_scope} +%files default-yama-scope +%defattr(-,root,root) +%{_sysctldir}/10-default-yama-scope.conf +%endif + +%changelog +* Fri Jul 5 2019 Mark Wielaard - 0.176-5 +- Add elfutils-0.176-strip-symbols-illformed.patch + +* Fri Jun 7 2019 Mark Wielaard - 0.176-4 +- Add elfutils-0.176-gcc-pr88835.patch +- Add elfutils-0.176-xlate-note.patch +- Add elfutils-0.176-elf-update.patch + +* Thu Mar 7 2019 Mark Wielaard - 0.176-1 +- Update to elfutils-0.176. + - Fixes CVE-2019-7146, CVE-2019-7148, CVE-2019-7149, CVE-2019-7150, + CVE-2019-7664, CVE-2019-7665. + +* Fri Jan 11 2019 Mark Wielaard - 0.175-2 +- Update to elfutils-0.175. + +* Fri Sep 14 2018 Mark Wielaard - 0.174-1 +- New upstream release + - libelf, libdw and all tools now handle extended shnum and shstrndx + correctly + - elfcompress: Don't rewrite input file if no section data needs + updating. Try harder to keep same file mode bits (suid) on rewrite. + - strip: Handle mixed (out of order) allocated/non-allocated sections. + - unstrip: Handle SHT_GROUP sections. + - Fixes CVE-2018-16062, CVE-2018-16402 and CVE-2018-16403. + +* Wed Jul 4 2018 Mark Wielaard - 0.173-1 +- New upstream release + - More fixes for crashes and hangs found by afl-fuzz. In particular + various functions now detect and break infinite loops caused by bad + DIE tree cycles. + - readelf: Will now lookup the size and signedness of constant value + types to display them correctly (and not just how they were encoded). + - libdw: New function dwarf_next_lines to read CU-less .debug_line data. + dwarf_begin_elf now accepts ELF files containing just .debug_line + or .debug_frame sections (which can be read without needing a DIE + tree from the .debug_info section). + Removed dwarf_getscn_info, which was never implemented. + - backends: Handle BPF simple relocations. + The RISCV backends now handles ABI specific CFI and knows about + RISCV register types and names. + +- Add scl macros and elfutils-0.173-dts.patch. + +* Wed Jun 20 2018 Mark Wielaard - 0.172-2 +- Add elfutils-0.172-robustify.patch. + +* Mon Jun 11 2018 Mark Wielaard - 0.172-1 +- New upstream release. + - No functional changes compared to 0.171. + - Various bug fixes in libdw and eu-readelf dealing with bad DWARF5 + data. Thanks to running the afl fuzzer on eu-readelf and various + testcases. + - eu-readelf -N is ~15% faster. + +* Fri Jun 01 2018 Mark Wielaard - 0.171-1 +- New upstream release. + - DWARF5 and split dwarf, including GNU DebugFission, support. + - readelf: Handle all new DWARF5 sections. + --debug-dump=info+ will show split unit DIEs when found. + --dwarf-skeleton can be used when inspecting a .dwo file. + Recognizes GNU locviews with --debug-dump=loc. + - libdw: New functions dwarf_die_addr_die, dwarf_get_units, + dwarf_getabbrevattr_data and dwarf_cu_info. + libdw will now try to resolve the alt file on first use + when not set yet with dwarf_set_alt. + dwarf_aggregate_size() now works with multi-dimensional arrays. + - libdwfl: Use process_vm_readv when available instead of ptrace. + - backends: Add a RISC-V backend. + +* Wed Apr 11 2018 Mark Wielaard - 0.170-11 +- Add explict libstdc++-devel BuildRequires for demangle support. +- Add elfutils-0.170-unwind.patch. (#1555726) + +* Thu Mar 01 2018 Mark Wielaard - 0.170-10 +- Add elfutils-0.170-GNU_variable_value.patch +- Add elfutils-0.170-locviews.patch + +* Fri Feb 16 2018 Mark Wielaard - 0.170-9 +- Add elfutils-0.170-core-pid.patch +- Add elfutils-0.170-elf_sync.patch +- Add elfutils-0.170-new-notes-hack.patch + +* Thu Feb 15 2018 Mark Wielaard - 0.170-8 +- Add elfutils-0.170-sys-ptrace.patch +- Make sure spec can be build even when ldconfig_scriplets aren't defined. +- Add elfutils-0.170-m68k-packed-not-aligned.patch + +* Fri Feb 09 2018 Igor Gnatenko - 0.170-7 +- Escape macros in %%changelog + +* Wed Feb 07 2018 Fedora Release Engineering - 0.170-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Sat Feb 03 2018 Igor Gnatenko - 0.170-5 +- Switch to %%ldconfig_scriptlets + +* Wed Dec 20 2017 Mark Wielaard - 0.170-4 +- Add elfutils-0.170-dwarf_aggregate_size.patch. + +* Wed Nov 8 2017 Mark Wielaard - 0.170-3 +- Rely on (and check) systemd_requires for sysctl_apply default-yama-scope. + +* Thu Nov 2 2017 Mark Wielaard - 0.170-2 +- Config files under /usr/lib/sysctl.d (_sysctldir) aren't %%config (#1506660) + Admin can place the real config file under /etc/sysctl.d as override. + +* Thu Aug 3 2017 Mark Wielaard - 0.170-1 +- New upstream release. Remove upstreamed patches. +- provide_yama_scope for either fedora >= 22 and rhel >= 7. + +* Wed Aug 02 2017 Fedora Release Engineering - 0.169-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 0.169-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Jul 21 2017 Mark Wielaard - 0.169-6 +- Add elfutils-0.169-strip-data-marker-symbols.patch. + +* Mon Jul 17 2017 Mark Wielaard - 0.169-5 +- Fix build on s390 (ptrace.h). Add elfutils-0.169-s390x-ptrace.patch. + +* Mon Jul 17 2017 Mark Wielaard - 0.169-4 +- Add elfutils-0.169-strip-keep-remove-section.patch (#1465997) + +* Wed Jun 7 2017 Mark Wielaard - 0.169-3 +- Add elfutils-0.169-dup-shstrtab.patch +- Add elfutils-0.169-strip-empty.patch + +* Tue May 30 2017 Mark Wielaard - 0.169-2 +- Add ppc64 fallback unwinder. + +* Fri May 5 2017 Mark Wielaard - 0.169-1 +- New upstream release. Removed upstreamed patches. + +* Wed Feb 15 2017 Mark Wielaard - 0.168-5 +- Add patches for new gcc warnings and new binutils ppc64 attributes. + - elfutils-0.168-libasm-truncation.patch + - elfutils-0.168-ppc64-attrs.patch + +* Fri Feb 10 2017 Fedora Release Engineering - 0.168-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Mon Jan 16 2017 Mark Wielaard - 0.168-3 +- Never use old, deprecated, filter_provides_in, it really is too broken. + +* Fri Jan 13 2017 Mark Wielaard - 0.168-2 +- Filter out private libebl backends from provides. + +* Wed Dec 28 2016 Mark Wielaard - 0.168-1 +- New upstream release from new home https://sourceware.org/elfutils/ +- Resolves: + - #1396092 Please implement eu-readelf --symbols[=SECTION] + - #1388057 memory allocation failure in allocate_elf + - #1387584 memory allocation failure in __libelf_set_rawdata_wrlock + +* Fri Oct 7 2016 Mark Wielaard - 0.167-2 +- Add elfutils-0.167-strip-alloc-symbol.patch (#1380961) + +* Fri Aug 26 2016 Mark Wielaard - 0.167-1 +- Upgrade to elfutils-0.167 + Drop upstream elfutils-0.166-elfcmp-comp-gcc6.patch + Fixes: #1365812, #1352232. + +* Thu Apr 14 2016 Mark Wielaard - 0.166-2 +- Add elfutils-0.166-elfcmp-comp-gcc6.patch + +* Thu Mar 31 2016 Mark Wielaard - 0.166-1 +- Upgrade to elfutils-0.166 + Drop upstreamed patches: + - elfutils-0.165-nobitsalign-strip.patch. + - elfutils-0.165-reloc.patch. + - elfutils-0.165-elf-libelf.patch. + +* Thu Feb 04 2016 Mark Wielaard - 0.165-5 +- Add elfutils-0.165-nobitsalign-strip.patch. + +* Wed Feb 03 2016 Fedora Release Engineering - 0.165-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jan 28 2016 Mark Wielaard - 0.165-3 +- Add elfutils-0.165-reloc.patch. + +* Thu Jan 14 2016 Mark Wielaard - 0.165-2 +- Add elfutils-0.165-elf-libelf.patch. + +* Mon Jan 11 2016 Mark Wielaard - 0.165-1 +- Update to elfutils-0.165 (#1294079, #1236699, #807053) + - Add eu-elfcompress + - Add pkg-config files for libelf and libdw. + +* Fri Oct 16 2015 Mark Wielaard - 0.164-1 +- Update to elfutils-0.164 +- Drop old compat stuff + +* Mon Sep 07 2015 Mark Wielaard - 0.163-4 +- Add elfutils-0.163-readelf-n-undefined-shift.patch (#1259259) + +* Tue Aug 04 2015 Mark Wielaard - 0.163-3 +- Add elfutils-0.163-default-yama-conf.patch (#1250079) + Provides: default-yama-scope + +* Mon Aug 03 2015 Mark Wielaard - 0.163-2 +- Add elfutils-0.163-unstrip-shf_info_link.patch + +* Fri Jun 19 2015 Mark Wielaard - 0.163-1 +- Update to 0.163 + - Drop elfutils-0.162-ftruncate-allocate.patch + +* Tue Jun 16 2015 Mark Wielaard - 0.162-2 +- Add elfutils-0.162-ftruncate-allocate.patch (#1232206) + +* Thu Jun 11 2015 Mark Wielaard - 0.162-1 +- Update to 0.162 (#1170810, #1139815, #1129756, #1020842) +- Include elfutils/known-dwarf.h +- Drop BuildRequires glibc-headers (#1230468) +- Removed integrated upstream patches: + - elfutils-0.161-aarch64relro.patch + - elfutils-0.161-copyreloc.patch + - elfutils-0.161-addralign.patch + - elfutils-0.161-ar-long-name.patch + - elfutils-0.161-formref-type.patch + +* Sat May 02 2015 Kalev Lember - 0.161-8 +- Rebuilt for GCC 5 C++11 ABI change + +* Mon Mar 23 2015 Mark Wielaard - 0.161-7 +- Add elfutils-0.161-aarch64relro.patch (#1201778) + +* Mon Mar 09 2015 Mark Wielaard - 0.161-6 +- Add elfutils-0.161-copyreloc.patch. + +* Sat Feb 21 2015 Till Maas - 0.161-5 +- Rebuilt for Fedora 23 Change + https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code + +* Sat Feb 07 2015 Mark Wielaard - 0.161-4 +- Add elfutils-0.161-addralign.patch (#1189928) + +* Thu Feb 05 2015 Mark Wielaard - 0.161-3 +- Add elfutils-0.161-formref-type.patch + +* Tue Jan 13 2015 Mark Wielaard - 0.161-2 +- Add elfutils-0.161-ar-long-name.patch (#1181525 CVE-2014-9447) + +* Fri Dec 19 2014 Mark Wielaard - 0.161-1 +- Update to 0.161. + +* Wed Aug 27 2014 Mark Wielaard - 0.160-1 +- Update to 0.160. + - Remove integrated upstream patches: + elfutils-aarch64-user_regs_struct.patch + elfutils-0.159-argp-attach.patch + elfutils-0.159-aarch64-bool-ret.patch + elfutils-0.159-elf-h.patch + elfutils-0.159-ppc64le-elfv2-abi.patch + elfutils-0.159-report_r_debug.patch + elfutils-0.159-ko_xz.patch + +* Sat Aug 16 2014 Mark Wielaard - 0.159-10 +- Add elfutils-0.159-ko_xz.patch + +* Sat Aug 16 2014 Fedora Release Engineering - 0.159-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Mon Jul 28 2014 Mark Wielaard - 0.159-8 +- Add elfutils-0.159-report_r_debug.patch (#1112610) + +* Fri Jul 18 2014 Mark Wielaard - 0.159-7 +- Add configure check to elfutils-aarch64-user_regs_struct.patch. + +* Sat Jul 12 2014 Tom Callaway - 0.159-6 +- fix license handling + +* Fri Jul 4 2014 Mark Wielaard - 0.159-5 +- Add elfutils-0.159-aarch64-bool-ret.patch +- Add elfutils-0.159-elf-h.patch +- Add elfutils-0.159-ppc64le-elfv2-abi.patch (#1110249) + +* Tue Jun 10 2014 Mark Wielaard - 0.159-4 +- Add elfutils-0.159-argp-attach.patch (#1107654) + +* Mon Jun 09 2014 Kyle McMartin - 0.159-3 +- AArch64: handle new glibc-headers which provides proper GETREGSET structs. + +* Sat Jun 07 2014 Fedora Release Engineering - 0.159-2.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Mon May 19 2014 Mark Wielaard - 0.159-1 +- Update to 0.159. + - Remove integrated upstream patches: + robustify.patch, mod-e_type.patch and CVE-2014-0172.patch. + - Remove special handling of now default compile and configure flags: + Don't remove -Werror=format-security, don't configure --enable-dwz. + +* Thu Apr 10 2014 Mark Wielaard - 0.158-3 +- Add elfutils-0.158-CVE-2014-0172.patch (#1085729) + +* Tue Mar 11 2014 Mark Wielaard - 0.158-2 +- Add elfutils-0.158-mod-e_type.patch. + +* Mon Jan 6 2014 Mark Wielaard - 0.158-1 +- Update to 0.158. Remove all patches now upstream. Add eu-stack. + +* Thu Dec 19 2013 Mark Wielaard - 0.157-4 +- Add elfutils-0.157-aarch64-got-special-symbol.patch. +- Remove -Werror=format-security from RPM_OPT_FLAGS. + +* Fri Dec 13 2013 Petr Machata - 0.157-3 +- Add upstream support for aarch64 + +* Wed Oct 9 2013 Mark Wielaard 0.157-2 +- Show tests/test-suite.log in build.log when make check fails. + +* Mon Sep 30 2013 Mark Wielaard 0.157-1 +- Update to 0.157. +- Remove elfutils-0.156-abi_cfi-ppc-s390-arm.patch. +- Remove elfutils-0.156-et_dyn-kernels.patch. + +* Fri Sep 06 2013 Mark Wielaard 0.156-5 +- Add elfutils-0.156-abi_cfi-ppc-s390-arm.patch. + Sets up initial CFI return register, CFA location expression and + register rules for PPC, S390 and ARM (dwarf_cfi_addrframe support). + +* Mon Aug 26 2013 Mark Wielaard 0.156-4 +- Add elfutils-0.156-et_dyn-kernels.patch. + Fixes an issue on ppc64 with systemtap kernel address placement. + +* Thu Aug 8 2013 Mark Wielaard 0.156-3 +- Make check can now also be ran in parallel. + +* Thu Jul 25 2013 Jan Kratochvil 0.156-2 +- Update the %%configure command for compatibility with fc20 Koji. + +* Thu Jul 25 2013 Jan Kratochvil 0.156-1 +- Update to 0.156. + - #890447 - Add __bss_start and __TMC_END__ to elflint. + - #909481 - Only try opening files with installed compression libraries. + - #914908 - Add __bss_start__ to elflint. + - #853757 - Updated Polish translation. + - #985438 - Incorrect prototype of __libdwfl_find_elf_build_id. + - Drop upstreamed elfutils-0.155-binutils-pr-ld-13621.patch. + - Drop upstreamed elfutils-0.155-mem-align.patch. + - Drop upstreamed elfutils-0.155-sizeof-pointer-memaccess.patch. + +* Tue Jul 02 2013 Karsten Hopp 0.155-6 +- bump release and rebuild to fix dependencies on PPC + +* Sun Feb 24 2013 Mark Wielaard - 0.155-5 +- Add ARM variant to elfutils-0.155-binutils-pr-ld-13621.patch rhbz#914908. +- rhel >= 5 has xz-devel + +* Fri Feb 22 2013 Mark Wielaard - 0.155-4 +- Replace elfutils-0.155-binutils-pr-ld-13621.patch with upstream fix. + +* Thu Jan 24 2013 Mark Wielaard - 0.155-3 +- Backport sizeof-pointer-memaccess upstream fixes. + +* Thu Jan 10 2013 Mark Wielaard - 0.155-2 +- #891553 - unaligned memory access issues. + +* Mon Aug 27 2012 Mark Wielaard - 0.155-1 +- Update to 0.155. + - #844270 - eu-nm invalid %%N$ use detected. + - #847454 - Ukrainian translation update. + - Removed local ar 64-bit symbol patch, dwz support patch and xlatetom fix. + +* Tue Aug 14 2012 Petr Machata - 0.154-4 +- Add support for archives with 64-bit symbol tables (#843019) + +* Wed Aug 01 2012 Mark Wielaard 0.154-3 +- Add dwz support + +* Wed Jul 18 2012 Mark Wielaard 0.154-2 +- Add upstream xlatetom fix (#835877) + +* Mon Jul 02 2012 Karsten Hopp 0.154-1.1 +- disable unstrip-n check for now (835877) + +* Fri Jun 22 2012 Mark Wielaard - 0.154-1 +- Update to 0.154 + - elflint doesn't recognize SHF_INFO_LINK on relocation sections (#807823) + - Update license to GPLv3+ and (GPLv2+ or LGPLv3+) + - Remove elfutils-0.153-dwfl_segment_report_module.patch +- Add elfutils-0.154-binutils-pr-ld-13621.patch + +* Mon Apr 02 2012 Mark Wielaard - 0.153-2 +- Fix for eu-unstrip emits garbage for librt.so.1 (#805447) + +* Thu Feb 23 2012 Mark Wielaard - 0.153-1 +- Update to 0.153 + - New --disable-werror for portability. + - Support for .zdebug sections (#679777) + - type_units and DW_AT_GNU_odr_signature support (#679815) + - low level support DW_OP_GNU_entry_value and DW_TAG_GNU_call_site (#688090) + - FTBFS on rawhide with gcc 4.7 (#783506) + - Remove gcc-4.7 patch + +* Fri Jan 20 2012 Mark Wielaard - 0.152-3 +- Fixes for gcc-4.7 based on upstream commit 32899a (#783506). + +* Fri Jan 13 2012 Fedora Release Engineering - 0.152-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Feb 15 2011 Roland McGrath - 0.152-1 +- Update to 0.152 + - Various build and warning nits fixed for newest GCC and Autoconf. + - libdwfl: Yet another prelink-related fix for another regression. (#674465) + - eu-elfcmp: New flag --ignore-build-id to ignore differing build ID bits. + - eu-elfcmp: New flag -l/--verbose to print all differences. + +* Tue Feb 08 2011 Fedora Release Engineering - 0.151-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Wed Jan 12 2011 Roland McGrath - 0.151-1 +- Update to 0.151 + - libdwfl: Fix for more prelink cases with separate debug file. + - eu-strip: New flag --strip-sections to remove section headers entirely. + +* Thu Dec 2 2010 Roland McGrath - 0.150-2 +- libdwfl: Remove bogus assert. (#658268) + +* Tue Nov 23 2010 Roland McGrath - 0.150-1 +- Update to 0.150 + - libdw: Fix for handling huge .debug_aranges section. (#638432) + - libdwfl: Fix for handling prelinked DSO with separate debug file. (#652857) + - findtextrel: Fix diagnostics to work with usual section ordering. + +* Wed Sep 29 2010 jkeating - 0.149-2 +- Rebuilt for gcc bug 634757 + +* Mon Sep 13 2010 Roland McGrath - 0.149-1 +- Update to 0.149 + - libdw: Decode new DW_OP_GNU_implicit_pointer operation; + new function dwarf_getlocation_implicit_pointer. + - libdwfl: New function dwfl_dwarf_line. + - eu-addr2line: New flag -F/--flags to print more DWARF line info details. + - eu-readelf: better .debug_loc processing (#627729) + - eu-strings: Fix non-mmap file reading. (#609468) + - eu-strip: -g recognizes .gdb_index as a debugging section. (#631997) + +* Mon Jun 28 2010 Roland McGrath - 0.148-1 +- Update to 0.148 + - libdw: Accept DWARF 4 format: new functions dwarf_next_unit, + dwarf_offdie_types. + New functions dwarf_lineisa, dwarf_linediscriminator, + dwarf_lineop_index. + - libdwfl: Fixes in core-file handling, support cores from PIEs. (#588818) + When working from build IDs, don't open a named file + that mismatches. + - readelf: Handle DWARF 4 formats. + +* Mon May 3 2010 Roland McGrath - 0.147-1 +- Update to 0.147 + +* Wed Apr 21 2010 Roland McGrath - 0.146-1 +- Update to 0.146 + - libdwfl: New function dwfl_core_file_report. + - libelf: Fix handling of phdrs in truncated file. (#577310) + - libdwfl: Fix infinite loop handling clobbered link_map. (#576379) +- Package translations. + +* Tue Feb 23 2010 Roland McGrath - 0.145-1 +- Update to 0.145 + - Fix build with --disable-dependency-tracking. (#564646) + - Fix build with most recent glibc headers. + - libdw: Fix CFI decoding. (#563528) + - libdwfl: Fix address bias returned by CFI accessors. (#563528) + Fix core file module layout identification. (#559836) + - readelf: Fix CFI decoding. + +* Fri Jan 15 2010 Roland McGrath - 0.144-2 +- Fix sloppy #include's breaking build with F-13 glibc. + +* Thu Jan 14 2010 Roland McGrath - 0.144-1 +- Update to 0.144 + - libdw: New function dwarf_aggregate_size for computing (constant) type + sizes, including array_type cases with nontrivial calculation. + - readelf: Don't give errors for missing info under -a. + Handle Linux "VMCOREINFO" notes under -n. +- Resolves: RHBZ #527004, RHBZ #530704, RHBZ #550858 + +* Mon Sep 21 2009 Roland McGrath - 0.143-1 +- Update to 0.143 + - libdw: Various convenience functions for individual attributes now use + dwarf_attr_integrate to look up indirect inherited attributes. + Location expression handling now supports DW_OP_implicit_value. + - libdwfl: Support automatic decompression of files in XZ format, + and of Linux kernel images made with bzip2 or LZMA + (as well as gzip). + +* Tue Jul 28 2009 Roland McGrath - 0.142-1 +- Update to 0.142 + - libelf: Bug fix in filling gaps between sections. (#512840) + - libelf: Add elf_getshdrnum alias for elf_getshnum and elf_getshdrstrndx + alias for elf_getshstrndx and deprecate original names. + - libebl, elflint: Add support for STB_GNU_UNIQUE. (#511436) + - readelf: Add -N option, speeds up DWARF printing + without address->name lookups. (#505347) + - libdw: Add support for decoding DWARF CFI into location description form. + Handle some new DWARF 3 expression operations previously omitted. + Basic handling of some new encodings slated for DWARF 4. + +* 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) + +* 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 + 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) + +* 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 + +* 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) + - libdwfl, libelf: bug fixes (#439344, #438867, #438263, #438190) +- Remove Conflicts: libelf-devel from elfutils-libelf-devel. (#435742) + +* Sun Mar 2 2008 Roland McGrath - 0.133-2 +- Update to 0.133 + - readelf, elflint, libebl: SHT_GNU_ATTRIBUTE section handling (readelf -A) + - readelf: core note handling for NT_386_TLS, NT_PPC_SPE, Alpha NT_AUXV + - libdwfl: bug fixes and optimization in relocation handling + - elfcmp: bug fix for non-allocated section handling + - ld: implement newer features of binutils linker. +- Install eu-objdump and libasm, now has limited disassembler support. + +* Mon Jan 21 2008 Roland McGrath - 0.132-3 +- Update to 0.132 + - libelf: Use loff_t instead of off64_t in libelf.h header. (#377241) + - eu-readelf: Fix handling of ET_REL files in archives. + - libcpu: Implement x86 and x86-64 disassembler. + - libasm: Add interface for disassembler. + - all programs: add debugging of branch prediction. + - libelf: new function elf_scnshndx. + +* Sun Nov 11 2007 Roland McGrath - 0.131-1 +- Update to 0.131 + - libdw: DW_FORM_ref_addr support; dwarf_formref entry point now deprecated; + bug fixes for oddly-formatted DWARF + - libdwfl: bug fixes in offline archive support, symbol table handling; + apply partial relocations for dwfl_module_address_section on ET_REL + - libebl: powerpc backend support for Altivec registers + +* Wed Oct 17 2007 Roland McGrath - 0.130-3 +- Fix ET_REL support. +- Fix odd indentation in eu-readelf -x output. + +* Tue Oct 16 2007 Roland McGrath - 0.130-1 +- Update to 0.130 + - eu-readelf -p option can take an argument like -x for one section + - eu-readelf --archive-index (or -c) + - eu-readelf -n improved output for core dumps + - eu-readelf: handle SHT_NOTE sections without requiring phdrs (#249467) + - eu-elflint: ditto + - eu-elflint: stricter checks on debug sections + - eu-unstrip: new options, --list (or -n), --relocate (or -R) + - libelf: new function elf_getdata_rawchunk, replaces gelf_rawchunk; + new functions gelf_getnote, gelf_getauxv, gelf_update_auxv + - libebl: backend improvements (#324031) + - libdwfl: build_id support, new functions for it + - libdwfl: dwfl_module_addrsym fixes (#268761, #268981) + - libdwfl offline archive support, new script eu-make-debug-archive + +* Mon Aug 20 2007 Roland McGrath - 0.129-2 +- Fix false-positive eu-elflint failure on ppc -mbss-plt binaries. + +* Tue Aug 14 2007 Roland McGrath - 0.129-1 +- Update to 0.129 + - readelf: new options --hex-dump (or -x), --strings (or -p) (#250973) + - addr2line: new option --symbols (or -S) + - libdw: dwarf_getscopes fixes (#230235) + - libdwfl: dwfl_module_addrsym fixes (#249490) + +* Fri Jun 8 2007 Roland McGrath - 0.128-2 +- Update to 0.128 + - new program: unstrip + - elfcmp: new option --hash-inexact +- Replace Conflicts: with Provides/Requires using -arch + +* Wed Apr 18 2007 Roland McGrath - 0.127-1 +- Update to 0.127 + - libdw: new function dwarf_getsrcdirs + - libdwfl: new functions dwfl_module_addrsym, dwfl_report_begin_add, + dwfl_module_address_section + +* Mon Feb 5 2007 Roland McGrath - 0.126-1 +- Update to 0.126 + - New program eu-ar. + - libdw: fix missing dwarf_getelf (#227206) + - libdwfl: dwfl_module_addrname for st_size=0 symbols (#227167, #227231) + +* Wed Jan 10 2007 Roland McGrath - 0.125-3 +- Fix overeager warn_unused_result build failures. + +* Wed Jan 10 2007 Roland McGrath - 0.125-1 +- Update to 0.125 + - elflint: Compare DT_GNU_HASH tests. + - move archives into -static RPMs + - libelf, elflint: better support for core file handling + - Really fix libdwfl sorting of modules with 64-bit addresses (#220817). +- Resolves: RHBZ #220817, RHBZ #213792 + +* Tue Oct 10 2006 Roland McGrath - 0.124-1 +- eu-strip -f: copy symtab into debuginfo file when relocs use it (#203000) +- Update to 0.124 + - libebl: fix ia64 reloc support (#206981) + - libebl: sparc backend support for return value location + - libebl, libdwfl: backend register name support extended with more info + - libelf, libdw: bug fixes for unaligned accesses on machines that care + - readelf, elflint: trivial bugs fixed + +* Mon Aug 14 2006 Roland McGrath 0.123-1 +- Update to 0.123 + - libebl: Backend build fixes, thanks to Stepan Kasal. + - libebl: ia64 backend support for register names, return value location + - libdwfl: Handle truncated linux kernel module section names. + - libdwfl: Look for linux kernel vmlinux files with .debug suffix. + - elflint: Fix checks to permit --hash-style=gnu format. + +* Mon Jul 17 2006 Roland McGrath - 0.122-4 +- Fix warnings in elflint compilation. + +* Wed Jul 12 2006 Roland McGrath - 0.122-3 +- Update to 0.122 + - Fix libdwfl sorting of modules with 64-bit addresses (#198225). + - libebl: add function to test for relative relocation + - elflint: fix and extend DT_RELCOUNT/DT_RELACOUNT checks + - elflint, readelf: add support for DT_GNU_HASH + - libelf: add elf_gnu_hash + - elflint, readelf: add support for 64-bit SysV-style hash tables + - libdwfl: new functions dwfl_module_getsymtab, dwfl_module_getsym. + +* Thu Jun 15 2006 Roland McGrath - 0.121-1 +- Update to 0.121 + - libelf: bug fixes for rewriting existing files when using mmap (#187618). + - make all installed headers usable in C++ code (#193153). + - eu-readelf: better output format. + - eu-elflint: fix tests of dynamic section content. + - libdw, libdwfl: handle files without aranges info. + +* Thu May 25 2006 Jeremy Katz - 0.120-3 +- rebuild to pick up -devel deps + +* Tue Apr 4 2006 Roland McGrath - 0.120-2 +- Update to 0.120 + - License changed to GPL, with some exceptions for using + the libelf, libebl, libdw, and libdwfl library interfaces. + Red Hat elfutils is an included package of the Open Invention Network. + - dwarf.h updated for DWARF 3.0 final specification. + - libelf: Fix corruption in ELF_C_RDWR uses (#187618). + - libdwfl: New function dwfl_version; fixes for offline. + +* Fri Feb 10 2006 Jesse Keating - 0.119-1.2.1 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 0.119-1.2 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Fri Jan 13 2006 Roland McGrath - 0.119-1 +- update to 0.119 + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Sun Nov 27 2005 Roland McGrath - 0.118-1 +- update to 0.118 + - elflint: more tests. + - libdwfl: New function dwfl_module_register_names. + - libebl: New backend hook for register names. +- Make sure -fexceptions is always in CFLAGS. + +* Tue Nov 22 2005 Roland McGrath - 0.117-2 +- update to 0.117 + - libdwfl: New function dwfl_module_return_value_location (#166118) + - libebl: Backend improvements for several CPUs + +* Mon Oct 31 2005 Roland McGrath - 0.116-1 +- update to 0.116 + - libdw fixes, API changes and additions + - libdwfl fixes (#169672) + - eu-strip/libelf fix to preserve setuid/setgid permission bits (#167745) + +* Fri Sep 9 2005 Roland McGrath - 0.115-3 +- Update requires/conflicts for better biarch update behavior. + +* Mon Sep 5 2005 Roland McGrath - 0.115-2 +- update to 0.115 + - New program eu-strings. + - libdw: New function dwarf_getscopes_die. + - libelf: speed-ups of non-mmap reading. + - Implement --enable-gcov option for configure. + +* Wed Aug 24 2005 Roland McGrath - 0.114-1 +- update to 0.114 + - new program eu-ranlib + - libdw: new calls for inlines + - libdwfl: new calls for offline modules + +* Sat Aug 13 2005 Roland McGrath - 0.113-2 +- update to 0.113 + - elflint: relax a bit. Allow version definitions for defined symbols + against DSO versions also for symbols in nobits sections. + Allow .rodata section to have STRINGS and MERGE flag set. + - strip: add some more compatibility with binutils. + - libdwfl: bug fixes. +- Separate libdw et al into elfutils-libs subpackage. + +* Sat Aug 6 2005 Roland McGrath - 0.112-1 +- update to 0.112 + - elfcmp: some more relaxation. + - elflint: many more tests, especially regarding to symbol versioning. + - libelf: Add elfXX_offscn and gelf_offscn. + - libasm: asm_begin interface changes. + - libebl: Add three new interfaces to directly access machine, class, + and data encoding information. + +* Fri Jul 29 2005 Roland McGrath - 0.111-2 +- update portability patch + +* Thu Jul 28 2005 Roland McGrath - 0.111-1 +- update to 0.111 + - libdwfl library now merged into libdw + +* Sun Jul 24 2005 Roland McGrath - 0.110-1 +- update to 0.110 + +* Fri Jul 22 2005 Roland McGrath - 0.109-2 +- update to 0.109 + - verify that libebl modules are from the same build + - new eu-elflint checks on copy relocations + - new program eu-elfcmp + - new experimental libdwfl library + +* Thu Jun 9 2005 Roland McGrath - 0.108-5 +- robustification of eu-strip and eu-readelf + +* Wed May 25 2005 Roland McGrath - 0.108-3 +- more robustification + +* Mon May 16 2005 Roland McGrath - 0.108-2 +- robustification + +* Mon May 9 2005 Roland McGrath - 0.108-1 +- update to 0.108 + - merge strip fixes + - sort records in dwarf_getsrclines, fix dwarf_getsrc_die searching + - update elf.h from glibc + +* Sun May 8 2005 Roland McGrath - 0.107-2 +- fix strip -f byte-swapping bug + +* Sun May 8 2005 Roland McGrath - 0.107-1 +- update to 0.107 + - readelf: improve DWARF output format + - elflint: -d option to support checking separate debuginfo files + - strip: fix ET_REL debuginfo files (#156341) + +* Mon Apr 4 2005 Roland McGrath - 0.106-3 +- fix some bugs in new code, reenable make check + +* Mon Apr 4 2005 Roland McGrath - 0.106-2 +- disable make check for most arches, for now + +* Mon Apr 4 2005 Roland McGrath - 0.106-1 +- update to 0.106 + +* Mon Mar 28 2005 Roland McGrath - 0.104-2 +- update to 0.104 + +* Wed Mar 23 2005 Jakub Jelinek 0.103-2 +- update to 0.103 + +* Wed Feb 16 2005 Jakub Jelinek 0.101-2 +- update to 0.101. +- use %%configure macro to get CFLAGS etc. right + +* Sat Feb 5 2005 Jeff Johnson 0.99-2 +- upgrade to 0.99. + +* Sun Sep 26 2004 Jeff Johnson 0.97-3 +- upgrade to 0.97. + +* Tue Aug 17 2004 Jakub Jelinek 0.95-5 +- upgrade to 0.96. + +* Mon Jul 5 2004 Jakub Jelinek 0.95-4 +- rebuilt with GCC 3.4.x, workaround VLA + alloca mixing + warning + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Fri Apr 2 2004 Jeff Johnson 0.95-2 +- upgrade to 0.95. + +* Tue Mar 02 2004 Elliot Lee +- rebuilt + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Fri Jan 16 2004 Jakub Jelinek 0.94-1 +- upgrade to 0.94 + +* Fri Jan 16 2004 Jakub Jelinek 0.93-1 +- upgrade to 0.93 + +* Thu Jan 8 2004 Jakub Jelinek 0.92-1 +- full version +- macroized spec file for GPL or OSL builds +- include only libelf under GPL plus wrapper scripts + +* Wed Jan 7 2004 Jakub Jelinek 0.91-2 +- macroized spec file for GPL or OSL builds + +* Wed Jan 7 2004 Ulrich Drepper +- split elfutils-devel into two packages. + +* Wed Jan 7 2004 Jakub Jelinek 0.91-1 +- include only libelf under GPL plus wrapper scripts + +* Tue Dec 23 2003 Jeff Johnson 0.89-3 +- readelf, not readline, in %%description (#111214). + +* Fri Sep 26 2003 Bill Nottingham 0.89-1 +- update to 0.89 (fix eu-strip) + +* Tue Sep 23 2003 Jakub Jelinek 0.86-3 +- update to 0.86 (fix eu-strip on s390x/alpha) +- libebl is an archive now; remove references to DSO + +* Mon Jul 14 2003 Jeff Johnson 0.84-3 +- upgrade to 0.84 (readelf/elflint improvements, rawhide bugs fixed). + +* Fri Jul 11 2003 Jeff Johnson 0.83-3 +- upgrade to 0.83 (fix invalid ELf handle on *.so strip, more). + +* Wed Jul 9 2003 Jeff Johnson 0.82-3 +- upgrade to 0.82 (strip tests fixed on big-endian). + +* Tue Jul 8 2003 Jeff Johnson 0.81-3 +- upgrade to 0.81 (strip excludes unused symtable entries, test borked). + +* Thu Jun 26 2003 Jeff Johnson 0.80-3 +- upgrade to 0.80 (debugedit changes for kernel in progress). + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Wed May 21 2003 Jeff Johnson 0.79-2 +- upgrade to 0.79 (correct formats for size_t, more of libdw "works"). + +* Mon May 19 2003 Jeff Johnson 0.78-2 +- upgrade to 0.78 (libdwarf bugfix, libdw additions). + +* Mon Feb 24 2003 Elliot Lee +- debuginfo rebuild + +* Thu Feb 20 2003 Jeff Johnson 0.76-2 +- use the correct way of identifying the section via the sh_info link. + +* Sat Feb 15 2003 Jakub Jelinek 0.75-2 +- update to 0.75 (eu-strip -g fix) + +* Tue Feb 11 2003 Jakub Jelinek 0.74-2 +- update to 0.74 (fix for writing with some non-dirty sections) + +* Thu Feb 6 2003 Jeff Johnson 0.73-3 +- another -0.73 update (with sparc fixes). +- do "make check" in %%check, not %%install, section. + +* Mon Jan 27 2003 Jeff Johnson 0.73-2 +- update to 0.73 (with s390 fixes). + +* Wed Jan 22 2003 Tim Powers +- rebuilt + +* Wed Jan 22 2003 Jakub Jelinek 0.72-4 +- fix arguments to gelf_getsymshndx and elf_getshstrndx +- fix other warnings +- reenable checks on s390x + +* Sat Jan 11 2003 Karsten Hopp 0.72-3 +- temporarily disable checks on s390x, until someone has + time to look at it + +* Thu Dec 12 2002 Jakub Jelinek 0.72-2 +- update to 0.72 + +* Wed Dec 11 2002 Jakub Jelinek 0.71-2 +- update to 0.71 + +* Wed Dec 11 2002 Jeff Johnson 0.69-4 +- update to 0.69. +- add "make check" and segfault avoidance patch. +- elfutils-libelf needs to run ldconfig. + +* Tue Dec 10 2002 Jeff Johnson 0.68-2 +- update to 0.68. + +* Fri Dec 6 2002 Jeff Johnson 0.67-2 +- update to 0.67. + +* Tue Dec 3 2002 Jeff Johnson 0.65-2 +- update to 0.65. + +* Mon Dec 2 2002 Jeff Johnson 0.64-2 +- update to 0.64. + +* Sun Dec 1 2002 Ulrich Drepper 0.64 +- split packages further into elfutils-libelf + +* Sat Nov 30 2002 Jeff Johnson 0.63-2 +- update to 0.63. + +* Fri Nov 29 2002 Ulrich Drepper 0.62 +- Adjust for dropping libtool + +* Sun Nov 24 2002 Jeff Johnson 0.59-2 +- update to 0.59 + +* Thu Nov 14 2002 Jeff Johnson 0.56-2 +- update to 0.56 + +* Thu Nov 7 2002 Jeff Johnson 0.54-2 +- update to 0.54 + +* Sun Oct 27 2002 Jeff Johnson 0.53-2 +- update to 0.53 +- drop x86_64 hack, ICE fixed in gcc-3.2-11. + +* Sat Oct 26 2002 Jeff Johnson 0.52-3 +- get beehive to punch a rhpkg generated package. + +* Wed Oct 23 2002 Jeff Johnson 0.52-2 +- build in 8.0.1. +- x86_64: avoid gcc-3.2 ICE on x86_64 for now. + +* Tue Oct 22 2002 Ulrich Drepper 0.52 +- Add libelf-devel to conflicts for elfutils-devel + +* Mon Oct 21 2002 Ulrich Drepper 0.50 +- Split into runtime and devel package + +* Fri Oct 18 2002 Ulrich Drepper 0.49 +- integrate into official sources + +* Wed Oct 16 2002 Jeff Johnson 0.46-1 +- Swaddle. diff --git a/libasm.a b/libasm.a new file mode 100644 index 0000000..03cafd9 --- /dev/null +++ b/libasm.a @@ -0,0 +1,5 @@ +/* GNU ld script + + Libraries in Developer Toolset are linked in statically to allow + compiled binaries to run even when DTS is not installed. */ +INPUT(libasm.ar) diff --git a/libasm.so b/libasm.so new file mode 100644 index 0000000..03cafd9 --- /dev/null +++ b/libasm.so @@ -0,0 +1,5 @@ +/* GNU ld script + + Libraries in Developer Toolset are linked in statically to allow + compiled binaries to run even when DTS is not installed. */ +INPUT(libasm.ar) diff --git a/libdw.a b/libdw.a new file mode 100644 index 0000000..60b8f20 --- /dev/null +++ b/libdw.a @@ -0,0 +1,7 @@ +/* GNU ld script + + Static libraries in Developer Toolset are named .ar to prevent + brp-strip-static-archive from stripping them. But we still want + them to be found in cases like -static -lxyz, hence this linker + script. */ +GROUP(libdw.ar libebl.ar libebl_static_pic.ar libcpu_static_pic.ar) diff --git a/libdw.so b/libdw.so new file mode 100644 index 0000000..03a0688 --- /dev/null +++ b/libdw.so @@ -0,0 +1,7 @@ +/* GNU ld script + + Libraries in Developer Toolset are linked in statically to allow + compiled binaries to run even when DTS is not installed. */ +GROUP(libdw.ar libebl.ar libebl_static_pic.ar libcpu_static_pic.ar) +INPUT(-llzma -lbz2 -lz) +INPUT(-lelf) diff --git a/libelf.a b/libelf.a new file mode 100644 index 0000000..3d14ac9 --- /dev/null +++ b/libelf.a @@ -0,0 +1,7 @@ +/* GNU ld script + + Static libraries in Developer Toolset are named .ar to prevent + brp-strip-static-archive from stripping them. But we still want + them to be found in cases like -static -lxyz, hence this linker + script. */ +INPUT(libelf.ar) diff --git a/libelf.so b/libelf.so new file mode 100644 index 0000000..ac3ef2c --- /dev/null +++ b/libelf.so @@ -0,0 +1,6 @@ +/* GNU ld script + + Libraries in Developer Toolset are linked in statically to allow + compiled binaries to run even when DTS is not installed. */ +INPUT(libelf.ar) +INPUT(-lz) diff --git a/sources b/sources new file mode 100644 index 0000000..5277574 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (elfutils-0.176.tar.bz2) = 7f032913be363a43229ded85d495dcf7542b3c85974aaaba0d984228dc9ac1721da3dc388d3fa02325a80940161db7e9ad2c9e4521a424ad8a7d050c0902915b