From: Jerry Van Baren <gerald.vanbaren@smiths-aerospace.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] ppc boot: replace string labels with numbers
Date: Thu, 17 Nov 2005 17:54:25 -0500 [thread overview]
Message-ID: <437D0A21.4090803@smiths-aerospace.com> (raw)
In-Reply-To: <20051117210902.GB31775@suse.de>
Olaf Hering wrote:
> Replacing the string labels with numbers saves 117 bytes in the final zImage.
> These local labels are not discared.
>
> Signed-off-by: Olaf Hering <olh@suse.de>
>
> arch/powerpc/boot/crt0.S | 23 +++++++++++------------
> 1 files changed, 11 insertions(+), 12 deletions(-)
>
> Index: linux-2.6.15-rc1-olh/arch/powerpc/boot/crt0.S
> ===================================================================
> --- linux-2.6.15-rc1-olh.orig/arch/powerpc/boot/crt0.S
> +++ linux-2.6.15-rc1-olh/arch/powerpc/boot/crt0.S
> @@ -14,43 +14,42 @@
> .text
> .globl _zimage_start
> _zimage_start:
> - bl reloc_offset
> + bl 1f
>
> -reloc_offset:
> +1:
> mflr r0
> - lis r9,reloc_offset@ha
> - addi r9,r9,reloc_offset@l
> + lis r9,1b@ha
> + addi r9,r9,1b@l
> subf. r0,r9,r0
> - beq clear_caches
> + beq 3f
[snip]
OK, I've waited for someone dumber than me to ask, but I guess I'm the
bottom guy on the totem pole here.
How does changing a local ascii label to a temporary label _but using
the same machine instructions_ affect the output image size???? Why
would "lis r9,reloc_offset@ha" generate a smaller (!) instruction than
"lis r9,1b@ha"????
My first thought was that the symbol section of the ELF output is
bigger, but the labels are not globals. Even if the local labels end up
in the symbol section (which the comment on the original patch message
sort of implies), that isn't going to make a (stripped) binary any
bigger. If that is the case, isn't a better cure to strip the ELF file?
While I'm being dumb, I gotta ask, how big is zImage and why does 117
bytes make a difference?
My 2c: if you are going to use inscrutable labels (1,2,3,4), please put
comments in. At least the previous labels gave hints as to what was
happening.
Puzzled,
gvb
next prev parent reply other threads:[~2005-11-17 23:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-17 21:09 [PATCH] ppc boot: replace string labels with numbers Olaf Hering
2005-11-17 22:54 ` Jerry Van Baren [this message]
2005-11-18 7:42 ` Olaf Hering
2005-11-18 15:30 ` Hollis Blanchard
2005-11-18 22:19 ` Olaf Hering
2005-12-01 21:58 ` Tom Rini
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=437D0A21.4090803@smiths-aerospace.com \
--to=gerald.vanbaren@smiths-aerospace.com \
--cc=linuxppc-dev@ozlabs.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 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).