]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
cris: arch-v10: kgdb: Add '__used' for static variable is_dyn_brkp
authorChen Gang <xili_gchen_5257@hotmail.com>
Wed, 5 Aug 2015 22:34:53 +0000 (00:34 +0200)
committerJesper Nilsson <jespern@axis.com>
Thu, 1 Oct 2015 19:11:14 +0000 (21:11 +0200)
commite2deb8b730fae3a412f659ea33ac698dc81e0579
treebdc3644c54c5f79ee2980ad22ac9a60ef70f50f2
parent854e329bcc474530786442f8cea7f07732886dc1
cris: arch-v10: kgdb: Add '__used' for static variable is_dyn_brkp

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>
Signed-off-by: Jesper Nilsson <jespern@axis.com>
arch/cris/arch-v10/kernel/kgdb.c