Description[Courgette] ELF: Fix abs32 / rel32 ordering in ParseFile() and restrict rel32 parsing to .text.
This CL fixes 2 problems in Courgette ELF parsing:
1. ParseFile() scans through file bytes in file offset order while
visiting abs32 and rel32 locations in lockstep. However, these
locations were previously not sorted by file offset, resulting in
some abs32 and rel32 locations being ignored.
2. ParseRel32RelocsFromSections() is too permissive, and extracts bogus
rel32 addresses from non-code.
To solve (1) we sort abs32 and rel32 addresses by file offset in
ParseFile(). To solve (2) we restrict rel32 parsing to ".text" section
(heuristic). Also updating ELF test results.
BUG=601948
Committed: https://crrev.com/3da0dd9308f66ae1122bbaefda2c99a4f90372d4
Cr-Commit-Position: refs/heads/master@{#390506}
Patch Set 1 #
Total comments: 3
Messages
Total messages: 16 (5 generated)
|