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

Rebase of PR 1/11: @Clementguidi: dynamic: Refactor logic to perform multiple updates (dynamic runtime init) #1851

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Commits on Nov 28, 2023

  1. dynamic: Load dynamic info only once

    This is in preparation of runtime dynamic patching. This commit
    guarantees that dynamic info is read only once for the target binary and
    for each module.
    
    Co-authored-by: Gabriel-Andrew Pollo-Guilbert <[email protected]>
    Signed-off-by: Seyed-Vahid Azhari <[email protected]>
    2 people authored and bernhardkaindl committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    d13e467 View commit details
    Browse the repository at this point in the history
  2. dynamic: Initialize size filter only once

    If 'mcount_dynamic_update' is called multiple times (e.g. at runtime),
    it initializes the size filter only once.
    
    Signed-off-by: Clément Guidi <[email protected]>
    clementguidi authored and bernhardkaindl committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    873fbf2 View commit details
    Browse the repository at this point in the history
  3. dynamic: arch: Initialize disassembly engine once

    Skip the initialization of the disassembly engine with it has already
    been performed.
    
    Signed-off-by: Clément Guidi <[email protected]>
    clementguidi authored and bernhardkaindl committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    6ef85df View commit details
    Browse the repository at this point in the history
  4. dynamic: Discard the pattern list after update

    The dynamic pattern list is not reused from a dynamic update to another,
    keeping libmcount stateless in that regard.
    
    Co-authored-by: Gabriel-Andrew Pollo-Guilbert <[email protected]>
    Signed-off-by: Clément Guidi <[email protected]>
    2 people authored and bernhardkaindl committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    971f89a View commit details
    Browse the repository at this point in the history
  5. dynamic: Refactor 'mcount_dynamic_update'

    The 'mcount_dynamic_update' is now safe to call multiple times,
    including at runtime. On each call, it will perform patching and
    unpatching of the target (not implemented yet).
    
    Signed-off-by: Clément Guidi <[email protected]>
    clementguidi authored and bernhardkaindl committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    f5a598d View commit details
    Browse the repository at this point in the history
  6. dynamic: Streamline trampoline life cycle

    Install a trampoline for each loaded module map, on initialization. Keep
    the trampolines in memory to allow for dynamic patching at runtime.
    Clear the trampolines on libmcount exit.
    
    Co-authored-by: Gabriel-Andrew Pollo-Guilbert <[email protected]>
    Signed-off-by: Clément Guidi <[email protected]>
    2 people authored and bernhardkaindl committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    d884b23 View commit details
    Browse the repository at this point in the history
  7. dynamic: Init arch-specific structures

    Trigger architecture specific dynamic initialization when initializing
    the dynamic instrumentation mechanics.
    
    Co-authored-by: Gabriel-Andrew Pollo-Guilbert <[email protected]>
    Signed-off-by: Clément Guidi <[email protected]>
    2 people authored and bernhardkaindl committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    c98e5fa View commit details
    Browse the repository at this point in the history
  8. dynamic: Save original instructions only once

    Don't save instructions if they are already present in the code hmap.
    
    Signed-off-by: Clément Guidi <[email protected]>
    clementguidi authored and bernhardkaindl committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    0646d28 View commit details
    Browse the repository at this point in the history
  9. Rebased Clément Guidi's PR#1702 to master (without changes)

    Commands used:
    gh pr checkout 1702
    git switch -c new-branch
    git rebase master        # (no warnings, no conflicts)
    git push
    
    Signed-off-by: Bernhard Kaindl <[email protected]>
    bernhardkaindl committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    e4ad5a3 View commit details
    Browse the repository at this point in the history