diff options
author | Pierre Bourdon <delroth@gmail.com> | 2020-06-19 23:46:23 (GMT) |
---|---|---|
committer | Pierre Bourdon <delroth@gmail.com> | 2020-06-19 23:46:23 (GMT) |
commit | 0470d6921b5a3fe8e92e356c8e11d120dbbb06c0 (patch) | |
tree | 276dcd224628536e1d8e9d29f8cd23a2c3f47268 /tests/foo.c | |
parent | 7013e59d5ae974006c088663559613bf23a66414 (diff) | |
download | patchelf-0470d6921b5a3fe8e92e356c8e11d120dbbb06c0.zip patchelf-0470d6921b5a3fe8e92e356c8e11d120dbbb06c0.tar.gz patchelf-0470d6921b5a3fe8e92e356c8e11d120dbbb06c0.tar.bz2 |
Improve the default section alignment choice
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.
Diffstat (limited to 'tests/foo.c')
0 files changed, 0 insertions, 0 deletions