# # spec file for package elfutils # # Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: elfutils Version: 0.158 Release: 0 Summary: Higher-level library to access ELF License: SUSE-GPL-2.0-with-OSI-exception Group: System/Libraries URL: http://elfutils.fedorahosted.org Source: https://fedorahosted.org/releases/e/l/%{name}/%{version}/%{name}-%{version}.tar.bz2 Source1: README-BEFORE-ADDING-PATCHES Source2: baselibs.conf Source3: %{name}.changes Patch1: https://fedorahosted.org/releases/e/l/%{name}/%{version}/elfutils-portability.patch Patch2: https://fedorahosted.org/releases/e/l/%{name}/%{version}/elfutils-robustify.patch Patch3: elfutils-no-po-test-build.diff Patch4: libebl-prototype-fix.diff Patch5: elfutils-uninitialized.diff Patch6: elfutils-0.137-dwarf-header-check-fix.diff Patch7: elfutils-0.148-dont-crash.diff Patch8: elfutils-revert-portability-scanf.patch Patch9: elfutils-check-for-overflow-before-calling-malloc-to-uncompress-data.patch Patch10: elfutils-fix-dir-traversal-vuln-in-ar-extraction.patch Patch11: elflint-sanity-check-the-number-of-phdrs-and-shdrs.patch Patch12: elfutils-dont-trust-sh_entsize.patch Patch13: elfutils-prevent-incorrect-memory-read.patch Patch14: readelf-fix-off-by-one-sanity-check.patch Patch15: use-the-empty-string-for-note-names-with-zero-size.patch Patch16: elflint-dont-check-section-group-without-flags-word.patch Patch17: elflint-check-symbol-table-data-is-big-enough-before-check.patch Patch18: libdwfl-sanity-check-partial-core-file-data-reads.patch Patch19: arlib-check-that-sh_entsize-isnt-zero.patch Patch20: size-handle-recursive-elf-ar-files.patch Patch21: libdwfl-sanity-check-partial-core-file-dyn-data-read.patch Patch22: libebl-check-NT_PLATFORM-core-notes.patch Patch23: libelf-sanity-check-offset-and-size.patch Patch24: libelf-always-set-elf-maxsize-when-reading.patch Patch25: libdw-readelf-make-sure-there-is-enough-data-to-read.patch Patch26: libdw-check-end-of-attributes-list-consistently.patch Patch27: fix-bsc-1110929.diff Patch28: elfutils-nm-Fix-nm-external-sysv-format-output.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: bison BuildRequires: flex BuildRequires: libbz2-devel BuildRequires: xz-devel BuildRequires: zlib-devel %description This package provides a higher-level library to access ELF files. This is a part of elfutils package. %package -n libasm1 Summary: A collection of utilities and DSOs to handle compiled objects Group: Development/Tools/Other %description -n libasm1 Elfutils is a collection of utilities, including ld (a linker), nm (for listing symbols from object files), size (for listing the section sizes of an object or archive file), strip (for discarding symbols), readline (the see the raw ELF file structures), and elflint (to check for well-formed ELF files). Also included are numerous helper libraries which implement DWARF, ELF, and machine-specific ELF handling. %package -n libasm-devel Summary: A collection of utilities and DSOs to handle compiled objects Group: Development/Tools/Other Requires: glibc-devel Requires: libasm1 = %{version} %description -n libasm-devel Elfutils is a collection of utilities, including ld (a linker), nm (for listing symbols from object files), size (for listing the section sizes of an object or archive file), strip (for discarding symbols), readline (the see the raw ELF file structures), and elflint (to check for well-formed ELF files). Also included are numerous helper libraries which implement DWARF, ELF, and machine-specific ELF handling. %package -n libebl1 Summary: A collection of utilities and DSOs to handle compiled objects Group: Development/Tools/Other Provides: libebl = %{version} Obsoletes: libebl < %{version} %description -n libebl1 Elfutils is a collection of utilities, including ld (a linker), nm (for listing symbols from object files), size (for listing the section sizes of an object or archive file), strip (for discarding symbols), readline (the see the raw ELF file structures), and elflint (to check for well-formed ELF files). Also included are numerous helper libraries which implement DWARF, ELF, and machine-specific ELF handling. %package -n libebl-devel Summary: Include Files and Libraries mandatory for Development Group: Development/Libraries/C and C++ Requires: glibc-devel Requires: libdw-devel = %{version} Requires: libebl1 = %{version} %description -n libebl-devel This package contains all necessary include files and libraries needed to develop applications that require these. %package -n libelf1 Summary: Library to read and write ELF files Group: System/Libraries Requires: libebl1 = %{version} %description -n libelf1 This package provides a high-level library to read and write ELF files. This is a part of elfutils package. %package -n libelf-devel Summary: Include Files and Libraries mandatory for Development Group: Development/Libraries/C and C++ Requires: glibc-devel Requires: libelf1 = %{version} Conflicts: libelf0-devel %description -n libelf-devel This package contains all necessary include files and libraries needed to develop applications that require these. %package -n libdw1 Summary: Library to access DWARF debugging information Group: System/Libraries %description -n libdw1 This package provides a high-level library to access the DWARF debugging information. This is a part of elfutils package. %package -n libdw-devel Summary: Include Files and Libraries mandatory for Development Group: Development/Libraries/C and C++ Requires: glibc-devel Requires: libdw1 = %{version} Requires: libelf-devel = %{version} %description -n libdw-devel This package contains all necessary include files and libraries needed to develop applications that require these. %prep %setup -q -n elfutils-%{version} %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 %patch8 -p1 -R %patch9 -p1 %patch10 -p1 %patch11 -p1 %patch12 -p1 %patch13 -p1 %patch14 -p1 %patch15 -p1 %patch16 -p1 %patch17 -p1 %patch18 -p1 %patch19 -p1 %patch20 -p1 %patch21 -p1 %patch22 -p1 %patch23 -p1 %patch24 -p1 %patch25 -p1 %patch26 -p1 %patch27 -p1 %patch28 -p1 %build # Change DATE/TIME macros to use last change time of elfutils.changes # See http://lists.opensuse.org/opensuse-factory/2011-05/msg00304.html modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")" DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\"" TIME="\"$(date -d "${modified}" "+%%R")\"" find . -type f -regex ".*\.c\|.*\.cpp\|.*\.h" -exec sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" {} + %ifarch %sparc # Small PIC model not sufficient export CFLAGS="%optflags -fPIC" %endif %configure --program-prefix=eu- make %{?_smp_mflags} %install make DESTDIR=$RPM_BUILD_ROOT install # remove unneeded files rm -f $RPM_BUILD_ROOT%{_libdir}/*.la ls -lR $RPM_BUILD_ROOT%{_libdir}/libelf* %post -n libebl1 -p /sbin/ldconfig %post -n libelf1 -p /sbin/ldconfig %post -n libdw1 -p /sbin/ldconfig %postun -n libebl1 -p /sbin/ldconfig %postun -n libelf1 -p /sbin/ldconfig %postun -n libdw1 -p /sbin/ldconfig %files %defattr(-,root,root) %doc AUTHORS ChangeLog COPYING NEWS NOTES README THANKS TODO %{_bindir}/* %files -n libasm1 %defattr(-,root,root) %{_libdir}/libasm.so.* %{_libdir}/libasm-%{version}.so %files -n libasm-devel %defattr(-,root,root) %{_libdir}/libasm.so %{_libdir}/libasm.a %dir %{_includedir}/elfutils %{_includedir}/elfutils/libasm.h %files -n libebl1 %defattr(-,root,root) %{_libdir}/elfutils %files -n libebl-devel %defattr(-,root,root) %{_libdir}/libebl.a %dir %{_includedir}/elfutils %{_includedir}/elfutils/libebl.h %files -n libelf1 %defattr(-,root,root) %{_libdir}/libelf.so.* %{_libdir}/libelf-%{version}.so %files -n libelf-devel %defattr(-,root,root) %{_libdir}/libelf.so %{_libdir}/libelf.a %{_includedir}/libelf.h %{_includedir}/gelf.h %{_includedir}/nlist.h %dir %{_includedir}/elfutils %{_includedir}/elfutils/elf-knowledge.h %{_includedir}/elfutils/version.h %files -n libdw1 %defattr(-,root,root) %{_libdir}/libdw.so.* %{_libdir}/libdw-%{version}.so %files -n libdw-devel %defattr(-,root,root) %{_libdir}/libdw.a %{_libdir}/libdw.so %{_includedir}/dwarf.h %dir %{_includedir}/elfutils %{_includedir}/elfutils/libdw.h %{_includedir}/elfutils/libdwfl.h %changelog