mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Dave Anderson <anderson@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>,
	linux-kernel@vger.kernel.org, mingo@elte.hu, jstancek@redhat.com
Subject: Re: [PATCH] x86-64: Prevent gcc from optimizing away venosys_1()
Date: Fri, 3 Jun 2011 23:37:13 +0200	[thread overview]
Message-ID: <20110603213713.GO27166@one.firstfloor.org> (raw)
In-Reply-To: <1972495451.7278.1307136726542.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>

On Fri, Jun 03, 2011 at 05:32:06PM -0400, Dave Anderson wrote:
> 
> 
> ----- Original Message -----
> > >  	return 0;
> > >  }
> > >
> > > -static long __vsyscall(3) venosys_1(void)
> > > +long __vsyscall(3) venosys_1(void)
> > 
> > Better add a __used too. Otherwise it can be optimized out again
> > in some builds e.g. when someone enables gc-sections for the linker.
> 
> Considering that all of the vsyscall prototypes have this attribute:
> 
> #define __vsyscall(nr) \
>                 __attribute__ ((unused, __section__(".vsyscall_" #nr))) notrace
> 
> How would any of them work?

unused is just to prevent warnings I think. used stops the optimizer
from throwing it away.

It would make more sense to drop the unused and add an used.  I think
used prevents the warnings too.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

  reply	other threads:[~2011-06-03 21:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <313387488.1201.1307114323524.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>
2011-06-03 15:20 ` Dave Anderson
2011-06-03 20:48   ` Andi Kleen
2011-06-03 21:32     ` Dave Anderson
2011-06-03 21:37       ` Andi Kleen [this message]
2011-06-06 17:22   ` Ingo Molnar

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=20110603213713.GO27166@one.firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=anderson@redhat.com \
    --cc=jstancek@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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®