• Mike Wittman's avatar
    [base] Add ElfReader tests for non-relocatable files · 87363cc1
    Mike Wittman authored
    Updates the image builder to support non-relocatable ELF images and
    instantiates the tests for the non-relocatable images.
    
    Replaces GetElfBaseVirtualAddress() with GetRelocationOffset().
    Relocation is a well defined concept in the ELF standard, while
    'base virtual address' is not, and is at odds with the 'base address'
    concept.  For clarity, avoids the implicit assumption that the first
    load segment's file offset is 0.
    
    Makes the handling of the ELF base address consistent among the
    functions.
    
    Bug: 1101023
    Change-Id: I6eac949a79a02e7e3a662f604193bf414d5ad38f
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2305570
    Commit-Queue: Mike Wittman <wittman@chromium.org>
    Reviewed-by: default avatarWez <wez@chromium.org>
    Reviewed-by: default avatarKevin Marshall <kmarshall@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#794659}
    87363cc1
elf_reader.cc 6.78 KB