# # spec file for package patchelf # # Copyright (c) 2024 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: patchelf Version: 0.18.0 Release: 3.3 Summary: A utility for patching ELF binaries License: GPL-3.0-only Group: Development/Libraries/C and C++ URL: https://nixos.org/patchelf.html Source: https://github.com/NixOS/patchelf/releases/download/%{version}/patchelf-%{version}.tar.bz2 Patch1: fix-rename-dynamic-symbols.sh-test-issue-503.patch %if 0%{?suse_version} < 1550 && 0%{?sle_version} <= 150600 BuildRequires: gcc13 BuildRequires: gcc13-c++ %else BuildRequires: gcc-c++ %endif %description PatchELF is a simple utility for modifing existing ELF executables and libraries. It can change the dynamic loader ("ELF interpreter") of executables and change the RPATH of executables and libraries. %prep %autosetup -p1 %build %if 0%{?suse_version} < 1550 && 0%{?sle_version} <= 150600 export CC=gcc-13 export CXX=g++-13 %endif %configure %make_build %check %ifnarch s390x #Bug bsc#1211860, builds are unstable for s390x %make_build check %endif %install %make_install rm -v %{buildroot}%{_datadir}/doc/patchelf/README.md %files %doc README.md %license COPYING %{_bindir}/patchelf %{_mandir}/man1/patchelf.1%{?ext_man} %dir %{_datadir}/zsh %dir %{_datadir}/zsh/site-functions %{_datadir}/zsh/site-functions/_patchelf %changelog * Fri Mar 8 2024 Martin Jambor - Make the package buildable also on Leap 15.6 and SLE 15 SP 6. * Conditionally compile with gcc 13. * fix-rename-dynamic-symbols.sh-test-issue-503.patch new patch to fix upstream (github) issue 503, not using the correct flags to build a binary as a part of the rename-dynamic-symbols.sh test. * Mon Dec 4 2023 Duraisankar P - [bsc#1211860] - build failure for patchelf on s390x - skip unstable check build for arch s390x * Mon May 8 2023 Andreas Stieger - update to 0.18.0 * Add options to print, clear and set executable stack state * Modernizations and strictness improvements * Add feature to rename dynamic symbols * Adjust roundUp for 0 as input * Avoid overlapping program header table with section header table * Other switches might set changed as true. Use extraStrings size * Use the largest segment alignment for libraries requiring non- standard alignments * Add one extra page to avoid overlapping with next page if its rounded… * Add zsh completion * Do not let modifyRPath taint shared strings in strtab * Resize segment mapping rewritten sections if needed * Sat Jan 21 2023 Dirk Müller - update to 0.17.2: * Also pass STRIP to the tests * Fix Out-of-bounds read in the function modifySoname * Split segment size fix * Fri Dec 2 2022 Dirk Müller - update to 0.17.0: * fix pagesize on ia64 * write out replace sections in original order * patchelf: correct page size for sparc64/sparc32 * update vendored elf file * add workaround for readelf from binutils 2.30 * make objdump/objcopy/readelf configurable and respect cross-compiling * build patchelf on windows * Sat Oct 29 2022 Dirk Müller - update to 0.16.1: * Handle glibc-hwcaps on ppc64le on CentOS/RHEL/Rocky 8 for tests/replace-add-needed.sh (fixes #406) * Add --print-os-abi and --set-os-abi options * Fix Out-of-bounds read in the function modifyRPath * Sync .note.gnu.property to PT_GNU_PROPERTY * Fix out of bounds access when increasing program header table * Rework file shifting to avoid sections crossing multiple segments * Fri Jul 22 2022 Dirk Müller - update to 0.15.0: * Add --add-debug option * Add O_BINARY flag when opening files to allow compilation for Windows * Document --print-needed * modifyRPath: return early if new and old rpath are empty * Add comment explaining calculation for DT_MIPS_RLD_MAP_REL * Add --no-sort option * Handle DT_MIPS_XHASH and .MIPS.xhash * Sun Mar 20 2022 Dirk Müller - update to 0.14.5: * fix faulty version in 0.14.4 * Several test fixes to fix patchelf test suite on openbsd * Allow multiple modifications in same call * Add support to build with musl * Fix typo: s/folllow/follow/ * mips: fix incorrect polarity on dyn_offset * Wed Dec 15 2021 Dirk Müller - update to 0.14.3: * this release adds support for static, pre-compiled patchelf binaries * make version number in tarball easier to use for packagers * build fix: add missing include * Bug fixes: - Fix corrupted library names when using --replace-needed multiple times - Fix setting an empty rpath - Don't try to parse .dynamic section of type NOBITS - Fix use-after-free in normalizeNoteSegments - Correct EINTR handling in writeFile - MIPS: Adjust PT_MIPS_ABIFLAGS segment and DT_MIPS_RLD_MAP_REL dynamic section if present - Fix binaries without .gnu.hash section * Support loongarch architecture * Remove limits on output file size for elf files * Allow reading rpath from file * Requires now C++17 for building * Sat Oct 16 2021 Dirk Müller - update to 0.13: * mark phdrs synced with sections, avoid rechecking it when syncing not * fix roundUp() to not truncate 64 bit values * Use sh_offset instead of sh_addr when checking already replaced libs * Add ELF test case with invalid string table index * Gracefully handle ELF files with invalid string table indices in header * clang-tidy fixes * avoid needless memory allocation when replacing sections * silence compiler warning because of different signedness * avoid needless copies of std::string * patchelf: Fix alignment issues with contiguous note sections * Fri Sep 11 2020 Dirk Mueller - update to 0.12: * skip overwriting r(un)path data when old_rpath = new_rpath. * patchelf: Check ELF endianness before writing new runpath * use stable_sort to maintain relative order for equal elemnts * add --clear-symbol-version * Improve the default section alignment choice * Some const-correctness and C++11 auto * Sun Aug 16 2020 Dirk Mueller - update to 0.11: * More modern C++ has avoided a memory leak * force-rpath is now consistently used * new --output flag * Tue Aug 27 2019 Martin Pluskal - Changelog and packaging cleanups - Fix download url * Mon Aug 26 2019 Mikhail Terekhov - Update to version 0.10 * remove no-rpath-prebuilt.patch - applied upstream * Lots of bug fixes see https://github.com/NixOS/patchelf/commits/master * Thu Nov 15 2018 Martin Pluskal - Modernise spec file - Install license file * Fri Apr 1 2016 dvaleev@suse.com - Enable exluded architectures. Fixed by debian patch no-rpath-prebuilt.patch * Sun Mar 20 2016 mpluskal@suse.com - Update to version 0.9 * Lots of new features - Add aarch64 to list of excluded architectures * Thu Aug 13 2015 normand@linux.vnet.ibm.com - exclude ppc64le as already done for ppc/ppc64 (4 tests FAIL) set-interpreter-long.sh set-rpath.sh big-dynstr.sh set-rpath-library.sh Same exclude on fedora as per bug 627370 https://bugzilla.redhat.com/show_bug.cgi?id=627370 * Sat Aug 2 2014 idonmez@suse.com - Update to version 0.8 * No changelog upstream * Tue Jul 3 2012 dvaleev@suse.com - exclude ppc and ppc64. Tests are failed * Thu Jun 21 2012 adrian@suse.de - initial packaging of patchelf version 0.6 required for accelerated cross build package