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

symtabAPI: Apply corrections for the library_adjust page offset #109

Merged
merged 1 commit into from Jun 28, 2016

Conversation

cuviper
Copy link
Contributor

@cuviper cuviper commented Jun 28, 2016

This commit aggregates the incremental fixes that Bill Williams and I
found while investigating issue #93, rewriting libc.so.

  • The offsets of new sections need to account for library_adjust when
    placing themselves after the first new section.
  • TLS symbol values need not be adjusted, as they're section-relative.
  • DT_INIT/FINI values need to be adjusted.
  • x86 IRELATIVE relocations need their addends adjusted.

Fixes #93.

This commit aggregates the incremental fixes that Bill Williams and I
found while investigating issue dyninst#93, rewriting libc.so.

- The offsets of new sections need to account for library_adjust when
  placing themselves after the first new section.
- TLS symbol values need *not* be adjusted, as they're section-relative.
- DT_INIT/FINI values need to be adjusted.
- x86 IRELATIVE relocations need their addends adjusted.

Fixes dyninst#93.
@wrwilliams
Copy link
Member

What, other than the libc test case, is already verified, and what's on tomorrow's TODO for me?

@cuviper
Copy link
Contributor Author

cuviper commented Jun 28, 2016

I've made sure that everything in the libc-sampler I offered before now works, both as a standalone program and with LD_PRELOAD into ls. It would be nice to have something in the testsuite for this, since libc.so is a fairly juicy target.

Also, all of the rewriter tests pass on Fedora 24 x86_64, except for -test test1_33 -32 -pic which I believe was already failing. "Detected 3 basic blocks in test1_33_func3, should be at least ten."

If you have ppc readily available, that probably deserves testing too. There may be more arch-specific papercuts lingering.

@wrwilliams
Copy link
Member

I do have ppc readily available, but it's behaving quite oddly (see #34 for details). That said, it was producing binaries that execute IIRC for both pic and non-pic, and I can sanity check that much at least.

RHEL6 should be boring but I'm about to confirm that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rewritten libc.so is not usable
2 participants