Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Courgette] Fix ELF reference sorting.
This CL addresses 2 reference sorting issues in DisassemblerElf32: (1) Bug fix: In ParseFile(), |abs32_locations_| (RVAs) is translated to |abs_offsets| (file offsets), but we sort |abs32_locations_|, which is redundant. Actually we should sort |abs_offsets|. (2) Cleanup: |rel32_relocations_| stores rel32 references sorted by RVA, but in ParseFile() we re-sort these in offset order. Previously Disassemble() optimizes away redundant sorts, but this makes the code less robust. We de-optimize this a little potentially redundant sort-by-RVA, to assert that |rel32_locations_| is sorted by RVA outside of ParseFile(). This CL also makes Disassemble() more uniform, to prepare for refactoring in a follow-up. Meanwhile, DisassemblerWin32 does not experience issue since it assumes RVA order is same as file offset order (this assumption has not has not caused problems so far). BUG=660980 Review-Url: https://codereview.chromium.org/2744373004 Cr-Commit-Position: refs/heads/master@{#458650}
- Loading branch information