mbox

[0/4] _r_debug copy relocation support

Message ID cover.1640284721.git.fweimer@redhat.com
Headers

Message

Florian Weimer Dec. 23, 2021, 6:43 p.m. UTC
  I implemented this because we received a bug that the _r_debug extension
mechanism broke dyninst.  But it turns out it wasn't because of a copy
relocation: dyninst has its own interposing *definition* of _r_debug, so
the patch series doesn't solve this.  It can only handle an interposing
definition in the main executable, not one in shared object (although I
guess in theory we could fix this).

The first two patches are independently useful, and the second two
patches could be used if we ever need to implement copy relocation
support for _r_debug.

Tested on i686-linux-gnu and x86_64-linux-gnu.

Thanks,
Florian

Florian Weimer (4):
  elf: Introduce separate _r_debug_array variable
  elf: Introduce _dl_debug_change_state
  elf: Support version-less lookup in _dl_lookup_direct
  elf: Restore support for _r_debug copy relocations

 elf/Makefile               |   8 +++
 elf/dl-close.c             |   6 +-
 elf/dl-debug.c             | 138 ++++++++++++++++++++++++++-----------
 elf/dl-load.c              |   6 +-
 elf/dl-lookup-direct.c     |   5 ++
 elf/dl-open.c              |   5 +-
 elf/rtld.c                 |  10 +--
 elf/tst-dlmopen4-nonpic.c  |   2 +
 elf/tst-dlmopen4-pic.c     |   2 +
 elf/tst-dlmopen4.c         |  22 ++++++
 sysdeps/generic/ldsodefs.h |  27 ++++++--
 11 files changed, 168 insertions(+), 63 deletions(-)
 create mode 100644 elf/tst-dlmopen4-nonpic.c
 create mode 100644 elf/tst-dlmopen4-pic.c


base-commit: 9702a7901e18460e8ffc5f56a493d41294a8e936