public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Farid Zakaria <fmzakari@ucsc.edu>
To: gcc-help@gcc.gnu.org
Subject: How can I wrap ld-linux or execve into it?
Date: Sun, 30 Jan 2022 19:53:45 -0800	[thread overview]
Message-ID: <CAH4OOv66EL2TX08xpudjiPHLsYK6kiMO-agY2d=x7oqqxMLUBA@mail.gmail.com> (raw)

 Hi,

Not exactly sure if this is the best mailing list for this question,
please recommend me elsewhere if more appropriate.

I am looking to perform some functionality before the dynamic linker
(linux-ld/ld.so) is invoked.

My naive assessment was that I would be able to set in the PT_INTERP
section of a binary, my *static binary*, which will then execve into
the dynamic linker after doing some precanned actions.

I came across https://github.com/Mic92/nix-ld which seems to do
something similar, but I was curious why it has to do a lot more to
achieve the same effect with a jump.

Cheers
FZ

             reply	other threads:[~2022-01-31  3:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-31  3:53 Farid Zakaria [this message]
2022-01-31  8:12 ` Jonathan Wakely
2022-01-31 19:49   ` Florian Weimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH4OOv66EL2TX08xpudjiPHLsYK6kiMO-agY2d=x7oqqxMLUBA@mail.gmail.com' \
    --to=fmzakari@ucsc.edu \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).