[Courgette] Fix AssemblyProgram parsing for ELF-ARM.
This fixes two problems:
(A) In DisassemblerElf32, RVAToFileOffset() used Program Segment Header,
but FileOffsetToRVA() used Section Header. For consistency, both
should use the same one. We choose the latter (for now).
(B) Even if a section has sh_type=SHT_PROGBITS, it can still have
sh_addr=0. Extracting Rel32 address from these sections would add
overlapping RVA chaos, and so should be avoided.
Also using elf-arm7 in a unit test. The test fails before the fix and
passes after.
BUG= 579206
Review URL: https://codereview.chromium.org/1658463002
Cr-Original-Commit-Position: refs/heads/master@{#373639}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7ec152caaf55f64431dcb2c63cc052890c4a93f1
3 files changed