All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shaoying Xu <shaoyi@amazon.com>
To: <catalin.marinas@arm.com>, <will@kernel.org>
Cc: benh@amazon.com, fllinden@amazon.com,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, shaoyi@amazon.com
Subject: Re: [PATCH] arm64 module: set plt* section addresses to 0x0
Date: Tue, 16 Feb 2021 18:38:08 +0000	[thread overview]
Message-ID: <20210216183808.GA24095@amazon.com> (raw)
In-Reply-To: <20210216183234.GA23876@amazon.com>

So sorry about the double send because I forgot to cc the lists. Please just
ignore the first one. Thank you! 

On Tue, Feb 16, 2021 at 06:32:34PM +0000, Shaoying Xu wrote:
> These plt* and .text.ftrace_trampoline sections specified for arm64 have 
> non-zero addressses. Non-zero section addresses in a relocatable ELF would 
> confuse GDB when it tries to compute the section offsets and it ends up 
> printing wrong symbol addresses. Therefore, set them to zero, which mirrors 
> the change in commit 5d8591bc0fba ("module: set ksymtab/kcrctab* section 
> addresses to 0x0").
> 
> Reported-by: Frank van der Linden <fllinden@amazon.com>
> Signed-off-by: Shaoying Xu <shaoyi@amazon.com>
> Cc: stable@vger.kernel.org
> ---
>  arch/arm64/include/asm/module.lds.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/module.lds.h b/arch/arm64/include/asm/module.lds.h
> index 691f15af788e..810045628c66 100644
> --- a/arch/arm64/include/asm/module.lds.h
> +++ b/arch/arm64/include/asm/module.lds.h
> @@ -1,7 +1,7 @@
>  #ifdef CONFIG_ARM64_MODULE_PLTS
>  SECTIONS {
> -	.plt (NOLOAD) : { BYTE(0) }
> -	.init.plt (NOLOAD) : { BYTE(0) }
> -	.text.ftrace_trampoline (NOLOAD) : { BYTE(0) }
> +	.plt 0 (NOLOAD) : { BYTE(0) }
> +	.init.plt 0 (NOLOAD) : { BYTE(0) }
> +	.text.ftrace_trampoline 0 (NOLOAD) : { BYTE(0) }
>  }
>  #endif
> -- 
> 2.16.6
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Shaoying Xu <shaoyi@amazon.com>
To: <catalin.marinas@arm.com>, <will@kernel.org>
Cc: <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <fllinden@amazon.com>,
	<benh@amazon.com>, <shaoyi@amazon.com>
Subject: Re: [PATCH] arm64 module: set plt* section addresses to 0x0
Date: Tue, 16 Feb 2021 18:38:08 +0000	[thread overview]
Message-ID: <20210216183808.GA24095@amazon.com> (raw)
In-Reply-To: <20210216183234.GA23876@amazon.com>

So sorry about the double send because I forgot to cc the lists. Please just
ignore the first one. Thank you! 

On Tue, Feb 16, 2021 at 06:32:34PM +0000, Shaoying Xu wrote:
> These plt* and .text.ftrace_trampoline sections specified for arm64 have 
> non-zero addressses. Non-zero section addresses in a relocatable ELF would 
> confuse GDB when it tries to compute the section offsets and it ends up 
> printing wrong symbol addresses. Therefore, set them to zero, which mirrors 
> the change in commit 5d8591bc0fba ("module: set ksymtab/kcrctab* section 
> addresses to 0x0").
> 
> Reported-by: Frank van der Linden <fllinden@amazon.com>
> Signed-off-by: Shaoying Xu <shaoyi@amazon.com>
> Cc: stable@vger.kernel.org
> ---
>  arch/arm64/include/asm/module.lds.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/module.lds.h b/arch/arm64/include/asm/module.lds.h
> index 691f15af788e..810045628c66 100644
> --- a/arch/arm64/include/asm/module.lds.h
> +++ b/arch/arm64/include/asm/module.lds.h
> @@ -1,7 +1,7 @@
>  #ifdef CONFIG_ARM64_MODULE_PLTS
>  SECTIONS {
> -	.plt (NOLOAD) : { BYTE(0) }
> -	.init.plt (NOLOAD) : { BYTE(0) }
> -	.text.ftrace_trampoline (NOLOAD) : { BYTE(0) }
> +	.plt 0 (NOLOAD) : { BYTE(0) }
> +	.init.plt 0 (NOLOAD) : { BYTE(0) }
> +	.text.ftrace_trampoline 0 (NOLOAD) : { BYTE(0) }
>  }
>  #endif
> -- 
> 2.16.6
> 

  reply	other threads:[~2021-02-16 18:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16 18:32 [PATCH] arm64 module: set plt* section addresses to 0x0 Shaoying Xu
2021-02-16 18:32 ` Shaoying Xu
2021-02-16 18:38 ` Shaoying Xu [this message]
2021-02-16 18:38   ` Shaoying Xu
2021-02-19 19:16 ` Will Deacon
2021-02-19 19:16   ` Will Deacon
  -- strict thread matches above, loose matches on Subject: below --
2021-02-16 17:43 Shaoying Xu

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=20210216183808.GA24095@amazon.com \
    --to=shaoyi@amazon.com \
    --cc=benh@amazon.com \
    --cc=catalin.marinas@arm.com \
    --cc=fllinden@amazon.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=will@kernel.org \
    /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.