[DynInst_API:] [dyninst/dyninst] 2e78f7: fix Position Independent Executable (PIE) handling...


Date: Fri, 28 May 2021 13:46:38 -0700
From: kupsch <noreply@xxxxxxxxxx>
Subject: [DynInst_API:] [dyninst/dyninst] 2e78f7: fix Position Independent Executable (PIE) handling...
  Branch: refs/heads/master
  Home:   https://github.com/dyninst/dyninst
  Commit: 2e78f7c5c26c8ba5c9f9388d3ba447450528dcbf
      https://github.com/dyninst/dyninst/commit/2e78f7c5c26c8ba5c9f9388d3ba447450528dcbf
  Author: kupsch <kupsch@xxxxxxxxxxx>
  Date:   2021-05-28 (Fri, 28 May 2021)

  Changed paths:
    M dyninstAPI/src/dynProcess.C
    M dyninstAPI/src/image.C
    M dyninstAPI/src/image.h
    M dyninstAPI/src/mapped_object.C
    M dyninstAPI/src/pcEventHandler.C
    M dyninstAPI/src/unix.C
    M proccontrol/src/sysv.C
    M symtabAPI/doc/API/Symtab/Module.tex
    M symtabAPI/doc/API/Symtab/Symtab.tex
    M symtabAPI/h/Symtab.h
    M symtabAPI/src/Object-elf.C
    M symtabAPI/src/Object-elf.h
    M symtabAPI/src/Symtab.C

  Log Message:
  -----------
  fix Position Independent Executable (PIE) handling (#1042)

* fix Position Independent Executable (PIE) handling

All functions that determine if an object is a shared library and/or an
executable are now based on a single set of functions in Object-elf.
This make all the functions in the various Dyninst libraries and classes
consistent and also makes Dyninst correctly handle PIE executables.
These functions in Object-elf are based on functions found in elfutils's
elfclassify program (with small improvements to better determine if a
shared library is also an executable).   The new functions in Object-elf
include:

    * isOnlyExecutable()
    * isExecutable()
    * isSharedLibrary()
    * isOnlySharedLibrary()
    * isLoadable()
    * isDebugOnly()
    * isLinuxKernelModule()

Symtab exposes some of these functions through its public API.  isExec()
now correctly handles PIE executables, and two new functions were added
to determine if the underlying file is a shared library, an executable,
or both.  These function are:

    * isExec()            (isExecutable() and not isSharedLibrary())
    * isExecutable()
    * isSharedLibrary()

* remove unnecessary assert


[← Prev in Thread] Current Thread [Next in Thread→]
  • [DynInst_API:] [dyninst/dyninst] 2e78f7: fix Position Independent Executable (PIE) handling..., kupsch <=