Skip to content
Snippets Groups Projects
  • Alessandro Di Federico's avatar
    3aed484a
    Fix `li-csv-to-ld-options` warning message · 3aed484a
    Alessandro Di Federico authored
    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.
    3aed484a
    History
    Fix `li-csv-to-ld-options` warning message
    Alessandro Di Federico authored
    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.