From: rusty@rustcorp.com.au (Rusty Russell)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: avoid ARM binutils leaking ELF local symbols
Date: Mon, 14 Jul 2014 19:44:40 +0930 [thread overview]
Message-ID: <87oaws457z.fsf@rustcorp.com.au> (raw)
In-Reply-To: <E1X6HWN-0006io-Od@rmk-PC.arm.linux.org.uk>
Russell King <rmk+kernel@arm.linux.org.uk> writes:
> Symbols starting with .L are ELF local symbols and should not appear
> in ELF symbol tables. However, unfortunately ARM binutils leaks the
> .LANCHOR symbols into the symbol table, which leads kallsyms to report
> these symbols rather than the real name. It is not very useful when
> %pf reports symbols against these leaked .LANCHOR symbols.
>
> Arrange for kallsyms to ignore these symbols using the same mechanism
> that is used for the ARM mapping symbols.
Yech... Applied.
Thanks,
Rusty.
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
> kernel/module.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/kernel/module.c b/kernel/module.c
> index 81e727cf6df9..cecd78d06025 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -3385,6 +3385,8 @@ static inline int within(unsigned long addr, void *start, unsigned long size)
> */
> static inline int is_arm_mapping_symbol(const char *str)
> {
> + if (str[0] == '.' && str[1] == 'L')
> + return true;
> return str[0] == '$' && strchr("atd", str[1])
> && (str[2] == '\0' || str[2] == '.');
> }
> --
> 1.8.3.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
WARNING: multiple messages have this Message-ID (diff)
From: Rusty Russell <rusty@rustcorp.com.au>
To: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ARM: avoid ARM binutils leaking ELF local symbols
Date: Mon, 14 Jul 2014 19:44:40 +0930 [thread overview]
Message-ID: <87oaws457z.fsf@rustcorp.com.au> (raw)
In-Reply-To: <E1X6HWN-0006io-Od@rmk-PC.arm.linux.org.uk>
Russell King <rmk+kernel@arm.linux.org.uk> writes:
> Symbols starting with .L are ELF local symbols and should not appear
> in ELF symbol tables. However, unfortunately ARM binutils leaks the
> .LANCHOR symbols into the symbol table, which leads kallsyms to report
> these symbols rather than the real name. It is not very useful when
> %pf reports symbols against these leaked .LANCHOR symbols.
>
> Arrange for kallsyms to ignore these symbols using the same mechanism
> that is used for the ARM mapping symbols.
Yech... Applied.
Thanks,
Rusty.
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
> kernel/module.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/kernel/module.c b/kernel/module.c
> index 81e727cf6df9..cecd78d06025 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -3385,6 +3385,8 @@ static inline int within(unsigned long addr, void *start, unsigned long size)
> */
> static inline int is_arm_mapping_symbol(const char *str)
> {
> + if (str[0] == '.' && str[1] == 'L')
> + return true;
> return str[0] == '$' && strchr("atd", str[1])
> && (str[2] == '\0' || str[2] == '.');
> }
> --
> 1.8.3.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2014-07-14 10:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-13 11:00 [PATCH] ARM: avoid ARM binutils leaking ELF local symbols Russell King
2014-07-13 11:00 ` Russell King
2014-07-14 10:14 ` Rusty Russell [this message]
2014-07-14 10:14 ` Rusty Russell
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=87oaws457z.fsf@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=linux-arm-kernel@lists.infradead.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.