Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add preferred base to DR and drmodtrack module data #4774

Closed
derekbruening opened this issue Mar 9, 2021 · 0 comments · Fixed by #4775
Closed

Add preferred base to DR and drmodtrack module data #4774

derekbruening opened this issue Mar 9, 2021 · 0 comments · Fixed by #4775

Comments

@derekbruening
Copy link
Contributor

For some use cases, the preferred base of a module is useful. In our case, our internal symbolization uses the binutils addr2line convention of two different types of PC: either an absolute PC for a non-relocatable executable (i.e., with a non-zero preferred==required base), or an offset from the load base for a position-independent library or executable (which has a zero preferred base for ELF; this design does not seem very cross-platform though as other types of binaries have non-zero preferred bases yet are relocatable). For this dual PC interface, there is not enough information in the module data recorded during tracing. This is a feature request to augment the trace module data (which will also require augmenting DR's public module interface) with either the preferred base or a flag indicating whether the module was at its preferred base.

@derekbruening derekbruening self-assigned this Mar 9, 2021
derekbruening added a commit that referenced this issue Mar 10, 2021
Adds a preferred_base field to the module_data_t struct.  There is no
compatibility break as DR allocates all such structs.

Adds a preferred_base field to the drmodtrack_info_t struct.  There is
no compatibility break as it has a struct_size field.  Offline
drmodtrack files do incur a version bump here, so an old reader will
fail when reading a file with the new field.  The field is set to a -1
sentinel to aid in determining whether a file has the field or not.
This is also done here with the previously-added offset field.

Adds some sanity checks to the corresponding tests.

Fixes #4774
derekbruening added a commit to DynamoRIO/drmemtrace_samples that referenced this issue Mar 22, 2021
Re-generates both the x86_64 and aarch64 traces to include the new
preferred base field in the modules.log file.

Updates the README files to match the new trace details.
Updates the libraries in the binaries directories.

Updates the old dynamorio_docs/ URLs in the README files.

Issue: DynamoRIO/dynamorio#4774
derekbruening added a commit to DynamoRIO/drmemtrace_samples that referenced this issue Mar 22, 2021
Adds updated binaries and other files that were missed in the prior
commit.

Issue: DynamoRIO/dynamorio#4774
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant