From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10459 Path: news.gmane.org!.POSTED!not-for-mail From: Jon Chesterfield Newsgroups: gmane.linux.lib.musl.general Subject: Deploying a dynamic executable on glibc systems - how? Date: Thu, 15 Sep 2016 14:20:27 +0100 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1134fcc294ca7c053c8bb5f0 X-Trace: blaine.gmane.org 1473945657 14838 195.159.176.226 (15 Sep 2016 13:20:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Sep 2016 13:20:57 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-10472-gllmg-musl=m.gmane.org@lists.openwall.com Thu Sep 15 15:20:49 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1bkWao-0002Cd-7k for gllmg-musl@m.gmane.org; Thu, 15 Sep 2016 15:20:42 +0200 Original-Received: (qmail 24462 invoked by uid 550); 15 Sep 2016 13:20:42 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 24421 invoked from network); 15 Sep 2016 13:20:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=KeKCsqD/lMDMfBaMRfiLgcXDEvBCrFwDe5fGTZLmGt8=; b=Ic6gWjciKStUQmIr34QwnaCphyaESugGoqGDLvWf8vzMPdJTQS2XvEB5/WWi3w87/9 WpyxGtaphwO+LJBvX55Y8e1PczddE5Vmz1ZizPQsAoA4kYH2SIILbKockLN47lpTEVGH 5E883QHMWv3RG2p0f05mCE3abD/9ov+RES/GsEf/wVDN3Arxt4ZEqlKTXflj1b4H9LAT 31JejLLF3qhIov7nNkMDk30B7eOutUK7tWkhwvA0zcnfjOqjGutD9ZGej4DcnQccogq8 2e9f0+8iV/AW+H9pfP/Th8QFirPfRnooOUbax4BjXsLF+ulN/n5mMHeqJd9Ex59E1ws6 D+KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=KeKCsqD/lMDMfBaMRfiLgcXDEvBCrFwDe5fGTZLmGt8=; b=dZ7/Ls37Lw0egJ5WScCEQUGatcQaUDUAVC6PjFw0i8U1kSlRyBMGtKvaMYG1uP8Ssy s6+dFJiq8CUnzERu+3dkGF9un280XJvMEC57n82bFxIjssXtux0ELNeZGvQiyr+ANbtT kXZFW6kA6uUmKg0BnD6WnXqi0I7i29LsCgycDbU8qQvzqQ84O1OTizv4gDChMctxrTJp JRjCoDn5Fi+KboYaWBH+NvTwQ5R4Pttrx4KpVYthZyJeZKfFTyyE/NCrDJnbAY21Z3FM 5++dEC41AdWuFVf2LryMLoO79eH8YEq0yTMpJ43eFTwCrP2fUXommWs9llyEuK8/XB4A F3TQ== X-Gm-Message-State: AE9vXwMijAmEZYJG1i1vU4zvrMfn73i4blzEavEmiYU70WKsnVyiSuAq4+FYcUVePhaL0pFFEz+g+FVMV2Ur2w== X-Received: by 10.202.236.66 with SMTP id k63mr7732583oih.127.1473945628099; Thu, 15 Sep 2016 06:20:28 -0700 (PDT) Xref: news.gmane.org gmane.linux.lib.musl.general:10459 Archived-At: --001a1134fcc294ca7c053c8bb5f0 Content-Type: text/plain; charset=UTF-8 Hi all, I have just been through the process of shipping a program built on a recent glibc system for use on an old one. This has left me looking for an alternative. In general, I like the approach of statically linking everything and shipping the single enormous binary. This solves the compatibility problems in exchange for removing dynamic linking. Unfortunately I also like dlopen and the combination of static linking and dlopen is an unhappy one. My thoughts on resolving this are: 1/ link the entire musl libc into a static main executable 2/ put all the symbols in a table analogous to a plt in this executable 3/ hack the loader to look in said table 4/ open plugin using dlopen The idea is to keep main static enough that it doesn't need the system loader to start, yet dynamic enough that libc can be exported. However, "first hack the loader" suggests there may be a better way. I'm essentially looking for a way of deploying an application that can load plugins without also installing the musl loader to the host. Can someone see a better solution? Kind regards, Jon --001a1134fcc294ca7c053c8bb5f0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Hi all,

I have just been through the process of shipping a program b= uilt on a recent glibc system for use on an old one. This has left me looki= ng for an alternative.

In general, I like the approach of statically linking everyt= hing and shipping the single enormous binary. This solves the compatibility= problems in exchange for removing dynamic linking.

Unfortunately I also like dlopen and the combination of stat= ic linking and dlopen is an unhappy one.

My thoughts on resolving this are:
1/ link the entire musl libc into a static main executable
2/ put all the symbols in a table analogous to a plt in this executable
3/ hack the loader to look in said table
4/ open plugin using dlopen

The idea is to keep main static enough that it doesn't n= eed the system loader to start, yet dynamic enough that libc can be exporte= d.

However, "first hack the loader" suggests there ma= y be a better way. I'm essentially looking for a way of deploying an ap= plication that can load plugins without also installing the musl loader to = the host. Can someone see a better solution?

Kind regards,

Jon

--001a1134fcc294ca7c053c8bb5f0--