[DynInst_API:] [dyninst/dyninst] 760bfd: A couple fixes for binary rewriting of statically ...


Date: Wed, 06 Feb 2019 14:07:02 -0800
From: Xiaozhu Meng <noreply@xxxxxxxxxx>
Subject: [DynInst_API:] [dyninst/dyninst] 760bfd: A couple fixes for binary rewriting of statically ...
  Branch: refs/heads/master
  Home:   https://github.com/dyninst/dyninst
  Commit: 760bfda6e409b4b61a6acd093548afa5860b4af1
      https://github.com/dyninst/dyninst/commit/760bfda6e409b4b61a6acd093548afa5860b4af1
  Author: Xiaozhu Meng <xmeng@xxxxxxxxxxx>
  Date:   2019-01-29 (Tue, 29 Jan 2019)

  Changed paths:
    M dwarf/src/dwarfFrameParser.C
    M dyninstAPI/src/parse-power.C
    M dyninstAPI_RT/src/RTcommon.c
    M dyninstAPI_RT/src/RTstatic_ctors_dtors-ppc64.c
    M symtabAPI/src/Object-elf.C
    M symtabAPI/src/emitElf.C
    M symtabAPI/src/emitElfStatic-ppc64.C
    M symtabAPI/src/emitElfStatic.C

  Log Message:
  -----------
  A couple fixes for binary rewriting of statically linked binaries on ppcle

1. The handling of the libc global constructor and destructor is out-of-date. Follow the handling for x86-64.
2. Replace [] operator with insert() for std::map. [] operator caused weird memory corruptions
3. Symbols defined in .bss sections should not be considered undefined symbosl
4. Add and fix handling for a couple of ppc64 relocation entries


  Commit: 219df01f7502451e05603ecbcac86446d2dc9800
      https://github.com/dyninst/dyninst/commit/219df01f7502451e05603ecbcac86446d2dc9800
  Author: Xiaozhu Meng <xmeng@xxxxxxxxxxx>
  Date:   2019-01-29 (Tue, 29 Jan 2019)

  Changed paths:
    M proccontrol/src/process.C

  Log Message:
  -----------
  Fix crash caused by erasing an iterator from a std::map while looping the iterator


  Commit: 8406a8facd884374c6767b5b5ed947bfda4c2d3c
      https://github.com/dyninst/dyninst/commit/8406a8facd884374c6767b5b5ed947bfda4c2d3c
  Author: Xiaozhu Meng <xmeng@xxxxxxxxxxx>
  Date:   2019-01-30 (Wed, 30 Jan 2019)

  Changed paths:
    M dyninstAPI/src/parse-power.C
    M symtabAPI/src/Object-elf.C
    M symtabAPI/src/emitElfStatic-ppc64.C
    M symtabAPI/src/emitElfStatic.C

  Log Message:
  -----------
  More fixes on ppcle rewriting of statically linked binaries

1. Revert the change made in "760bfda6e409b4b61a6acd093548afa5860b4af1" about undefined symbols.
Section with number 0 is NULL section, not .bss. So, symbols with section number 0 are indeed
undefined symbols.
2. libc.a depends on libgcc.a on fedora 28 ppcle. So, also open libgcc.a to resolve undefined symbols.
3. Fix the handling of relocation entry "R_PPC64_REL24". R_PPC64_REL24 means the caller has set
up R2, so we should call the local entry point. Calling the global entry may lead to wrong r2, because
r12 is not properly set at the call site.
4. IFUNC should not be treated as a need for PLT.


  Commit: 6b6667dd8e7d365f3dabd010aca1f4993ba2bd23
      https://github.com/dyninst/dyninst/commit/6b6667dd8e7d365f3dabd010aca1f4993ba2bd23
  Author: Xiaozhu Meng <xmeng@xxxxxxxxxxx>
  Date:   2019-01-30 (Wed, 30 Jan 2019)

  Changed paths:
    M symtabAPI/src/emitElfStatic-x86.C

  Log Message:
  -----------
  Do not generate new PLTs for IFUNC when rewriting statically linked
binaries on x86. IFUNC should be handled by the loader, not the
linker, which is Dyninst when rewriting statically linked binaries.


  Commit: 86512d5fea1c675950291ac735ba15ee1205a8c7
      https://github.com/dyninst/dyninst/commit/86512d5fea1c675950291ac735ba15ee1205a8c7
  Author: Xiaozhu Meng <mxz297@xxxxxxxxx>
  Date:   2019-02-06 (Wed, 06 Feb 2019)

  Changed paths:
    M dwarf/src/dwarfFrameParser.C
    M dyninstAPI/src/parse-power.C
    M dyninstAPI_RT/src/RTcommon.c
    M dyninstAPI_RT/src/RTstatic_ctors_dtors-ppc64.c
    M proccontrol/src/process.C
    M symtabAPI/src/Object-elf.C
    M symtabAPI/src/emitElf.C
    M symtabAPI/src/emitElfStatic-ppc64.C
    M symtabAPI/src/emitElfStatic-x86.C
    M symtabAPI/src/emitElfStatic.C

  Log Message:
  -----------
  Merge pull request #543 from dyninst/ppcle_rhel8_fix

Ppcle rhel8 fix


Compare: https://github.com/dyninst/dyninst/compare/f3a01e308332...86512d5fea1c
[← Prev in Thread] Current Thread [Next in Thread→]