Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1712836 > unrolled thread

Re: [PATCH -tip v9 3/5] cris: mark _stext and _end as char-arrays, not single char

Started byMasami Hiramatsu <mhiramat@kernel.org>
First post2017-08-16 13:10 +0200
Last post2017-08-18 20:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH -tip v9 3/5] cris: mark _stext and _end as char-arrays,  not single char Masami Hiramatsu <mhiramat@kernel.org> - 2017-08-16 13:10 +0200
    Re: [PATCH -tip v9 3/5] cris: mark _stext and _end as char-arrays,  not single char Jesper Nilsson <jesper.nilsson@axis.com> - 2017-08-18 20:40 +0200

#1712836 — Re: [PATCH -tip v9 3/5] cris: mark _stext and _end as char-arrays, not single char

FromMasami Hiramatsu <mhiramat@kernel.org>
Date2017-08-16 13:10 +0200
SubjectRe: [PATCH -tip v9 3/5] cris: mark _stext and _end as char-arrays, not single char
Message-ID<uf4n0-6hS-23@gated-at.bofh.it>
On Thu,  3 Aug 2017 11:37:15 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> diff --git a/arch/cris/kernel/traps.c b/arch/cris/kernel/traps.c
> index a01636a12a6e..d98131c45bb5 100644
> --- a/arch/cris/kernel/traps.c
> +++ b/arch/cris/kernel/traps.c
> @@ -42,7 +42,7 @@ void (*nmi_handler)(struct pt_regs *);
>  void show_trace(unsigned long *stack)
>  {
>  	unsigned long addr, module_start, module_end;
> -	extern char _stext, _etext;
> +	extern char _stext[], _etext[];
>  	int i;
>  
>  	pr_err("\nCall Trace: ");
> @@ -69,8 +69,8 @@ void show_trace(unsigned long *stack)
>  		 * down the cause of the crash will be able to figure
>  		 * out the call path that was taken.
>  		 */
> -		if (((addr >= (unsigned long)&_stext) &&
> -		     (addr <= (unsigned long)&_etext)) ||
> +		if (((addr >= (unsigned long)_stext) &&
> +		     (addr <= (unsigned long)_etext)) ||
>  		    ((addr >= module_start) && (addr <= module_end))) {

BTW, I would like to ask cris people, this seems to check over 1 byte,
since _etext and module_end will be placed at the next byte of the real
address area.
As same as other arch, Should it be 

(addr < (unsigned long)_etext)

or are there any other reason?

Thank you,


>  #ifdef CONFIG_KALLSYMS
>  			print_ip_sym(addr);
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

[toc] | [next] | [standalone]


#1715369

FromJesper Nilsson <jesper.nilsson@axis.com>
Date2017-08-18 20:40 +0200
Message-ID<ufUlA-7sp-13@gated-at.bofh.it>
In reply to#1712836
On Wed, Aug 16, 2017 at 08:01:33PM +0900, Masami Hiramatsu wrote:
> On Thu,  3 Aug 2017 11:37:15 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
> 
> > diff --git a/arch/cris/kernel/traps.c b/arch/cris/kernel/traps.c
> > index a01636a12a6e..d98131c45bb5 100644
> > --- a/arch/cris/kernel/traps.c
> > +++ b/arch/cris/kernel/traps.c
> > @@ -42,7 +42,7 @@ void (*nmi_handler)(struct pt_regs *);
> >  void show_trace(unsigned long *stack)
> >  {
> >  	unsigned long addr, module_start, module_end;
> > -	extern char _stext, _etext;
> > +	extern char _stext[], _etext[];
> >  	int i;
> >  
> >  	pr_err("\nCall Trace: ");
> > @@ -69,8 +69,8 @@ void show_trace(unsigned long *stack)
> >  		 * down the cause of the crash will be able to figure
> >  		 * out the call path that was taken.
> >  		 */
> > -		if (((addr >= (unsigned long)&_stext) &&
> > -		     (addr <= (unsigned long)&_etext)) ||
> > +		if (((addr >= (unsigned long)_stext) &&
> > +		     (addr <= (unsigned long)_etext)) ||
> >  		    ((addr >= module_start) && (addr <= module_end))) {
> 
> BTW, I would like to ask cris people, this seems to check over 1 byte,
> since _etext and module_end will be placed at the next byte of the real
> address area.
> As same as other arch, Should it be 
> 
> (addr < (unsigned long)_etext)
> 
> or are there any other reason?

As far as I can tell, this is non-intentional.

> Thank you,

> Masami Hiramatsu <mhiramat@kernel.org>

/^JN - Jesper Nilsson
-- 
               Jesper Nilsson -- jesper.nilsson@axis.com

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web