The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: downing.nick@gmail.com (Nick Downing)
Subject: [TUHS] tool (that wnj wrote?) that reduced the data segment size?
Date: Mon, 30 Nov 2015 16:38:24 +1100	[thread overview]
Message-ID: <CAH1jEzZ1DiiOuRZhSUk-Y75n5sqfxS9pCAgbwmR4C1eQXiy4ZA@mail.gmail.com> (raw)
In-Reply-To: <20151130030702.GF32175@mercury.ccil.org>

Guys I wrote a more modern version of xstr for a project (porting PDP11
utilities and games to a modern compiler for a different embedded system).
How it worked was similar to i18n utilities on a modern system. (I planned
to internationalize later). So what it did was remove any strings bracketed
with _("blah blah") to a strings file and then replace with a 32-bit
integer offset into the file. I had utilities like _printf(long off, ...)
which would access the strings file to get the necessary string and print
it, or just _strdup() which would bring it into memory where the programmer
could use as normal and free when done. What I did next was to have the
linker treat the strings file as a resource and merge it into the
executable, so that with a little trickery the strings could be directly
accessed from flash ROM while not taking any of the precious 64 kbytes RAM
in the program's data space. Happy to dig this up and share.
Nick
On 30/11/2015 2:26 PM, "John Cowan" <cowan at mercury.ccil.org> wrote:

> Charles Anthony scripsit:
>
> > "The Optimizing Compiler Writer's Motto: It is no sin to make a wrong
> > program worse."
>
> It is if the rules for which programs are wrong are essentially beyond
> human comprehension on the fly.  Anyway: "That program has about a
> thousand bugs.  Which would you rather, that we fixed all the bugs or
> that we made it run a thousand times faster?"
>
> --
> John Cowan          http://www.ccil.org/~cowan        cowan at ccil.org
> Heckler: "Go on, Al, tell 'em all you know.  It won't take long."
> Al Smith: "I'll tell 'em all we *both* know.  It won't take any longer."
> _______________________________________________
> TUHS mailing list
> TUHS at minnie.tuhs.org
> https://minnie.tuhs.org/mailman/listinfo/tuhs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20151130/db77d327/attachment.html>


  reply	other threads:[~2015-11-30  5:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-28 23:30 Norman Wilson
2015-11-28 23:38 ` Charles Anthony
2015-11-30  3:07   ` John Cowan
2015-11-30  5:38     ` Nick Downing [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-11-28 14:58 Doug McIlroy
2015-11-27 22:26 Larry McVoy
2015-11-27 23:44 ` Dave Horsfall
2015-11-28  0:03   ` Larry McVoy
2015-11-30  2:45     ` Erik E. Fair

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=CAH1jEzZ1DiiOuRZhSUk-Y75n5sqfxS9pCAgbwmR4C1eQXiy4ZA@mail.gmail.com \
    --to=downing.nick@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).