[Courgette] Refactor: Store Label Annotation in AssemblyProgram for patch generation.
For Courgette-gen, label adjustment needs lists of abs32 & rel32 Label*
sorted by file offset. Let these lists be "Label Annotations".
Previously these were extracted during label adjustment from list of
instructions in AssemblyProgram, but now we wish to remove these stored
This CL make AssemblyProgram store Label annotations. These are computed
only when needed (Courgette-gen / -gen1a). Details:
- Add ParseDetecteExecutableWithAnnotation() alongside
ParseDetecteExecutable(), to avoid affecting flows that don't require
- AssemblyProgram: Add |*_label_annotations_| as storage vectors. These
are optionally populated in InstructionStoreReceptor when
Disassembler::Disassemble() gets called.
- InstructionCountReceptor now put into use.
- Simplify Label adjustment: AssemblyProgram::HandleInstructionLabels()
is replaced with visiting AssemblyProgram's Label Annotations.
- Subtle: GraphAdjuster now includes abs64. The class doesn't get used,
but the change is logical anyway.
12 files changed