diff options
author | 2024-07-17 19:37:12 -0700 | |
---|---|---|
committer | 2024-07-24 22:14:49 +0000 | |
commit | a59ac6ddb5e0a28f581d9a2b24810b85b762c7fc (patch) | |
tree | 82bdaf18260d3c4e9ab71e44e1d2f530642815f4 /libnativeloader/native_loader.cpp | |
parent | ec92fc1c095c6700f290f7dac95ab99b3b955982 (diff) |
Trim duplicate function symbols.
In the symbol table, there can be multiple functions at the same
offset. There is no need to keep these duplicate symbols since the
unwinder will only ever recognize one of them.
Therefore, keep only a single function for each offset, and choose the
symbol with the longest function size and the shortest name to save as
much space as possible.
Also, reorganize the code slightly so that only functions from the
dynamic symbol table are recorded and their offsets. This is now
used to skip any symbols at the same offset instead of using the
symbol name.
NOTE: The auto-formatter moved the include files around.
Test: Ran with the old algorithm and new algorithm and verified there
Test: are no duplicates at the same offset.
Test: Ran the unwind_symbols tool on these libraries and verified
Test: before the change and after the change there are the same number
Test: of symbols found.
Test: Built the entire tree and observed many system libraries are
Test: smaller in size.
Change-Id: I0c772fe2dfd335b971a9b58e75b6ea4a26d0d116
Diffstat (limited to 'libnativeloader/native_loader.cpp')
0 files changed, 0 insertions, 0 deletions