All of lore.kernel.org
 help / color / mirror / Atom feed
From: Larry McVoy <lm@bitmover.com>
To: Jon Masters <jonathan@jonmasters.org>
Cc: linux-kernel@vger.kernel.org, jcm@printk.net
Subject: Re: Stripped binary insertion with the GNU Linker suggestions (fwd)
Date: Fri, 11 Jul 2003 08:35:57 -0700	[thread overview]
Message-ID: <20030711153557.GB30378@work.bitmover.com> (raw)
In-Reply-To: <Pine.LNX.4.10.10307111619290.25244-100000@router>

On Fri, Jul 11, 2003 at 04:19:55PM +0100, Jon Masters wrote:
> I have seen other nasty ways to do this involving converting the image to
> byte values in very large arrays or inserting literal byte values in to
> the output file but there just has to be a generic method for inserting
> an image in to the middle of an output file.

No, there isn't, at least I haven't found one.  The BK installer does 
exactly what you want (and you can have the source if you like, BSD 
license) on the platforms listed below.  We had to play some nasty 
games to make this work, I believe it was HP-UX which "knew" that your
array was full of zeros and did not allocate it, it did it at runtime.
Any sort of predictable pattern it figured out, the following fools it
for now:

unsigned char data_data[3866327] = {
        255,
        6,
        1,
        2,
        3,
        4,
        255,
        3,
        9,
        62,
        255,
        10,
        4,
        61,
        255,
};

platforms that this technique works on:

    alpha-glibc22-linux
    alpha-osf5.1
    arm-glibc21-linux
    hppa-glibc22-linux
    hppa-hpux
    ia64-glibc22-linux
    mips-glibc22-linux
    mips-irix
    mipsel-glibc20-linux
    powerpc-aix
    powerpc-darwin6.6
    powerpc-glibc21-linux
    sparc-glibc21-linux
    sparc-solaris
    x86-freebsd2.2.8
    x86-freebsd3.2
    x86-freebsd4.1
    x86-glibc20-linux
    x86-glibc21-linux
    x86-glibc22-linux
    x86-netbsd
    x86-openbsd
    x86-sco3.2v5.0.7
    x86-solaris

-- 
---
Larry McVoy              lm at bitmover.com          http://www.bitmover.com/lm

  reply	other threads:[~2003-07-11 15:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-11 15:19 Stripped binary insertion with the GNU Linker suggestions (fwd) Jon Masters
2003-07-11 15:35 ` Larry McVoy [this message]
2003-07-11 16:00   ` Jon Masters
2003-07-11 16:37     ` Hollis Blanchard
2003-07-12  1:14       ` Jon Masters

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=20030711153557.GB30378@work.bitmover.com \
    --to=lm@bitmover.com \
    --cc=jcm@printk.net \
    --cc=jonathan@jonmasters.org \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.