Skip to content

Commit

Permalink
Introduce address based index to ELF symbol table cache
Browse files Browse the repository at this point in the history
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
d-e-s-o authored and danielocfb committed Dec 23, 2024
1 parent 9a39222 commit 629bcc0
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 120 deletions.
Loading

0 comments on commit 629bcc0

Please sign in to comment.