From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by sourceware.org (Postfix) with ESMTPS id BC3C03857C46 for ; Mon, 31 Jan 2022 20:29:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BC3C03857C46 Received: by mail-yb1-xb31.google.com with SMTP id m6so44168221ybc.9 for ; Mon, 31 Jan 2022 12:29:33 -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:references:in-reply-to:from:date :message-id:subject:to; bh=W3rwEAGcNtoGwDCFGekuCmdMXd95M4CzhrG+I3qyVLk=; b=SgS3StS7lKC66GvhhDIGUjByYb13bUpgjqsCUuOscyPu17PVL8sa8NmPFwbQXzCNm4 u8ZB3ItEz/P+JUPaCpe3qv1bAxnnaaaGBpl3LOMxqmGDnWr8VVYeYNpWOw2RZ6DQsRkR nlOskB+Dj8sDyyLwdfPTtGW8d3AIm+kFwcUycJJvXowymq7OZ+pLvT1vTDjwwQMir5XV L6WRRdCuXYObfNhUH3RA4f5MRvVsWXEeCCc5RdU7ma4pDYNhgzuvLzasxlz5Ifner3Dx HHnNsDNvcCaHHfxk7zHbSfDXmRhciC5J/DDn9AzgB9Cm9ZlQUBSUqatLi9Q1LCOBVieX tW2w== X-Gm-Message-State: AOAM533smYK04JLPvzh5oiTEUNwCyxl/5SFFNOIQIRb8Rwa5EbP9gYbr wRV5+UQltXiqrHFrIq0f2ABvlkgH3a+F86bjsWm95uRVa5w= X-Google-Smtp-Source: ABdhPJwclTYNdBh0AKyl0ZfTy1n/g0/Bn8O/db5CifKUjp7y6CMUMZth71w1uccltpzfoWDn07ORqDWYawuItQirxY8= X-Received: by 2002:a25:dd07:: with SMTP id u7mr8926224ybg.287.1643660972049; Mon, 31 Jan 2022 12:29:32 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Farid Zakaria Date: Mon, 31 Jan 2022 12:29:21 -0800 Message-ID: Subject: Re: How can I wrap ld-linux or execve into it? To: libc-help@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=0.3 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: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jan 2022 20:29:35 -0000 Adding some more context based on some private responses: My goal is to explore some potential changes as part of a PhD thesis to control dynamic linking. I have explored modifying glibc/musl but I was exploring an execve approach to: 1. make the change libc agnostic 2. restrict my changes to a smaller codebase for the purpose of the exploration On Mon, Jan 31, 2022 at 12:10 PM Farid Zakaria wrote: > > Hi, > > 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. > > Unfortunately, trying this has resulted in some SIGSEGV... > > 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. > > I have also been pointed to LD_AUDIT however I am also interested in > having it agnostic to libc (glibc vs. musl) > > Thank you for any tips, guidance or links you can provide. > FZ