diff --git a/0001-Fix-loongarch64-byte-alignment-to-4K.patch b/0001-Fix-loongarch64-byte-alignment-to-4K.patch new file mode 100644 index 0000000000000000000000000000000000000000..d810606194a86fea9eae29a23949d99e8b3c1906 --- /dev/null +++ b/0001-Fix-loongarch64-byte-alignment-to-4K.patch @@ -0,0 +1,27 @@ +From 47b27a486eea3fba76b8a88dc14a9488fc5f0ca4 Mon Sep 17 00:00:00 2001 +From: doupengda +Date: Mon, 3 Jul 2023 08:23:05 +0000 +Subject: [PATCH] Fix loongarch64 byte alignment to 4K + +--- + src/patchelf.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/patchelf.cc b/src/patchelf.cc +index 4e771bd..c5d5461 100644 +--- a/src/patchelf.cc ++++ b/src/patchelf.cc +@@ -324,8 +324,9 @@ unsigned int ElfFile::getPageSize() const + case EM_PPC64: + case EM_AARCH64: + case EM_TILEGX: +- case EM_LOONGARCH: + return 0x10000; ++ case EM_LOONGARCH: ++ return 0x4000; + default: + return 0x1000; + } +-- +2.33.0 + diff --git a/patchelf.spec b/patchelf.spec index ed7b5d2ce86fc6ab80b0843aa51b68bdcdd19b85..a364d1583b2e7d8e535a76ded21518a52b4a6cd3 100644 --- a/patchelf.spec +++ b/patchelf.spec @@ -1,11 +1,12 @@ Name: patchelf Version: 0.16.0 -Release: 1 +Release: 2 Summary: A utility for patching ELF binaries License: GPL-3.0 URL: http://nixos.org/patchelf.html Source0: https://github.com/NixOS/%{name}/archive/%{version}/%{name}-%{version}.tar.gz +Patch100: 0001-Fix-loongarch64-byte-alignment-to-4K.patch BuildRequires: gcc gcc-c++ make autoconf automake coreutils libacl-devel libattr-devel @@ -16,7 +17,7 @@ of an executable and change the RPATH of an executable or library. %prep -%autosetup +%autosetup -n %{name}-%{version} -p1 # package ships elf.h - delete to use glibc-headers one %{__rm} -f src/elf.h @@ -45,6 +46,9 @@ rm -rf %{buildroot}/usr/share/doc/%{name} %changelog +* Mon Jul 3 2023 doupengda - 0.16.0-2 +- Modify loongarch64 byte alignment to 4K + * Fri Dec 30 2022 liyuxiang - 0.16.0-1 - update to 0.16.0 to fix CVE-2022-44940