diff --git a/.elfutils.metadata b/.elfutils.metadata new file mode 100644 index 0000000..3ee22bb --- /dev/null +++ b/.elfutils.metadata @@ -0,0 +1 @@ +6511203cae7225ae780501834a7ccd234b14889a SOURCES/elfutils-0.176.tar.bz2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..89b10d7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/elfutils-0.176.tar.bz2 diff --git a/SOURCES/elfutils-0.176-dwelf_elf_e_machine_string.patch b/SOURCES/elfutils-0.176-dwelf_elf_e_machine_string.patch new file mode 100644 index 0000000..9703ae5 --- /dev/null +++ b/SOURCES/elfutils-0.176-dwelf_elf_e_machine_string.patch @@ -0,0 +1,923 @@ +From cd2a24f2b66ad51294fad0b08a4d037b2d966d21 Mon Sep 17 00:00:00 2001 +From: Mark Wielaard +Date: Tue, 6 Aug 2019 18:39:46 +0200 +Subject: [PATCH] dwelf_elf_e_machine_string backport for 0.176 - eu-readelf + only. + +--- + libdwelf/dwelf_elf_e_machine_string.c | 404 ++++++++++++++++++++++++ + src/Makefile.am | 2 + + src/readelf.c | 9 +- + tests/Makefile.am | 11 +- + tests/dwelf_elf_e_machine_string_test.c | 66 ++++ + tests/run-dwelf_elf_e_machine_string.sh | 31 ++ + 6 files changed, 519 insertions(+), 4 deletions(-) + create mode 100644 libdwelf/dwelf_elf_e_machine_string.c + create mode 100644 tests/dwelf_elf_e_machine_string_test.c + create mode 100755 tests/run-dwelf_elf_e_machine_string.sh + +diff --git a/libdwelf/dwelf_elf_e_machine_string.c b/libdwelf/dwelf_elf_e_machine_string.c +new file mode 100644 +index 00000000..20f33173 +--- /dev/null ++++ b/libdwelf/dwelf_elf_e_machine_string.c +@@ -0,0 +1,404 @@ ++/* Returns a human readable description of an ELF header e_machine value. ++ 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 either ++ ++ * the GNU Lesser General Public License as published by the Free ++ Software Foundation; either version 3 of the License, or (at ++ your option) any later version ++ ++ or ++ ++ * the GNU General Public License as published by the Free ++ Software Foundation; either version 2 of the License, or (at ++ your option) any later version ++ ++ or both in parallel, as here. ++ ++ 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 copies of the GNU General Public License and ++ the GNU Lesser General Public License along with this program. If ++ not, see . */ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#include "libdwelf.h" ++ ++ ++const char * ++dwelf_elf_e_machine_string (int machine) ++{ ++ switch (machine) ++ { ++ case EM_NONE: ++ return "None"; ++ case EM_M32: ++ return "WE32100"; ++ case EM_SPARC: ++ return "SPARC"; ++ case EM_386: ++ return "Intel 80386"; ++ case EM_68K: ++ return "M68K"; ++ case EM_88K: ++ return "M88K"; ++ case EM_IAMCU: ++ return "Intel MCU"; ++ case EM_860: ++ return "Intel 80860"; ++ case EM_MIPS: ++ return "MIPS R3000"; ++ case EM_S370: ++ return "IBM System/370"; ++ case EM_MIPS_RS3_LE: ++ return "MIPS R3000"; ++ case EM_PARISC: ++ return "HPPA"; ++ case EM_VPP500: ++ return "Fujitsu VPP500"; ++ case EM_SPARC32PLUS: ++ return "SPARC v8+"; ++ case EM_960: ++ return "Intel 80960"; ++ case EM_PPC: ++ return "PowerPC"; ++ case EM_PPC64: ++ return "PowerPC64"; ++ case EM_S390: ++ return "IBM S/390"; ++ case EM_SPU: ++ return "IBM SPU/SPC"; ++ case EM_V800: ++ return "NEC V800"; ++ case EM_FR20: ++ return "Fujitsu FR20"; ++ case EM_RH32: ++ return "TRW RH-32"; ++ case EM_RCE: ++ return "Motorola RCE"; ++ case EM_ARM: ++ return "ARM"; ++ case EM_FAKE_ALPHA: ++ return "Digital Alpha"; ++ case EM_SH: ++ return "SH"; ++ case EM_SPARCV9: ++ return "SPARC v9"; ++ case EM_TRICORE: ++ return "Siemens Tricore"; ++ case EM_ARC: ++ return "ARC"; ++ case EM_H8_300: ++ return "H8/300"; ++ case EM_H8_300H: ++ return "H8/300H"; ++ case EM_H8S: ++ return "H8S"; ++ case EM_H8_500: ++ return "H8/500"; ++ case EM_IA_64: ++ return "Intel IA-64"; ++ case EM_MIPS_X: ++ return "Stanford MIPS-X"; ++ case EM_COLDFIRE: ++ return "Motorola Coldfire"; ++ case EM_68HC12: ++ return "Motorola M68HC12"; ++ case EM_MMA: ++ return "Fujitsu MMA Multimedia Accelerator"; ++ case EM_PCP: ++ return "Siemens PCP"; ++ case EM_NCPU: ++ return "Sony nCPU embeded RISC"; ++ case EM_NDR1: ++ return "Denso NDR1 microprocessor"; ++ case EM_STARCORE: ++ return "Motorola Star*Core processor"; ++ case EM_ME16: ++ return "Toyota ME16 processor"; ++ case EM_ST100: ++ return "STMicroelectronic ST100"; ++ case EM_TINYJ: ++ return "Advanced Logic Corporation Tinyj"; ++ case EM_X86_64: ++ return "AMD x86-64"; ++ case EM_PDSP: ++ return "Sony DSP Processor"; ++ case EM_PDP10: ++ return "Digital PDP-10"; ++ case EM_PDP11: ++ return "Digital PDP-11"; ++ case EM_FX66: ++ return "Siemens FX66 microcontroller"; ++ case EM_ST9PLUS: ++ return "STMicroelectronics ST9+"; ++ case EM_ST7: ++ return "STMicroelectronics ST7"; ++ case EM_68HC16: ++ return "Motorola MC68HC16 microcontroller"; ++ case EM_68HC11: ++ return "Motorola MC68HC11 microcontroller"; ++ case EM_68HC08: ++ return "Motorola MC68HC08 microcontroller"; ++ case EM_68HC05: ++ return "Motorola MC68HC05 microcontroller"; ++ case EM_SVX: ++ return "Silicon Graphics SVx"; ++ case EM_ST19: ++ return "STMicroelectronics ST19"; ++ case EM_VAX: ++ return "Digital VAX"; ++ case EM_CRIS: ++ return "Axis Communications 32-bit embedded processor"; ++ case EM_JAVELIN: ++ return "Infineon Technologies 32-bit embedded processor"; ++ case EM_FIREPATH: ++ return "Element 14 64-bit DSP Processor"; ++ case EM_ZSP: ++ return "LSI Logic 16-bit DSP Processor"; ++ case EM_MMIX: ++ return "Donald Knuth's educational 64-bit processor"; ++ case EM_HUANY: ++ return "Harvard University machine-independent object"; ++ case EM_PRISM: ++ return "SiTera Prism"; ++ case EM_AVR: ++ return "Atmel AVR 8-bit microcontroller"; ++ case EM_FR30: ++ return "Fujitsu FR30"; ++ case EM_D10V: ++ return "Mitsubishi D10V"; ++ case EM_D30V: ++ return "Mitsubishi D30V"; ++ case EM_V850: ++ return "NEC v850"; ++ case EM_M32R: ++ return "Mitsubishi M32R"; ++ case EM_MN10300: ++ return "Matsushita MN10300"; ++ case EM_MN10200: ++ return "Matsushita MN10200"; ++ case EM_PJ: ++ return "picoJava"; ++ case EM_OPENRISC: ++ return "OpenRISC"; ++ case EM_ARC_COMPACT: ++ return "ARC International ARCompact"; ++ case EM_XTENSA: ++ return "Tensilica Xtensa Architecture"; ++ case EM_VIDEOCORE: ++ return "Alphamosaic VideoCore"; ++ case EM_TMM_GPP: ++ return "Thompson Multimedia General Purpose Processor"; ++ case EM_NS32K: ++ return "National Semiconductor 32000"; ++ case EM_TPC: ++ return "Tenor Network TPC"; ++ case EM_SNP1K: ++ return "Trebia SNP 1000"; ++ case EM_ST200: ++ return "STMicroelectronics ST200"; ++ case EM_IP2K: ++ return "Ubicom IP2xxx"; ++ case EM_MAX: ++ return "MAX processor"; ++ case EM_CR: ++ return "National Semiconductor CompactRISC"; ++ case EM_F2MC16: ++ return "Fujitsu F2MC16"; ++ case EM_MSP430: ++ return "Texas Instruments msp430"; ++ case EM_BLACKFIN: ++ return "Analog Devices Blackfin DSP"; ++ case EM_SE_C33: ++ return "Seiko Epson S1C33"; ++ case EM_SEP: ++ return "Sharp embedded microprocessor"; ++ case EM_ARCA: ++ return "Arca RISC"; ++ case EM_UNICORE: ++ return "Unicore"; ++ case EM_EXCESS: ++ return "eXcess configurable CPU"; ++ case EM_DXP: ++ return "Icera Semiconductor Deep Execution Processor"; ++ case EM_ALTERA_NIOS2: ++ return "Altera Nios II"; ++ case EM_CRX: ++ return "National Semiconductor CompactRISC CRX"; ++ case EM_XGATE: ++ return "Motorola XGATE"; ++ case EM_C166: ++ return "Infineon C16x/XC16x"; ++ case EM_M16C: ++ return "Renesas M16C"; ++ case EM_DSPIC30F: ++ return "Microchip Technology dsPIC30F"; ++ case EM_CE: ++ return "Freescale Communication Engine RISC"; ++ case EM_M32C: ++ return "Renesas M32C"; ++ case EM_TSK3000: ++ return "Altium TSK3000"; ++ case EM_RS08: ++ return "Freescale RS08"; ++ case EM_SHARC: ++ return "Analog Devices SHARC"; ++ case EM_ECOG2: ++ return "Cyan Technology eCOG2"; ++ case EM_SCORE7: ++ return "Sunplus S+core7 RISC"; ++ case EM_DSP24: ++ return "New Japan Radio (NJR) 24-bit DSP"; ++ case EM_VIDEOCORE3: ++ return "Broadcom VideoCore III"; ++ case EM_LATTICEMICO32: ++ return "RISC for Lattice FPGA"; ++ case EM_SE_C17: ++ return "Seiko Epson C17"; ++ case EM_TI_C6000: ++ return "Texas Instruments TMS320C6000 DSP"; ++ case EM_TI_C2000: ++ return "Texas Instruments TMS320C2000 DSP"; ++ case EM_TI_C5500: ++ return "Texas Instruments TMS320C55x DSP"; ++ case EM_TI_ARP32: ++ return "Texas Instruments Application Specific RISC"; ++ case EM_TI_PRU: ++ return "Texas Instruments Programmable Realtime Unit"; ++ case EM_MMDSP_PLUS: ++ return "STMicroelectronics 64bit VLIW DSP"; ++ case EM_CYPRESS_M8C: ++ return "Cypress M8C"; ++ case EM_R32C: ++ return "Renesas R32C"; ++ case EM_TRIMEDIA: ++ return "NXP Semiconductors TriMedia"; ++ case EM_QDSP6: ++ return "QUALCOMM DSP6"; ++ case EM_8051: ++ return "Intel 8051 and variants"; ++ case EM_STXP7X: ++ return "STMicroelectronics STxP7x"; ++ case EM_NDS32: ++ return "Andes Technology compact code size embeded RISC"; ++ case EM_ECOG1X: ++ return "Cyan Technology eCOG1X"; ++ case EM_MAXQ30: ++ return "Dallas Semicondutor MAXQ30"; ++ case EM_XIMO16: ++ return "New Japan Radio (NJR) 16-bit DSP"; ++ case EM_MANIK: ++ return "M2000 Reconfigurable RISC"; ++ case EM_CRAYNV2: ++ return "Cray NV2 vector architecture"; ++ case EM_RX: ++ return "Renesas RX"; ++ case EM_METAG: ++ return "Imagination Technologies META"; ++ case EM_MCST_ELBRUS: ++ return "MCST Elbrus"; ++ case EM_ECOG16: ++ return "Cyan Technology eCOG16"; ++ case EM_CR16: ++ return "National Semiconductor CompactRISC"; ++ case EM_ETPU: ++ return "Freescale Extended Time Processing Unit"; ++ case EM_SLE9X: ++ return "Infineon Technologies SLE9X"; ++ case EM_L10M: ++ return "Intel L10M"; ++ case EM_K10M: ++ return "Intel K10M"; ++ case EM_AARCH64: ++ return "AARCH64"; ++ case EM_AVR32: ++ return "Amtel AVR32"; ++ case EM_STM8: ++ return "STMicroelectronics STM8"; ++ case EM_TILE64: ++ return "Tilera TILE64"; ++ case EM_TILEPRO: ++ return "Tilera TILEPro"; ++ case EM_MICROBLAZE: ++ return "Xilinx MicroBlaze"; ++ case EM_CUDA: ++ return "NVIDIA CUDA"; ++ case EM_TILEGX: ++ return "Tilera TILE-Gx"; ++ case EM_CLOUDSHIELD: ++ return "CloudShield"; ++ case EM_COREA_1ST: ++ return "KIPO-KAIST Core-A 1st gen"; ++ case EM_COREA_2ND: ++ return "KIPO-KAIST Core-A 2nd gen"; ++ case EM_ARC_COMPACT2: ++ return "Synopsys ARCompact V2"; ++ case EM_OPEN8: ++ return "Open8 RISC"; ++ case EM_RL78: ++ return "Renesas RL78"; ++ case EM_VIDEOCORE5: ++ return "Broadcom VideoCore V"; ++ case EM_78KOR: ++ return "Renesas 78KOR"; ++ case EM_56800EX: ++ return "Freescale 56800EX DSC"; ++ case EM_BA1: ++ return "Beyond BA1"; ++ case EM_BA2: ++ return "Beyond BA2"; ++ case EM_XCORE: ++ return "XMOS xCORE"; ++ case EM_MCHP_PIC: ++ return "Microchip 8-bit PIC"; ++ case EM_KM32: ++ return "KM211 KM32"; ++ case EM_KMX32: ++ return "KM211 KMX32"; ++ case EM_EMX16: ++ return "KM211 KMX16"; ++ case EM_EMX8: ++ return "KM211 KMX8"; ++ case EM_KVARC: ++ return "KM211 KVARC"; ++ case EM_CDP: ++ return "Paneve CDP"; ++ case EM_COGE: ++ return "Cognitive Smart Memory Processor"; ++ case EM_COOL: ++ return "Bluechip CoolEngine"; ++ case EM_NORC: ++ return "Nanoradio Optimized RISC"; ++ case EM_CSR_KALIMBA: ++ return "CSR Kalimba"; ++ case EM_Z80: ++ return "Zilog Z80"; ++ case EM_VISIUM: ++ return "CDS VISIUMcore"; ++ case EM_FT32: ++ return "FTDI Chip FT32"; ++ case EM_MOXIE: ++ return "Moxie"; ++ case EM_AMDGPU: ++ return "AMD GPU"; ++ case EM_RISCV: ++ return "RISC-V"; ++ case EM_BPF: ++ return "BPF"; ++ ++ case EM_ALPHA: ++ return "Alpha"; ++ ++ default: ++ return NULL; ++ } ++} +diff --git a/src/Makefile.am b/src/Makefile.am +index 2b1c0dcb..0bb20804 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -67,6 +67,8 @@ ranlib_no_Wstack_usage = yes + ar_no_Wstack_usage = yes + unstrip_no_Wstack_usage = yes + ++readelf_SOURCES = readelf.c ../libdwelf/dwelf_elf_e_machine_string.c ++ + readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl + nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl \ + $(demanglelib) +diff --git a/src/readelf.c b/src/readelf.c +index 33706bde..1db88393 100644 +--- a/src/readelf.c ++++ b/src/readelf.c +@@ -57,6 +57,8 @@ + + #include "../libdw/known-dwarf.h" + ++extern const char *dwelf_elf_e_machine_string (int machine); ++ + #ifdef __linux__ + #define CORE_SIGILL SIGILL + #define CORE_SIGBUS SIGBUS +@@ -1070,7 +1072,12 @@ print_ehdr (Ebl *ebl, GElf_Ehdr *ehdr) + fputs_unlocked (gettext (" Type: "), stdout); + print_file_type (ehdr->e_type); + +- printf (gettext (" Machine: %s\n"), ebl->name); ++ const char *machine = dwelf_elf_e_machine_string (ehdr->e_machine); ++ if (machine != NULL) ++ printf (gettext (" Machine: %s\n"), machine); ++ else ++ printf (gettext (" Machine: : 0x%x\n"), ++ ehdr->e_machine); + + printf (gettext (" Version: %d %s\n"), + ehdr->e_version, +diff --git a/tests/dwelf_elf_e_machine_string_test.c b/tests/dwelf_elf_e_machine_string_test.c +new file mode 100644 +index 00000000..2f14d704 +--- /dev/null ++++ b/tests/dwelf_elf_e_machine_string_test.c +@@ -0,0 +1,66 @@ ++/* Test program for dwelf_elf_e_machine_string ++ 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 ELFUTILS_HEADER(dwelf) ++ ++extern const char *dwelf_elf_e_machine_string (int machine); ++ ++int ++main (int argc, char **argv) ++{ ++ int i; ++ for (i = 1; i < argc; i++) ++ { ++ long val; ++ int em; ++ const char *machine; ++ ++ if (strncmp ("0x", argv[i], 2) == 0) ++ val = strtol (&argv[i][2], NULL, 16); ++ else ++ val = strtol (argv[i], NULL, 10); ++ ++ if ((errno == ERANGE && (val == LONG_MAX || val == LONG_MIN)) ++ || (errno != 0 && val == 0)) ++ { ++ perror ("strtol"); ++ exit (EXIT_FAILURE); ++ } ++ ++ em = val; ++ assert (em == val); ++ ++ machine = dwelf_elf_e_machine_string (em); ++ printf ("0x%x %s\n", em, machine); ++ assert (machine != NULL); ++ } ++ ++ return 0; ++} +diff --git a/tests/run-dwelf_elf_e_machine_string.sh b/tests/run-dwelf_elf_e_machine_string.sh +new file mode 100755 +index 00000000..ba6d0e63 +--- /dev/null ++++ b/tests/run-dwelf_elf_e_machine_string.sh +@@ -0,0 +1,31 @@ ++#! /bin/bash ++# Test to make sure all EM values in elf.h are recognized ++# 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 ++ ++# Get all known EM values from elf.h and pass them through the ++# preprocessor to get the numbers. Call dwelf_elf_e_machine_string on ++# all of them. ++EM_VALUES=$(grep ^\#define\ EM_ ${abs_srcdir}/../libelf/elf.h \ ++ | cut -f2 -d\ | cut -f1 | grep -v ^EM_NUM$ | xargs echo) ++# echo "EM_VALUES: $EM_VALUES" ++EM_NUMBERS=$((cat ${abs_srcdir}/../libelf/elf.h; echo "$EM_VALUES") \ ++ | gcc -E - | tail -1) ++# echo "EM_NUMBERS: $EM_NUMBERS" ++ ++testrun ${abs_top_builddir}/tests/dwelf_elf_e_machine_string $EM_NUMBERS +-- +2.18.1 + +--- elfutils-0.176/src/Makefile.in 2019-02-15 16:46:53.000000000 +0100 ++++ elfutils-0.176.e_machine/src/Makefile.in 2019-08-06 18:47:51.447720727 +0200 +@@ -165,8 +165,9 @@ + ranlib_OBJECTS = ranlib.$(OBJEXT) + ranlib_DEPENDENCIES = libar.a $(am__DEPENDENCIES_2) $(libeu) \ + $(am__DEPENDENCIES_1) +-readelf_SOURCES = readelf.c +-readelf_OBJECTS = readelf.$(OBJEXT) ++am_readelf_OBJECTS = readelf.$(OBJEXT) \ ++ dwelf_elf_e_machine_string.$(OBJEXT) ++readelf_OBJECTS = $(am_readelf_OBJECTS) + readelf_DEPENDENCIES = $(am__DEPENDENCIES_3) $(libebl) \ + $(am__DEPENDENCIES_2) $(libeu) $(am__DEPENDENCIES_1) + size_SOURCES = size.c +@@ -235,14 +236,19 @@ + am__maybe_remake_depfiles = depfiles + am__depfiles_remade = ./$(DEPDIR)/addr2line.Po ./$(DEPDIR)/ar.Po \ + ./$(DEPDIR)/arlib-argp.Po ./$(DEPDIR)/arlib.Po \ +- ./$(DEPDIR)/arlib2.Po ./$(DEPDIR)/elfcmp.Po \ +- ./$(DEPDIR)/elfcompress.Po ./$(DEPDIR)/elflint.Po \ +- ./$(DEPDIR)/findtextrel.Po ./$(DEPDIR)/nm.Po \ +- ./$(DEPDIR)/objdump.Po ./$(DEPDIR)/ranlib.Po \ ++ ./$(DEPDIR)/arlib2.Po \ ++ ./$(DEPDIR)/dwelf_elf_e_machine_string.Po \ ++ ./$(DEPDIR)/elfcmp.Po ./$(DEPDIR)/elfcompress.Po \ ++ ./$(DEPDIR)/elflint.Po ./$(DEPDIR)/findtextrel.Po \ ++ ./$(DEPDIR)/nm.Po ./$(DEPDIR)/objdump.Po ./$(DEPDIR)/ranlib.Po \ + ./$(DEPDIR)/readelf.Po ./$(DEPDIR)/size.Po \ + ./$(DEPDIR)/stack.Po ./$(DEPDIR)/strings.Po \ + ./$(DEPDIR)/strip.Po ./$(DEPDIR)/unstrip.Po + am__mv = mv -f ++AM_V_lt = $(am__v_lt_@AM_V@) ++am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) ++am__v_lt_0 = --silent ++am__v_lt_1 = + COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + AM_V_CC = $(am__v_CC_@AM_V@) +@@ -256,11 +262,11 @@ + am__v_CCLD_0 = @echo " CCLD " $@; + am__v_CCLD_1 = + SOURCES = $(libar_a_SOURCES) addr2line.c ar.c elfcmp.c elfcompress.c \ +- elflint.c findtextrel.c nm.c objdump.c ranlib.c readelf.c \ +- size.c stack.c strings.c strip.c unstrip.c ++ elflint.c findtextrel.c nm.c objdump.c ranlib.c \ ++ $(readelf_SOURCES) size.c stack.c strings.c strip.c unstrip.c + DIST_SOURCES = $(libar_a_SOURCES) addr2line.c ar.c elfcmp.c \ + elfcompress.c elflint.c findtextrel.c nm.c objdump.c ranlib.c \ +- readelf.c size.c stack.c strings.c strip.c unstrip.c ++ $(readelf_SOURCES) size.c stack.c strings.c strip.c unstrip.c + am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ +@@ -490,6 +496,7 @@ + ranlib_no_Wstack_usage = yes + ar_no_Wstack_usage = yes + unstrip_no_Wstack_usage = yes ++readelf_SOURCES = readelf.c ../libdwelf/dwelf_elf_e_machine_string.c + readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl + nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl \ + $(demanglelib) +@@ -713,6 +720,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arlib-argp.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arlib.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arlib2.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwelf_elf_e_machine_string.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elfcmp.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elfcompress.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elflint.Po@am__quote@ # am--include-marker +@@ -747,6 +755,20 @@ + @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + ++dwelf_elf_e_machine_string.o: ../libdwelf/dwelf_elf_e_machine_string.c ++@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dwelf_elf_e_machine_string.o -MD -MP -MF $(DEPDIR)/dwelf_elf_e_machine_string.Tpo -c -o dwelf_elf_e_machine_string.o `test -f '../libdwelf/dwelf_elf_e_machine_string.c' || echo '$(srcdir)/'`../libdwelf/dwelf_elf_e_machine_string.c ++@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dwelf_elf_e_machine_string.Tpo $(DEPDIR)/dwelf_elf_e_machine_string.Po ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libdwelf/dwelf_elf_e_machine_string.c' object='dwelf_elf_e_machine_string.o' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dwelf_elf_e_machine_string.o `test -f '../libdwelf/dwelf_elf_e_machine_string.c' || echo '$(srcdir)/'`../libdwelf/dwelf_elf_e_machine_string.c ++ ++dwelf_elf_e_machine_string.obj: ../libdwelf/dwelf_elf_e_machine_string.c ++@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dwelf_elf_e_machine_string.obj -MD -MP -MF $(DEPDIR)/dwelf_elf_e_machine_string.Tpo -c -o dwelf_elf_e_machine_string.obj `if test -f '../libdwelf/dwelf_elf_e_machine_string.c'; then $(CYGPATH_W) '../libdwelf/dwelf_elf_e_machine_string.c'; else $(CYGPATH_W) '$(srcdir)/../libdwelf/dwelf_elf_e_machine_string.c'; fi` ++@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dwelf_elf_e_machine_string.Tpo $(DEPDIR)/dwelf_elf_e_machine_string.Po ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libdwelf/dwelf_elf_e_machine_string.c' object='dwelf_elf_e_machine_string.obj' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dwelf_elf_e_machine_string.obj `if test -f '../libdwelf/dwelf_elf_e_machine_string.c'; then $(CYGPATH_W) '../libdwelf/dwelf_elf_e_machine_string.c'; else $(CYGPATH_W) '$(srcdir)/../libdwelf/dwelf_elf_e_machine_string.c'; fi` ++ + ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique + tags: tags-am +@@ -881,6 +903,7 @@ + -rm -f ./$(DEPDIR)/arlib-argp.Po + -rm -f ./$(DEPDIR)/arlib.Po + -rm -f ./$(DEPDIR)/arlib2.Po ++ -rm -f ./$(DEPDIR)/dwelf_elf_e_machine_string.Po + -rm -f ./$(DEPDIR)/elfcmp.Po + -rm -f ./$(DEPDIR)/elfcompress.Po + -rm -f ./$(DEPDIR)/elflint.Po +@@ -944,6 +967,7 @@ + -rm -f ./$(DEPDIR)/arlib-argp.Po + -rm -f ./$(DEPDIR)/arlib.Po + -rm -f ./$(DEPDIR)/arlib2.Po ++ -rm -f ./$(DEPDIR)/dwelf_elf_e_machine_string.Po + -rm -f ./$(DEPDIR)/elfcmp.Po + -rm -f ./$(DEPDIR)/elfcompress.Po + -rm -f ./$(DEPDIR)/elflint.Po +diff -ur elfutils-0.176/tests/Makefile.am elfutils-0.176.e_machine/tests/Makefile.am +--- elfutils-0.176/tests/Makefile.am 2019-08-06 18:55:16.684204039 +0200 ++++ elfutils-0.176.e_machine/tests/Makefile.am 2019-08-06 18:46:41.154676407 +0200 +@@ -60,7 +60,8 @@ + 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 elfrdwrnop ++ elfcopy addsections xlate_notes elfrdwrnop \ ++ dwelf_elf_e_machine_string + + asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \ + asm-tst6 asm-tst7 asm-tst8 asm-tst9 +@@ -160,7 +161,8 @@ + 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 ++ run-strip-version.sh run-xlate-note.sh \ ++ run-dwelf_elf_e_machine_string.sh + + if !BIARCH + export ELFUTILS_DISABLE_BIARCH = 1 +@@ -426,7 +428,8 @@ + testfile-debug-rel-ppc64-z.o.bz2 \ + testfile-debug-rel-ppc64.o.bz2 \ + run-strip-version.sh testfile-version.bz2 \ +- run-xlate-note.sh ++ run-xlate-note.sh \ ++ run-dwelf_elf_e_machine_string.sh + + if USE_VALGRIND + valgrind_cmd='valgrind -q --leak-check=full --error-exitcode=1' +@@ -599,6 +602,10 @@ + xlate_notes_LDADD = $(libelf) + elfrdwrnop_LDADD = $(libelf) + ++dwelf_elf_e_machine_string_SOURCES = dwelf_elf_e_machine_string_test.c \ ++ ../libdwelf/dwelf_elf_e_machine_string.c ++dwelf_elf_e_machine_string_LDADD = $(libelf) $(libdw) ++ + # 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. + if !INSTALL_ELFH +diff -ur elfutils-0.176/tests/Makefile.in elfutils-0.176.e_machine/tests/Makefile.in +--- elfutils-0.176/tests/Makefile.in 2019-08-06 18:55:16.689203989 +0200 ++++ elfutils-0.176.e_machine/tests/Makefile.in 2019-08-06 18:47:51.876714894 +0200 +@@ -132,7 +132,8 @@ + attr-integrate-skel$(EXEEXT) all-dwarf-ranges$(EXEEXT) \ + unit-info$(EXEEXT) next_cfi$(EXEEXT) elfcopy$(EXEEXT) \ + addsections$(EXEEXT) xlate_notes$(EXEEXT) elfrdwrnop$(EXEEXT) \ +- $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_4) ++ dwelf_elf_e_machine_string$(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) \ +@@ -213,7 +214,8 @@ + 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) ++ run-dwelf_elf_e_machine_string.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 +@@ -389,6 +391,13 @@ + dwarfcfi_SOURCES = dwarfcfi.c + dwarfcfi_OBJECTS = dwarfcfi.$(OBJEXT) + dwarfcfi_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_2) ++am_dwelf_elf_e_machine_string_OBJECTS = \ ++ dwelf_elf_e_machine_string_test.$(OBJEXT) \ ++ dwelf_elf_e_machine_string.$(OBJEXT) ++dwelf_elf_e_machine_string_OBJECTS = \ ++ $(am_dwelf_elf_e_machine_string_OBJECTS) ++dwelf_elf_e_machine_string_DEPENDENCIES = $(am__DEPENDENCIES_2) \ ++ $(am__DEPENDENCIES_4) + dwelfgnucompressed_SOURCES = dwelfgnucompressed.c + dwelfgnucompressed_OBJECTS = dwelfgnucompressed.$(OBJEXT) + dwelfgnucompressed_DEPENDENCIES = $(am__DEPENDENCIES_2) \ +@@ -653,7 +662,10 @@ + ./$(DEPDIR)/dwarf-getmacros.Po ./$(DEPDIR)/dwarf-getstring.Po \ + ./$(DEPDIR)/dwarf-ranges.Po \ + ./$(DEPDIR)/dwarf_default_lower_bound.Po \ +- ./$(DEPDIR)/dwarfcfi.Po ./$(DEPDIR)/dwelfgnucompressed.Po \ ++ ./$(DEPDIR)/dwarfcfi.Po \ ++ ./$(DEPDIR)/dwelf_elf_e_machine_string.Po \ ++ ./$(DEPDIR)/dwelf_elf_e_machine_string_test.Po \ ++ ./$(DEPDIR)/dwelfgnucompressed.Po \ + ./$(DEPDIR)/dwfl-addr-sect.Po \ + ./$(DEPDIR)/dwfl-bug-addr-overflow.Po \ + ./$(DEPDIR)/dwfl-bug-fd-leak.Po \ +@@ -717,15 +729,15 @@ + backtrace-dwarf.c buildid.c debugaltlink.c debuglink.c \ + deleted.c deleted-lib.c dwarf-die-addr-die.c dwarf-getmacros.c \ + dwarf-getstring.c dwarf-ranges.c dwarf_default_lower_bound.c \ +- dwarfcfi.c dwelfgnucompressed.c dwfl-addr-sect.c \ +- dwfl-bug-addr-overflow.c dwfl-bug-fd-leak.c \ +- 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 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 \ ++ dwarfcfi.c $(dwelf_elf_e_machine_string_SOURCES) \ ++ dwelfgnucompressed.c dwfl-addr-sect.c dwfl-bug-addr-overflow.c \ ++ dwfl-bug-fd-leak.c 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 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 \ +@@ -744,15 +756,15 @@ + backtrace-dwarf.c buildid.c debugaltlink.c debuglink.c \ + deleted.c deleted-lib.c dwarf-die-addr-die.c dwarf-getmacros.c \ + dwarf-getstring.c dwarf-ranges.c dwarf_default_lower_bound.c \ +- dwarfcfi.c dwelfgnucompressed.c dwfl-addr-sect.c \ +- dwfl-bug-addr-overflow.c dwfl-bug-fd-leak.c \ +- 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 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 \ ++ dwarfcfi.c $(dwelf_elf_e_machine_string_SOURCES) \ ++ dwelfgnucompressed.c dwfl-addr-sect.c dwfl-bug-addr-overflow.c \ ++ dwfl-bug-fd-leak.c 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 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 \ +@@ -1416,7 +1428,8 @@ + testfile-debug-rel-ppc64-z.o.bz2 \ + testfile-debug-rel-ppc64.o.bz2 \ + run-strip-version.sh testfile-version.bz2 \ +- run-xlate-note.sh ++ run-xlate-note.sh \ ++ run-dwelf_elf_e_machine_string.sh + + @USE_VALGRIND_TRUE@valgrind_cmd = 'valgrind -q --leak-check=full --error-exitcode=1' + installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir); \ +@@ -1572,6 +1585,10 @@ + addsections_LDADD = $(libelf) + xlate_notes_LDADD = $(libelf) + elfrdwrnop_LDADD = $(libelf) ++dwelf_elf_e_machine_string_SOURCES = dwelf_elf_e_machine_string_test.c \ ++ ../libdwelf/dwelf_elf_e_machine_string.c ++ ++dwelf_elf_e_machine_string_LDADD = $(libelf) $(libdw) + + # 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. +@@ -1760,6 +1777,10 @@ + @rm -f dwarfcfi$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(dwarfcfi_OBJECTS) $(dwarfcfi_LDADD) $(LIBS) + ++dwelf_elf_e_machine_string$(EXEEXT): $(dwelf_elf_e_machine_string_OBJECTS) $(dwelf_elf_e_machine_string_DEPENDENCIES) $(EXTRA_dwelf_elf_e_machine_string_DEPENDENCIES) ++ @rm -f dwelf_elf_e_machine_string$(EXEEXT) ++ $(AM_V_CCLD)$(LINK) $(dwelf_elf_e_machine_string_OBJECTS) $(dwelf_elf_e_machine_string_LDADD) $(LIBS) ++ + dwelfgnucompressed$(EXEEXT): $(dwelfgnucompressed_OBJECTS) $(dwelfgnucompressed_DEPENDENCIES) $(EXTRA_dwelfgnucompressed_DEPENDENCIES) + @rm -f dwelfgnucompressed$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(dwelfgnucompressed_OBJECTS) $(dwelfgnucompressed_LDADD) $(LIBS) +@@ -2079,6 +2100,8 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf-ranges.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_default_lower_bound.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarfcfi.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwelf_elf_e_machine_string.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwelf_elf_e_machine_string_test.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwelfgnucompressed.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl-addr-sect.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwfl-bug-addr-overflow.Po@am__quote@ # am--include-marker +@@ -2211,6 +2234,20 @@ + @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(deleted_lib_so_CFLAGS) $(CFLAGS) -c -o deleted_lib_so-deleted-lib.obj `if test -f 'deleted-lib.c'; then $(CYGPATH_W) 'deleted-lib.c'; else $(CYGPATH_W) '$(srcdir)/deleted-lib.c'; fi` + ++dwelf_elf_e_machine_string.o: ../libdwelf/dwelf_elf_e_machine_string.c ++@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dwelf_elf_e_machine_string.o -MD -MP -MF $(DEPDIR)/dwelf_elf_e_machine_string.Tpo -c -o dwelf_elf_e_machine_string.o `test -f '../libdwelf/dwelf_elf_e_machine_string.c' || echo '$(srcdir)/'`../libdwelf/dwelf_elf_e_machine_string.c ++@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dwelf_elf_e_machine_string.Tpo $(DEPDIR)/dwelf_elf_e_machine_string.Po ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libdwelf/dwelf_elf_e_machine_string.c' object='dwelf_elf_e_machine_string.o' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dwelf_elf_e_machine_string.o `test -f '../libdwelf/dwelf_elf_e_machine_string.c' || echo '$(srcdir)/'`../libdwelf/dwelf_elf_e_machine_string.c ++ ++dwelf_elf_e_machine_string.obj: ../libdwelf/dwelf_elf_e_machine_string.c ++@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dwelf_elf_e_machine_string.obj -MD -MP -MF $(DEPDIR)/dwelf_elf_e_machine_string.Tpo -c -o dwelf_elf_e_machine_string.obj `if test -f '../libdwelf/dwelf_elf_e_machine_string.c'; then $(CYGPATH_W) '../libdwelf/dwelf_elf_e_machine_string.c'; else $(CYGPATH_W) '$(srcdir)/../libdwelf/dwelf_elf_e_machine_string.c'; fi` ++@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dwelf_elf_e_machine_string.Tpo $(DEPDIR)/dwelf_elf_e_machine_string.Po ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libdwelf/dwelf_elf_e_machine_string.c' object='dwelf_elf_e_machine_string.obj' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dwelf_elf_e_machine_string.obj `if test -f '../libdwelf/dwelf_elf_e_machine_string.c'; then $(CYGPATH_W) '../libdwelf/dwelf_elf_e_machine_string.c'; else $(CYGPATH_W) '$(srcdir)/../libdwelf/dwelf_elf_e_machine_string.c'; fi` ++ + system_elf_libelf_test-system-elf-libelf-test.o: system-elf-libelf-test.c + @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(system_elf_libelf_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT system_elf_libelf_test-system-elf-libelf-test.o -MD -MP -MF $(DEPDIR)/system_elf_libelf_test-system-elf-libelf-test.Tpo -c -o system_elf_libelf_test-system-elf-libelf-test.o `test -f 'system-elf-libelf-test.c' || echo '$(srcdir)/'`system-elf-libelf-test.c + @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/system_elf_libelf_test-system-elf-libelf-test.Tpo $(DEPDIR)/system_elf_libelf_test-system-elf-libelf-test.Po +@@ -3776,6 +3813,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-dwelf_elf_e_machine_string.sh.log: run-dwelf_elf_e_machine_string.sh ++ @p='run-dwelf_elf_e_machine_string.sh'; \ ++ b='run-dwelf_elf_e_machine_string.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'; \ +@@ -4005,6 +4049,8 @@ + -rm -f ./$(DEPDIR)/dwarf-ranges.Po + -rm -f ./$(DEPDIR)/dwarf_default_lower_bound.Po + -rm -f ./$(DEPDIR)/dwarfcfi.Po ++ -rm -f ./$(DEPDIR)/dwelf_elf_e_machine_string.Po ++ -rm -f ./$(DEPDIR)/dwelf_elf_e_machine_string_test.Po + -rm -f ./$(DEPDIR)/dwelfgnucompressed.Po + -rm -f ./$(DEPDIR)/dwfl-addr-sect.Po + -rm -f ./$(DEPDIR)/dwfl-bug-addr-overflow.Po +@@ -4156,6 +4202,8 @@ + -rm -f ./$(DEPDIR)/dwarf-ranges.Po + -rm -f ./$(DEPDIR)/dwarf_default_lower_bound.Po + -rm -f ./$(DEPDIR)/dwarfcfi.Po ++ -rm -f ./$(DEPDIR)/dwelf_elf_e_machine_string.Po ++ -rm -f ./$(DEPDIR)/dwelf_elf_e_machine_string_test.Po + -rm -f ./$(DEPDIR)/dwelfgnucompressed.Po + -rm -f ./$(DEPDIR)/dwfl-addr-sect.Po + -rm -f ./$(DEPDIR)/dwfl-bug-addr-overflow.Po diff --git a/SOURCES/elfutils-0.176-elf-update.patch b/SOURCES/elfutils-0.176-elf-update.patch new file mode 100644 index 0000000..501c103 --- /dev/null +++ b/SOURCES/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/SOURCES/elfutils-0.176-strip-symbols-illformed.patch b/SOURCES/elfutils-0.176-strip-symbols-illformed.patch new file mode 100644 index 0000000..a0f22c8 --- /dev/null +++ b/SOURCES/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/SOURCES/elfutils-0.176-xlate-note.patch b/SOURCES/elfutils-0.176-xlate-note.patch new file mode 100644 index 0000000..e3bbf48 --- /dev/null +++ b/SOURCES/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/SPECS/elfutils.spec b/SPECS/elfutils.spec new file mode 100644 index 0000000..da4d329 --- /dev/null +++ b/SPECS/elfutils.spec @@ -0,0 +1,1110 @@ +Name: elfutils +Summary: A collection of utilities and DSOs to handle ELF files and DWARF data +Version: 0.176 +%global baserelease 4 +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 + +%if 0%{?fedora} >= 22 || 0%{?rhel} >= 7 +%global provide_yama_scope 1 +%endif + +%global depsuffix %{?_isa}%{!?_isa:-%{_arch}} + +Source: %{?source_url}%{name}-%{version}.tar.bz2 + +# Patches +Patch1: elfutils-0.176-xlate-note.patch +Patch2: elfutils-0.176-elf-update.patch +Patch3: elfutils-0.176-strip-symbols-illformed.patch +Patch4: elfutils-0.176-dwelf_elf_e_machine_string.patch + +Requires: elfutils-libelf%{depsuffix} = %{version}-%{release} +Requires: 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: libstdc++-devel + +BuildRequires: zlib-devel >= 1.2.2.3 +BuildRequires: bzip2-devel +BuildRequires: xz-devel + +%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: elfutils-libs%{depsuffix} = %{version}-%{release} +%endif +Requires: 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: elfutils-devel%{depsuffix} = %{version}-%{release} +%endif +Requires: elfutils-libs%{depsuffix} = %{version}-%{release} +Requires: elfutils-libelf-devel%{depsuffix} = %{version}-%{release} + +%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 devel-static +Summary: Static archives to handle compiled objects +Group: Development/Tools +License: GPLv2+ or LGPLv3+ +%if 0%{!?_isa:1} +Provides: elfutils-devel-static%{depsuffix} = %{version}-%{release} +%endif +Requires: elfutils-devel%{depsuffix} = %{version}-%{release} +Requires: elfutils-libelf-devel-static%{depsuffix} = %{version}-%{release} + +%description devel-static +The elfutils-devel-static package contains the static archives +with the code to handle compiled objects. + +%package libelf +Summary: Library to read and write ELF files +Group: Development/Tools +License: GPLv2+ or LGPLv3+ +%if 0%{!?_isa:1} +Provides: elfutils-libelf%{depsuffix} = %{version}-%{release} +%endif +Obsoletes: libelf <= 0.8.2-2 + +%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: elfutils-libelf-devel%{depsuffix} = %{version}-%{release} +%endif +Requires: elfutils-libelf%{depsuffix} = %{version}-%{release} +Obsoletes: libelf-devel <= 0.8.2-2 + +%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. + +%package libelf-devel-static +Summary: Static archive of libelf +Group: Development/Tools +License: GPLv2+ or LGPLv3+ +%if 0%{!?_isa:1} +Provides: elfutils-libelf-devel-static%{depsuffix} = %{version}-%{release} +%endif +Requires: elfutils-libelf-devel%{depsuffix} = %{version}-%{release} + +%description libelf-devel-static +The elfutils-libelf-static package contains the static archive +for libelf. + +%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 + +# Apply patches +%patch1 -p1 -b .xlate-note +%patch2 -p1 -b .elf-update +%patch3 -p1 -b .strip-illformed +%patch4 -p1 -b .e_machine + +# 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 +make -s %{?_smp_mflags} + +%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* + +%find_lang %{name} + +%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) + +%clean +rm -rf ${RPM_BUILD_ROOT} + +%post libs -p /sbin/ldconfig + +%postun libs -p /sbin/ldconfig + +%post libelf -p /sbin/ldconfig + +%postun libelf -p /sbin/ldconfig + +%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.a +%{_libdir}/libasm.so +%{_libdir}/libdw.so +%{_libdir}/pkgconfig/libdw.pc + +%files devel-static +%defattr(-,root,root) +%{_libdir}/libasm.a +%{_libdir}/libdw.a + +%files -f %{name}.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}/pkgconfig/libelf.pc + +%files libelf-devel-static +%defattr(-,root,root) +%{_libdir}/libelf.a + +%if %{provide_yama_scope} +%files default-yama-scope +%defattr(-,root,root) +%config(noreplace) %{_sysctldir}/10-default-yama-scope.conf +%endif + +%changelog +* Tue Aug 6 2019 Mark Wielaard - 0.176-4 +- Add elfutils-0.176-dwelf_elf_e_machine_string.patch (#1724350) + +* Tue Aug 6 2019 Mark Wielaard - 0.176-3 +- Add elfutils-0.176-elf-update.patch (#1717351) +- Add elfutils-0.176-strip-symbols-illformed.patch + +* Wed May 1 2019 Mark Wielaard - 0.176-2 +- Add elfutils-0.176-xlate-note.patch (#1704754) + +* Wed Mar 6 2019 Mark Wielaard - 0.176-1 +- New upstream release (#1676504) + CVE-2019-7146, CVE-2019-7148, CVE-2019-7149, CVE-2019-7150, + CVE-2019-7664, CVE-2019-7665, CVE-2018-16062, CVE-2018-16402, + CVE-2018-16403, CVE-2018-18310, CVE-2018-18521, CVE-2018-18520. + +* Wed Jun 20 2018 Mark Wielaard - 0.172-2 +- Add elfutils-0.172-robustify.patch. (#1593328) + +* 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. + +* Tue Jun 05 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 Dec 20 2017 Mark Wielaard - 0.170-4 +- Add elfutils-0.170-dwarf_aggregate_size.patch (#1527966). + +* Wed Nov 8 2017 Mark Wielaard - 0.170-3 +- Rely on systemd_requires for sysctl_apply default-yama-scope (#1509861). + +* Thu Nov 2 2017 Mark Wielaard - 0.170-2 +- Rebuild because of binutils bug (#1508966) + +* Mon Oct 16 2017 Mark Wielaard - 0.170-1 +- New upstream release. Remove upstreamed patches. +- Sync provide_yama_scope with fedora. +- Add elfutils-0.170-x86_64-backtrace-test-override.patch. + +* Tue May 30 2017 Mark Wielaard - 0.168-8 +- Fix ppc64 fallback unwinder (#1454754) + +* Thu May 25 2017 Mark Wielaard - 0.168-7 +- Enable default-yama-scope (#1455514) + +* Mon May 22 2017 Mark Wielaard - 0.168-6 +- Add ppc64 fallback unwinder (#1454754) + +* Wed Mar 1 2017 Mark Wielaard - 0.168-5 +- Rebase to fedora elfutils 0.168 (#1371517, #1400302) + +* Thu Apr 14 2016 Mark Wielaard - 0.166-2 +- Rebase to fedora elfutils 0.166 (#1296313, #1304873) + +* Mon Sep 14 2015 Mark Wielaard - 0.163-3 +- Add elfutils-0.163-readelf-n-undefined-shift.patch (#1262839) + +* Tue Aug 11 2015 Mark Wielaard - 0.163-2 +- Add elfutils-0.163-elflint-bad-nobits.patch (#1251698) + +* Fri Jun 19 2015 Mark Wielaard - 0.163-1 +- Update to 0.163 + +* Thu Jun 11 2015 Mark Wielaard - 0.162-1 +- Update to 0.162 (#1224169, #1223462, #1207799) +- Include elfutils/known-dwarf.h +- Drop BuildRequires glibc-headers + +* Wed Aug 27 2014 Mark Wielaard - 0.160-1 +- Update to 0.160. + +* Tue Mar 11 2014 Mark Wielaard - 0.158-3 +- Add elfutils-0.158-mod-e_type.patch. + +* Fri Jan 24 2014 Daniel Mach - 0.158-2 +- Mass rebuild 2014-01-24 + +* Tue Jan 7 2014 Petr Machata - 0.158-1 +- Update to 0.158. Add eu-stack. + +* Fri Dec 27 2013 Daniel Mach - 0.157-3 +- Mass rebuild 2013-12-27 + +* 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.