mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Richard B. Johnson" <root@chaos.analogic.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: Andrew Morton <akpm@zip.com.au>,
	kernel list <linux-kernel@vger.kernel.org>,
	Patrick Mochel <mochel@digitalimplant.org>
Subject: Re: swsusp.S: meaningfull assembly labels
Date: Fri, 25 Jun 2004 13:24:23 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.53.0406251317060.28917@chaos> (raw)
In-Reply-To: <20040625161050.GB30073@elf.ucw.cz>

On Fri, 25 Jun 2004, Pavel Machek wrote:

> Hi!
>
> > > This introduces meaningfull labels instead of .L1234, meaning code is
> > > readable, kills alignment where unneccessary, and kills TLB flush that
> > > was only pure paranoia (and slows it down a lot on emulated
> > > systems). Please apply,
> > >
> > > 								Pavel
> > >
> > > --- linux-cvs//arch/i386/power/swsusp.S	2004-05-25 17:41:18.000000000 +0200
> > > +++ linux/arch/i386/power/swsusp.S	2004-06-24 14:39:01.000000000 +0200
> > > @@ -18,7 +18,7 @@
> > >  ENTRY(do_magic)
> > >  	pushl %ebx
> > >  	cmpl $0,8(%esp)
> > > -	jne .L1450
> > > +	jne resume
> > >  	call do_magic_suspend_1
> > >  	call save_processor_state
> > >
> ...
> > NO! You just made those labels public! The LOCAL symbols need to
> > begin with ".L".  Now, if you have a 'copy_loop' in another module,
> > linked with this, anywhere in the kernel, they will share the
> > same address -- not what you expected, I'm sure! The assembler
> > has some strange rules you need to understand. Use `nm` and you
> > will find that your new labels are in the object file!
>
> Are you sure? I thought theare not visible from other moduless unless
> "ENTRY()" is used.  See for example entry.S.
> 							Pavel

Well if you find a way to make those symbols disappear from the
object files without using ".L", please let me know. I spent
some considerable time beautifying multiple assembly-language
files on a recent project, only to find that it would fail to
link because of the "multiple symbol definition" errors. I
had to change everything back.

You can make labels like ".Lresume:" remain visible only in
the file. They don't need to be numbers. It may even be possible
to use labels like ".L_resume:", I haven't tried. Basically, if
they show up using `nm`, they can (read will) give you problems.


Cheers,
Dick Johnson
Penguin : Linux version 2.4.26 on an i686 machine (5570.56 BogoMips).
            Note 96.31% of all statistics are fiction.



      reply	other threads:[~2004-06-25 17:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-25 11:59 Pavel Machek
2004-06-25 12:37 ` Richard B. Johnson
2004-06-25 15:18   ` Daniel Jacobowitz
2004-06-25 16:02     ` Richard B. Johnson
2004-06-25 18:48       ` Daniel Jacobowitz
2004-06-25 19:29         ` Richard B. Johnson
2004-06-25 19:39           ` Patrick Mochel
2004-06-25 16:10   ` Pavel Machek
2004-06-25 17:24     ` Richard B. Johnson [this message]

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=Pine.LNX.4.53.0406251317060.28917@chaos \
    --to=root@chaos.analogic.com \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@digitalimplant.org \
    --cc=pavel@ucw.cz \
    /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

all inboxes | Powered by JetHome®