summaryrefslogtreecommitdiff
path: root/view/elf/elfview.cpp
diff options
context:
space:
mode:
authorZichuan Li <lizic@iu.edu>2024-05-21 17:56:03 -0400
committerZichuan Li <34680029+river-li@users.noreply.github.com>2024-05-28 12:22:23 -0400
commit9537f33da6b8de883a45c4b7758f0dc5c1438ed7 (patch)
tree08e9844aab5b9e830d9b30303b59fd0f022bea5a /view/elf/elfview.cpp
parent2a6cef7eac64dc3df4a17ba3dc73fb5e1046fc29 (diff)
Solved issue #1180 by adding new APIs
1. Add two new APIs for multiple entry functions `GetAllAnalysisEntryFunctions` and `AddToEntryFunctions` 2. Add Python APIs `entry_functions` and `add_to_entry_functions`. `entry_functions` resturns a list of functions, which supports parsing functions in `init_array`, `fini_array` and TLS callbacks. 3. Modify bin-info, it now prints all entry functions
Diffstat (limited to 'view/elf/elfview.cpp')
-rw-r--r--view/elf/elfview.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/view/elf/elfview.cpp b/view/elf/elfview.cpp
index f938e978..a01d043b 100644
--- a/view/elf/elfview.cpp
+++ b/view/elf/elfview.cpp
@@ -1539,9 +1539,15 @@ bool ElfView::Init()
entry += imageBaseAdjustment;
Ref<Architecture> entryArch = entryPointArch->GetAssociatedArchitectureByAddress(entry);
if (entryArch != entryPointArch)
- AddFunctionForAnalysis(platform->GetRelatedPlatform(entryArch), entry);
+ {
+ auto func = AddFunctionForAnalysis(platform->GetRelatedPlatform(entryArch), entry);
+ AddToEntryFunctions(func);
+ }
else
- AddFunctionForAnalysis(platform, entry);
+ {
+ auto func = AddFunctionForAnalysis(platform, entry);
+ AddToEntryFunctions(func);
+ }
m_logger->LogDebug("Adding function start: %#" PRIx64 "\n", entry);
// name functions in .init_array, .fini_array, .ctors and .dtors