| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Fix issue #66: ignore 0th section header when sorting, don't overwrite NOBITS
|
|/
|
|
| |
overwriting NOBITS entries.
|
|\
| |
| | |
fix reading and writing big files (e.g. > 2Gb)
|
|/ |
|
|\
| |
| | |
Allow multiple filenames to patch
|
| |
| |
| |
| |
| |
| |
| | |
This makes behaviour less confusing when multiple filenames are
passed — previously, any extra filenames would be ignored completely,
as would any options passed after a filename. Now these are taken
into account.
|
| | |
|
|\ \ |
|
| | | |
|
| | |
| | |
| | |
| | | |
weak ordering as required by std::sort.
|
|\ \ \
| | | |
| | | | |
Better error messages when run on statically-linked (or otherwise weird) binaries
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Currently, patchelf outputs this when run on a UPX-compressed ELF file:
patchelf: patchelf.cc:420: ElfFile<Elf_Ehdr, Elf_Phdr, Elf_Shdr, Elf_Addr, Elf_Off, Elf_Dyn, Elf_Sym, Elf_Verneed>::ElfFile(FileContents): Assertion `shstrtabIndex < shdrs.size()' failed.
Make it give a nicer error message:
patchelf: no section headers. The input file is probably a statically linked, self-decompressing binary
Fixes #63
|
| | | |
| | | |
| | | |
| | | |
| | | | |
If .dynamic, .dynstr or .interp sections aren't found, give an extra hint
to the user that the input file is statically linked.
|
|\ \ \ \
| | | | |
| | | | | |
configure.ac: use "command -v" instead of "type -p"
|
| | |/ /
| |/| |
| | | |
| | | |
| | | | |
"type -p" is a Bash thing, whereas "command -v" is specified by POSIX
(more portable).
|
|\ \ \ \
| | | | |
| | | | | |
Mention --set-soname in README
|
| |/ / /
| | | |
| | | | |
Changing shared library SONAME is not a usual task and patchelf may be the only utility that can do it. As README does not mention this feature at all, one can easily miss it when searching for a suitable tool.
|
|\ \ \ \
| |/ / /
|/| | | |
Add CentOS 7.4 to release RPM builds
|
|/ / /
| | |
| | |
| | |
| | | |
This provides RPMs for CentOS 7.4 users, and their counterparts on the
enterprise release RHEL 7.4.
|
|\ \ \
| |_|/
|/| | |
added compillation steps on README
|
|/ /
| |
| | |
It is lacking info on how to run the tests
|
| |
| |
| |
| | |
Reported by Jannis Harder.
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The current approach to changing sections in ET_DYN executables is to move
the INTERP section to the end of the file. +This means changing PT_PHDR to
add an extra PT_LOAD section so that the new section is mmaped into memory
by the elf loader in the kernel. In order to extend PHDR, this means moving
it to the end of the file.
Its documented in BUGS there is a kernel 'bug' which means that if you have holes
in memory between the base load address and the PT_LOAD segment that contains PHDR,
it will pass an incorrect PHDR address to ld.so and fail to load the binary, segfaulting.
To avoid this, the code currently inserts space into the binary to ensure that when
loaded into memory there are no holes between the PT_LOAD sections. This inflates the
binaries by many MBs in some cases. Whilst we could make them sparse, there is a second
issue which is that strip can fail to process these binaries:
$ strip fixincl
Not enough room for program headers, try linking with -N
[.note.ABI-tag]: Bad value
This turns out to be due to libbfd not liking the relocated PHDR section either
(https://github.com/NixOS/patchelf/issues/10).
Instead this patch implements a different approach, leaving PHDR where it is but extending
it in place to allow addition of a new PT_LOAD section. This overwrites sections in the
binary but those get moved to the end of the file in the new PT_LOAD section.
This is based on patches linked from the above github issue, however whilst the idea
was good, the implementation wasn't correct and they've been rewritten here.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
| |
| |
| |
| | |
http://hydra.nixos.org/build/49825195
|
|\ \
| | |
| | | |
Fix typos
|
|/ / |
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
|
|
| |
We don't really care whether DT_STRTAB is correct, since we overwrite
it anyway.
https://github.com/NixOS/nixpkgs/issues/22333
|
| |
|
| |
|
| |
|
|
|
|
| |
Fixes #93.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Add '--allowed-rpath-prefixes' option to '--shrink-rpath' …
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes #97. In essence, the problem is that some packages in Nixpkgs have
RPATHs pointing to both $NIX_BUILD_TOP and $out, e.g.:
/tmp/nix-build-openldap-2.4.44.drv-0/openldap-2.4.44/libraries/libldap_r/.libs
/tmp/nix-build-openldap-2.4.44.drv-0/openldap-2.4.44/libraries/liblber/.libs
/nix/store/bfkmdxmv3a3f0g3d2q8jkdz2wam93c5z-openldap-2.4.44/lib
/nix/store/bfkmdxmv3a3f0g3d2q8jkdz2wam93c5z-openldap-2.4.44/lib64
Currently, running `patchelf --shrink-rpath` does the wrong thing by
keeping the /tmp/ paths and deleting the /nix/store ones. Now we can fix
the problem by using
patchelf --shrink-rpath --allowed-rpath-prefixes $NIX_STORE_DIR
in the Nixpkgs fixupPhase instead.
|