From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by sourceware.org (Postfix) with ESMTPS id 7719D3858C20 for ; Mon, 31 Jan 2022 03:53:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7719D3858C20 Received: by mail-yb1-xb36.google.com with SMTP id j2so23372583ybu.0 for ; Sun, 30 Jan 2022 19:53:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=iUjTsSZEAoqdg7sho8Zv+Q8lvwCCrHA4f+IsCS5zrlM=; b=xhdqiVck6fUrEIq+g1/fo73zmximWxeX/KmvFiNPltRunsdO4LIFZcxkRXmJ6VjNnj ItqCq+dXuGFZFtbmQ30enKALgmMsocX6v5O8Z0079G79k5QhD5nsDSfcdG4oB3nCnutS Y0+g07BzYKrs4Xa/aSq+Umam87Wpo14mNJJTlBHDZSwwQ9Ivy+3BaHoETuRG5PQ8LqOY UBDTmtx6fKwxjA1bIx48wnYmqKhyolCgNDIcTIReKJXCE5ndwKPb6qlGuvujsKq/VM7l pDoD3kIXtIAlCwcO6rb+2WHgt99Iqsv+WRTnysU+2icfs6veidP2mrfapLQPnRT0UnZG AlIQ== X-Gm-Message-State: AOAM5331upqDgDOOTjQ7XBZwcFM8TB8leblSKhZ64alof0IWPOCFjyP6 hAFF5XWU78T31p5HtD6DNmoX+I3VBwwgR/h5eaBu0z2ALze1bw== X-Google-Smtp-Source: ABdhPJwpb/PrOOQya2kMumCbz1NI1TnnPENXOpCDXnyuJF39TClLmg/e7ULaYv8t0maxg+3payamneu5W0EjJaCKt38= X-Received: by 2002:a25:7084:: with SMTP id l126mr28788294ybc.757.1643601235711; Sun, 30 Jan 2022 19:53:55 -0800 (PST) MIME-Version: 1.0 From: Farid Zakaria Date: Sun, 30 Jan 2022 19:53:45 -0800 Message-ID: Subject: How can I wrap ld-linux or execve into it? To: gcc-help@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jan 2022 03:53:58 -0000 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