screen-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [screen-devel] Making screen a literate executable


From: Tavis Ormandy
Subject: Re: [screen-devel] Making screen a literate executable
Date: Thu, 1 Feb 2024 19:29:18 -0000 (UTC)
User-agent: slrn/1.0.3 (Linux)

On 2024-01-19, Krish Jain wrote:
> If you folks like the basic idea, we could create a tidy git branch with
> literacy "baked in," thus eliminating the need for the top-level
> literatize script.  One unconventional aspect of the process is that a
> tarball must be created that is then embedded into the executable
> immediately after the executable is linked.  If you have any guidelines or
> suggestions for how best to do this, please advise. First, please kick the
> tires & let us know how it goes.
>

I didn't read the whole paper, but it occurs to me that if this is
something you want, it is easy to do without any source modifications.

For example, you could just do something like:

$ objcopy --add-section=.srccode=screen.tar.gz /usr/bin/screen /usr/bin/screen

Then to extract the source code:

$ objcopy --dump-section=.srccode=screen.tar.gz /usr/bin/screen

The advantage of this method is that you can also set section flags to
make it non-load (so effectively zero impact on load performance or
rss), and it's easy to strip out (--remove-section) if you want to save space.

Just a thought!

Tavis.

-- 
 _o)            $ lynx lock.cmpxchg8b.com
 /\\  _o)  _o)  $ finger taviso@sdf.org
_\_V _( ) _( )  @taviso




reply via email to

[Prev in Thread] Current Thread [Next in Thread]