Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Unified Diff: courgette/disassembler_elf_32.h

Issue 1928683002: [Courgette] ELF: Fix abs32 / rel32 ordering in ParseFile() and restrict rel32 parsing to .text. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | courgette/disassembler_elf_32.cc » ('j') | courgette/disassembler_elf_32.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/disassembler_elf_32.h
diff --git a/courgette/disassembler_elf_32.h b/courgette/disassembler_elf_32.h
index 063c2e2cecec3f5ac354d85892784259954989e1..8793106957283890b19a70da4ba061410f4d6478 100644
--- a/courgette/disassembler_elf_32.h
+++ b/courgette/disassembler_elf_32.h
@@ -61,10 +61,15 @@ class DisassemblerElf32 : public Disassembler {
virtual uint16_t op_size() const = 0;
// Comparator for sorting, which assumes uniqueness of RVAs.
- static bool IsLessThan(TypedRVA* a, TypedRVA* b) {
+ static bool IsLessThanByRVA(TypedRVA* a, TypedRVA* b) {
return a->rva() < b->rva();
}
+ // Comparator for sorting, which assumes uniqueness of file offsets.
+ static bool IsLessThanByFileOffset(TypedRVA* a, TypedRVA* b) {
+ return a->file_offset() < b->file_offset();
+ }
+
private:
const RVA rva_;
RVA relative_target_ = kNoRVA;
@@ -163,6 +168,7 @@ class DisassemblerElf32 : public Disassembler {
CheckBool CheckSection(RVA rva) WARN_UNUSED_RESULT;
+ // Extracts all rel32 TypedRVAs. Does not sort the result.
CheckBool ParseRel32RelocsFromSections() WARN_UNUSED_RESULT;
const Elf32_Ehdr* header_;
« no previous file with comments | « no previous file | courgette/disassembler_elf_32.cc » ('j') | courgette/disassembler_elf_32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698