DynamoRIO / DynamoRIO/dynamorio

Symbol iterators (dr_symbol_import_iterator_*) broken on ARM and AArch64

Open
#2,009 1 comment 0 reactions 0 assignees View on GitHub
OpSys-ARM
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 15h
Merged PRs (30d)
31

Description

The symbol iterators (dr_symbol_import_iterator_*) do not work correctly on ARM or AArch64 because this statement, found in a comment in dr_symbol_import_iterator_start, turns out not to be true for ARM and AArch64 binaries built with -rdynamic, at least with the tool chain versions I've tested: "gnu_symbias is the index of the first symbol in the hash table, so all of the imports are before it."

It would be better not to make unnecessary assumptions about how the symbols are sorted or divided: make both iterators (import and export) iterate through all the symbols and then filter on st_value. That should make the code both simpler and more reliable. Unfortunately, an attempt to implement this (b92660f476eeed0bb7591cdde8c06bf9163757c5) broke the Android build (https://github.com/DynamoRIO/dynamorio/issues/2008) and was reverted. Probably that patch should be revived one day.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.