summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--patchelf.spec.in12
-rw-r--r--release.nix8
-rw-r--r--src/patchelf.cc19
3 files changed, 22 insertions, 17 deletions
diff --git a/patchelf.spec.in b/patchelf.spec.in
index f9cd198..a361554 100644
--- a/patchelf.spec.in
+++ b/patchelf.spec.in
@@ -6,8 +6,8 @@ Release: 1
License: GPL
Group: Development/Tools
URL: http://nixos.org/patchelf.html
-Source0: %{name}-@PACKAGE_VERSION@.tar.bz2
-BuildRoot: %{_tmppath}/%{name}-%{PACKAGE_VERSION}-buildroot
+Source0: %{name}-%{version}.tar.bz2
+BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Prefix: /usr
%description
@@ -27,12 +27,12 @@ make check
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
-strip $RPM_BUILD_ROOT/%{_prefix}/bin/* || true
+# rpmbuild automatically strips... strip $RPM_BUILD_ROOT/%%{_bindir}/* || true
%clean
rm -rf $RPM_BUILD_ROOT
%files
-/usr/bin/patchelf
-/usr/share/doc/patchelf/README
-/usr/share/man/man1/patchelf.1.gz
+%{_bindir}/patchelf
+%doc %{_docdir}/patchelf/README
+%{_mandir}/man1/patchelf.1.gz
diff --git a/release.nix b/release.nix
index ef15ee4..6ea6d33 100644
--- a/release.nix
+++ b/release.nix
@@ -63,6 +63,10 @@ let
rpm_fedora19x86_64 = makeRPM_x86_64 (diskImages: diskImages.fedora19x86_64);
rpm_fedora20i386 = makeRPM_i686 (diskImages: diskImages.fedora20i386);
rpm_fedora20x86_64 = makeRPM_x86_64 (diskImages: diskImages.fedora20x86_64);
+ rpm_fedora21i386 = makeRPM_i686 (diskImages: diskImages.fedora21i386);
+ rpm_fedora21x86_64 = makeRPM_x86_64 (diskImages: diskImages.fedora21x86_64);
+ rpm_fedora23i386 = makeRPM_i686 (diskImages: diskImages.fedora23i386);
+ rpm_fedora23x86_64 = makeRPM_x86_64 (diskImages: diskImages.fedora23x86_64);
rpm_opensuse103i386 = makeRPM_i686 (diskImages: diskImages.opensuse103i386);
#rpm_opensuse110i386 = makeRPM_i686 (diskImages: diskImages.opensuse110i386);
@@ -106,6 +110,10 @@ let
deb_ubuntu1404x86_64 = makeDeb_x86_64 (diskImages: diskImages.ubuntu1404x86_64);
deb_ubuntu1410i386 = makeDeb_i686 (diskImages: diskImages.ubuntu1410i386);
deb_ubuntu1410x86_64 = makeDeb_x86_64 (diskImages: diskImages.ubuntu1410x86_64);
+ deb_ubuntu1504i386 = makeDeb_i686 (diskImages: diskImages.ubuntu1504i386);
+ deb_ubuntu1504x86_64 = makeDeb_x86_64 (diskImages: diskImages.ubuntu1504x86_64);
+ deb_ubuntu1510i386 = makeDeb_i686 (diskImages: diskImages.ubuntu1510i386);
+ deb_ubuntu1510x86_64 = makeDeb_x86_64 (diskImages: diskImages.ubuntu1510x86_64);
release = pkgs.releaseTools.aggregate
diff --git a/src/patchelf.cc b/src/patchelf.cc
index 49135ee..37ea09d 100644
--- a/src/patchelf.cc
+++ b/src/patchelf.cc
@@ -236,12 +236,11 @@ static void growFile(off_t newSize)
}
-static void readFile(string fileName, mode_t * fileMode)
+static void readFile(string fileName)
{
struct stat st;
if (stat(fileName.c_str(), &st) != 0) error("stat");
fileSize = st.st_size;
- *fileMode = st.st_mode;
maxSize = fileSize + 32 * 1024 * 1024;
contents = (unsigned char *) malloc(fileSize + maxSize);
@@ -627,7 +626,7 @@ void ElfFile<ElfFileParamNames>::rewriteSectionsLibrary()
/* Write out the replaced sections. */
Elf_Off curOff = startOffset + phdrs.size() * sizeof(Elf_Phdr);
writeReplacedSections(curOff, startPage, startOffset);
- assert((off_t) curOff == startOffset + neededSpace);
+ assert(curOff == startOffset + neededSpace);
/* Move the program header to the start of the new area. */
@@ -696,7 +695,7 @@ void ElfFile<ElfFileParamNames>::rewriteSectionsExecutable()
Elf_Addr firstPage = startAddr - startOffset;
debug("first page is 0x%llx\n", (unsigned long long) firstPage);
- if ((off_t) rdi(hdr->e_shoff) < startOffset) {
+ if (rdi(hdr->e_shoff) < startOffset) {
/* The section headers occur too early in the file and would be
overwritten by the replaced sections. Move them to the end of the file
before proceeding. */
@@ -752,7 +751,7 @@ void ElfFile<ElfFileParamNames>::rewriteSectionsExecutable()
/* Write out the replaced sections. */
writeReplacedSections(curOff, firstPage, 0);
- assert((off_t) curOff == neededSpace);
+ assert(curOff == neededSpace);
rewriteHeaders(firstPage + rdi(hdr->e_phoff));
@@ -1379,7 +1378,7 @@ static set<string> neededLibsToAdd;
static bool noDefaultLib = false;
template<class ElfFile>
-static void patchElf2(ElfFile & elfFile, mode_t fileMode)
+static void patchElf2(ElfFile & elfFile)
{
elfFile.parse();
@@ -1426,9 +1425,7 @@ static void patchElf()
debug("Kernel page size is %u bytes\n", getPageSize());
- mode_t fileMode;
-
- readFile(fileName, &fileMode);
+ readFile(fileName);
/* Check the ELF header for basic validity. */
@@ -1441,13 +1438,13 @@ static void patchElf()
contents[EI_VERSION] == EV_CURRENT)
{
ElfFile<Elf32_Ehdr, Elf32_Phdr, Elf32_Shdr, Elf32_Addr, Elf32_Off, Elf32_Dyn, Elf32_Sym> elfFile;
- patchElf2(elfFile, fileMode);
+ patchElf2(elfFile);
}
else if (contents[EI_CLASS] == ELFCLASS64 &&
contents[EI_VERSION] == EV_CURRENT)
{
ElfFile<Elf64_Ehdr, Elf64_Phdr, Elf64_Shdr, Elf64_Addr, Elf64_Off, Elf64_Dyn, Elf64_Sym> elfFile;
- patchElf2(elfFile, fileMode);
+ patchElf2(elfFile);
}
else {
error("ELF executable is not 32/64-bit, little/big-endian, version 1");