Skip to content
Commit 3aed484a authored by Alessandro Di Federico's avatar Alessandro Di Federico
Browse files

Fix `li-csv-to-ld-options` warning message

We used to check if the value of `/proc/sys/vm/mmap_min_addr` is at
least as high as the minimum segment of the input binary. If this is not
the case the linked program will segfault at run-time without much
explanation.

However, in truth, we need to be able to map also the page before the
lowest page the original binary mapped. The main reason for this is to
have space for the (outer) ELF header.

It turns out that on many distros the default minimum value is
`0x10000`, which happens to be exactly the same address at which ARM
binaries mmap their lowest page. This lead to no warning, but a segfault
at run-time.

The AWK script now checks for the correct value, and also suggests the
correct value.

In the future, we might want to create a new segment for the outer ELF
header and position it elsewhere in the address space.
parent 4e871c6f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment