| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a testcase for the following reported alignment issue with contiguous note
sections (#275):
"""
If a binary has multiple SHT_NOTE sections and corresponding PT_NOTE
headers, we can see the error:
patchelf: cannot normalize PT_NOTE segment: non-contiguous SHT_NOTE sections
if the SHT_NOTE sections aren't sized to end on aligned boundaries. An example
would be a binary with:
[ 2] .note.ABI-tag NOTE 00000000000002f4 000002f4
0000000000000020 0000000000000000 A 0 0 4
[ 3] .note.gnu.propert NOTE 0000000000000318 00000318
0000000000000030 0000000000000000 A 0 0 8
[ 4] .note.gnu.build-i NOTE 0000000000000348 00000348
0000000000000024 0000000000000000 A 0 0 4
NOTE 0x0000000000000318 0x0000000000000318 0x0000000000000318
0x0000000000000030 0x0000000000000030 R 0x8
NOTE 0x00000000000002f4 0x00000000000002f4 0x00000000000002f4
0x0000000000000078 0x0000000000000074 R 0x4
since the PT_NOTE section at 2f4 covers [2] and [3] but the code
calclates curr_off should be 314, not the 318 in the binary. This
is an alignment issue.
"""
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
|
|
|
|
| |
This reverts commit fccd901efef720d1d843b5c2071158903f92863c.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a testcase for the following reported alignment issue with contiguous note
sections (#275):
"""
If a binary has multiple SHT_NOTE sections and corresponding PT_NOTE
headers, we can see the error:
patchelf: cannot normalize PT_NOTE segment: non-contiguous SHT_NOTE sections
if the SHT_NOTE sections aren't sized to end on aligned boundaries. An example
would be a binary with:
[ 2] .note.ABI-tag NOTE 00000000000002f4 000002f4
0000000000000020 0000000000000000 A 0 0 4
[ 3] .note.gnu.propert NOTE 0000000000000318 00000318
0000000000000030 0000000000000000 A 0 0 8
[ 4] .note.gnu.build-i NOTE 0000000000000348 00000348
0000000000000024 0000000000000000 A 0 0 4
NOTE 0x0000000000000318 0x0000000000000318 0x0000000000000318
0x0000000000000030 0x0000000000000030 R 0x8
NOTE 0x00000000000002f4 0x00000000000002f4 0x00000000000002f4
0x0000000000000078 0x0000000000000074 R 0x4
since the PT_NOTE section at 2f4 covers [2] and [3] but the code
calclates curr_off should be 314, not the 318 in the binary. This
is an alignment issue.
"""
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently patchelf uses the host system's page size (determined at build
time) as the default section load memory alignment. This causes multiple
issues
- Cross-compilation: when using patchelf on ELFs targetting a different
architecture from the host, the host page size is still used by
default.
- Variable page size architectures: ARMv8 systems can be configured in
either 4K, 16K, or 64K page size mode depending on kernel
configuration. An ARMv8 patchelf built on a 4K page size system will
end up creating ELFs that cannot be used on a 64K page size system.
- Reproducibility: the page size of the machine that built patchelf
"leaks" into the binary.
The build time --with-page-size as well as the run time --page-size
options can be used to work around some of these issues. But it's much
better to have patchelf do the right thing without explicit
configuration.
This commit adds support for inferring page size from the ELF header's
"machine" field. The default values are extracted from GNU gold's source
code. Note that both --with-page-size as well as --page-size continue to
work and take precedence on the default value.
|
|\
| |
| | |
Fixed parallel execution of tests (parallel-tests in automake)
|
| | |
|
| | |
|
| |
| |
| |
| | |
(cherry picked from commit 288eb61a173ce6f4cdf0be0d744c9c6b6b5598a4)
|
|/
|
|
|
| |
"type -p" is a Bash thing, whereas "command -v" is specified by POSIX
(more portable).
|
|
|
| |
It would be nice to fix them in parallel but I lack the time.
|
|
|
|
|
| |
Don't use "which" (which might not exist), and don't redirect getconf
auto to /dev/null.
|
| |
|
| |
|
|\
| |
| |
| |
| | |
Conflicts:
configure.ac
|
| | |
|
| |
| |
| |
| | |
#53 related to prtability on powerpc64 architecture
|
|/
|
|
|
|
|
|
|
|
|
|
| |
This change is from the OpenWrt project, from the URL:
https://dev.openwrt.org/ticket/18998
It enables patchelf to sucessfully compile and run under Mac OS and
keeps compatibility with Linux.
Tested under Mac OS X 10.9.5 and Ubuntu 15.04 to patch a binary of type
ELF 32-bit LSB executable - the patch fully worked
This patch is credited to Felix Fietkau
|
| |
|
|
|
|
| |
It's confusing.
|
|
|
|
|
|
| |
tests/Makefile.am:20: warning: compiling 'simple.c' with per-target flags requires 'AM_PROG_CC_C_O' in 'configure.ac'
http://hydra.nixos.org/build/2796463
|
|
|
|
|
|
|
|
|
| |
- add options in AM_INIT_AUTOMAKE to be more strict
and to enable more advanced features (color-tests and parallel-tests)
- rewrite tests/Makefile.am to use automake rules for building program and libraries
=> we can now do:
./bootstrap.sh && mkdir build && cd build && ../configure && make -j distcheck
|
|
|
|
|
|
| |
- quote argument (mostly cosmetic)
- use a file present only once in the sources for AC_CONFIG_SRCDIR
- use AC_CONFIG_AUX_DIR to put all auxilary scripts in a subdirectory
|
|
|
|
|
| |
RPM doesn't allow dashes in version numbers, so use an underscore
instead. Also, let Autoconf generate the RPM spec file.
|
|
|
|
|
| |
the release expression.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|