• Igor Eremeev's avatar
    Fix some minor issues with fixed load address in chromium linker. · 61c8116a
    Igor Eremeev authored
    - Fix address space leak in modern linker. If wanted address can no
    longer be mapped at (which is possible), linker falls back to usual aslr
    loading without sharing relro's. There was a missing call to munmap, so
    that this chunk of 192MB remained dangling. Legacy linker handles this
    correctly, see InternalElfLoader::ReserveAddressSpace at crazy_linker
    lib.
    
    - Fix needless call to GetRandomBaseLoadAddress in child processes.
    Method ensureInitializedLocked uses mInBrowserProcess to determine if it
    needs to generate an address for library loading. mInBrowserProcess is
    initialized with 'true', so we had a useless mmap of 192MB in every
    child process.
    
    Change-Id: I918e9a35bf5179a79a3676e4a50f3c6e7677933c
    Bug: 1108740
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2315019Reviewed-by: default avatarBenoit L <lizeb@chromium.org>
    Commit-Queue: Benoit L <lizeb@chromium.org>
    Auto-Submit: Igor Eremeev <myrth@yandex-team.ru>
    Cr-Commit-Position: refs/heads/master@{#791213}
    61c8116a
modern_linker_jni.cc 18.4 KB