lkml.org 
[lkml]   [2015]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] cris: arch-v10: kgdb: Add '__used' for static variable is_dyn_brkp
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


\
 
 \ /
  Last update: 2015-10-01 21:41    [W:0.032 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site