Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce address based index to ELF symbol table cache
So far our symbol table cache had the symbols mapped into memory and then sorted references to them by the respective symbol's address, in a heap allocated array. This is conceptually fine, but it is an approach that is incompatible with future changes. This change reworks the SymbolTableCache type as follows: 1) we to store the memory mapped symbols as-is; that is, we keep an (unsorted) slice of the symbols around 2) we then build an additional index that is sorted by address on top of that In so doing we eliminate the need for keeping unnecessary references to the memory mapped data around. Further more, we could optimize the (heap allocated) index further, by using a smaller index size when the number of symbols is below certain maxima. Third, because symbol filtering now happens inside SymbolTableCache, we remove the duplication for filtering and sorting symbols for 32 and 64 bit, respectively. Lastly, because we no longer heap allocate an array of references, we can ditch the ElfN_BoxedSyms type, which was arguably a weird special case to have, entirely. Signed-off-by: Daniel Müller <[email protected]>
- Loading branch information