From: Jesper Nilsson <jesper.nilsson@axis.com>
To: Chen Gang <xili_gchen_5257@hotmail.com>
Cc: Mikael Starvik <starvik@axis.com>,
Jesper Nilsson <jespern@axis.com>,
Hans-Peter Nilsson <hp@axis.com>,
linux-cris-kernel <linux-cris-kernel@axis.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] cris: arch-v10: kgdb: Add '__used' for static variable is_dyn_brkp
Date: Thu, 1 Oct 2015 21:15:03 +0200 [thread overview]
Message-ID: <20151001191502.GF4919@axis.com> (raw)
In-Reply-To: <BLU436-SMTP22033C06ED5A4C4C3692E02B9750@phx.gbl>
On Thu, Aug 06, 2015 at 12:34:53AM +0200, Chen Gang wrote:
> Within one C file, current gcc can optimize the global static variables
> according to the C code, but it will skip assembly code -- it will pass
> them to gas directly.
>
> if the static variable is used between C code and assembly code in one C
> file (e.g. is_dyn_brkp in kgdb.c), it needs '__used' to let gcc know it
> should be still used, or gcc may remove it for optimization.
>
> The related error in this case:
>
> LD init/built-in.o
> arch/cris/arch-v10/kernel/built-in.o: In function `kgdb_handle_breakpoint':
> (.text+0x2aca): undefined reference to `is_dyn_brkp'
> arch/cris/arch-v10/kernel/built-in.o: In function `is_static':
> kgdb.c:(.text+0x2ada): undefined reference to `is_dyn_brkp'
>
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Added to the cris tree, thanks!
/^JN - Jesper Nilsson
--
Jesper Nilsson -- jesper.nilsson@axis.com
prev parent reply other threads:[~2015-10-01 19:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-05 22:34 [PATCH v3] cris: arch-v10: kgdb: Add '__used' for static variable is_dyn_brkp Chen Gang
2015-10-01 19:15 ` Jesper Nilsson [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=20151001191502.GF4919@axis.com \
--to=jesper.nilsson@axis.com \
--cc=hp@axis.com \
--cc=jespern@axis.com \
--cc=linux-cris-kernel@axis.com \
--cc=linux-kernel@vger.kernel.org \
--cc=starvik@axis.com \
--cc=xili_gchen_5257@hotmail.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 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.