[Courgette] Sort section headers by sh_offset in ELF flows.
Courgette ELF flows assumes that sections are sorted by |sh_offset|, but
this assumption may flow. In particular, nacl_irt_x86_32.nexe breaks
this, and this impacts Windows x86 Chrome because the .nexe file is
included. Solution is to do sort sections so we process them in the
order in file offset order.
This does not affect unittests. All test ELF data have "properly" sorted
sections, except elf-32-high-bss. And for this file, the offending .bss
section has sh_type=SHT_NOBITS, so DisassemblerElf32::ParseFile()
would ignore it.
BUG=601948
Review URL: https://codereview.chromium.org/1870293002
Cr-Original-Commit-Position: refs/heads/master@{#386306}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 8cffb28385dffb40c2c773b5b4c0730a533cd025
2 files changed