diff options
author | Damien Le Moal <damien.lemoal@wdc.com> | 2021-04-17 10:10:08 +0900 |
---|---|---|
committer | Greg Ungerer <gerg@linux-m68k.org> | 2021-04-19 09:56:37 +1000 |
commit | 04d82a6d0881ef1ab1e9f66f10805177ee2fb1e8 (patch) | |
tree | 24c5ead3c1bb507a8682a01b98a278eb95108adb /include/media | |
parent | bf05bf16c76bb44ab5156223e1e58e26dfe30a88 (diff) |
binfmt_flat: allow not offsetting data start
Commit 2217b9826246 ("binfmt_flat: revert "binfmt_flat: don't offset
the data start"") restored offsetting the start of the data section by
a number of words defined by MAX_SHARED_LIBS. As a result, since
MAX_SHARED_LIBS is never 0, a gap between the text and data sections
always exists. For architectures which cannot support a such gap
between the text and data sections (e.g. riscv nommu), flat binary
programs cannot be executed.
To allow an architecture to request no data start offset to allow for
contiguous text and data sections for binaries flagged with
FLAT_FLAG_RAM, introduce the new config option
CONFIG_BINFMT_FLAT_NO_DATA_START_OFFSET. Using this new option, the
macro DATA_START_OFFSET_WORDS is conditionally defined in binfmt_flat.c
to MAX_SHARED_LIBS for architectures tolerating or needing the data
start offset (CONFIG_BINFMT_FLAT_NO_DATA_START_OFFSET disabled case)
and to 0 when CONFIG_BINFMT_FLAT_NO_DATA_START_OFFSET is enabled.
DATA_START_OFFSET_WORDS is used in load_flat_file() to calculate the
data section length and start position.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
Diffstat (limited to 'include/media')
0 files changed, 0 insertions, 0 deletions