-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ElfFile helper for iterating over section entries
Summary: Many ELF sections contain arrays of fixed-size elements. Add a helper function for iterating over these types of sections similar to `ElfFile::iterateSymbols` but which will work for other types. ``` /** * Iterate over entries within a given section. * * Returns a pointer to the current ("found") entry when fn returned * true, or nullptr if fn returned false for all entries. */ template <typename E> const E* iterateSectionEntries( const ElfShdr& section, std::function<bool(const E&)> fn) const noexcept(is_nothrow_invocable_v<E const&>); ``` Update `ElfFile::iterateSymbols()` to call the new method. Reviewed By: jordalgo Differential Revision: D38810522 fbshipit-source-id: bf028001f153bdb867c4d8383e486c7c9e18ed95
- Loading branch information
1 parent
1bdf5f3
commit a64dbed
Showing
2 changed files
with
31 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters