* [PATCH 0/2] Kbuild: kallsyms: update suffix ignore logic
@ 2015-03-30 13:20 Ard Biesheuvel
2015-03-30 13:20 ` [PATCH 1/2] Kbuild: kallsyms: ignore veneers emitted by the ARM linker Ard Biesheuvel
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Ard Biesheuvel @ 2015-03-30 13:20 UTC (permalink / raw)
To: linux-kbuild, linux-kernel, linux-arm-kernel, arnd, mmarek, linux
Cc: Ard Biesheuvel
Two patches that update the kallsyms ignore logic.
Patch #1 adds logic to introduce symbols whose names end in (or equal)
"_veneer". This prevent kallsyms generation errors on large ARM kernels
where the emitted veneers will be different between the first and second
pass, due to the fact that the size of the kallsyms region itself pushes
the .text and .init.text sections further apart during the second pass.
Patch #2 removes the handling of the "gcc[0-9]_compiled." symbol. It was
only ever emitted by GCC v2.x which we don't support anymore anyway.
This series is a followup to ' [RFC PATCH 0/2] ARM large kernels'
(http://thread.gmane.org/gmane.linux.kbuild.devel/13065), but the
other issue addressed by patch #2 of that series will be deferred
for now.
Ard Biesheuvel (2):
Kbuild: kallsyms: ignore veneers emitted by the ARM linker
Kbuild: kallsyms: drop special handling of pre-3.0 GCC symbols
scripts/kallsyms.c | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
--
1.8.3.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] Kbuild: kallsyms: ignore veneers emitted by the ARM linker
2015-03-30 13:20 [PATCH 0/2] Kbuild: kallsyms: update suffix ignore logic Ard Biesheuvel
@ 2015-03-30 13:20 ` Ard Biesheuvel
2015-03-30 13:20 ` [PATCH 2/2] Kbuild: kallsyms: drop special handling of pre-3.0 GCC symbols Ard Biesheuvel
2015-04-07 9:02 ` [PATCH 0/2] Kbuild: kallsyms: update suffix ignore logic Ard Biesheuvel
2 siblings, 0 replies; 5+ messages in thread
From: Ard Biesheuvel @ 2015-03-30 13:20 UTC (permalink / raw)
To: linux-kbuild, linux-kernel, linux-arm-kernel, arnd, mmarek, linux
Cc: Ard Biesheuvel
When linking large kernels on ARM, the linker will insert veneers
(i.e., PLT like stubs) when function symbols are out of reach for
the ordinary relative branch/branch-and-link instructions.
However, due to the fact that the kallsyms region sits in .rodata,
which is between .text and .init.text, additional veneers may be
emitted in the second pass due to the fact that the size of the
kallsyms region itself has pushed the .init.text section further
apart, requiring even more veneers.
So ignore the veneers when generating the symbol table. Veneers
have no corresponding source code, and they will not turn up in
backtraces anyway.
This patch also lightly refactors the symbol_valid() function
to use a local 'sym_name' rather than the obfuscated 'sym + 1'
and 'sym + offset'
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
scripts/kallsyms.c | 30 +++++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index c6d33bd15b04..f4b016782f0d 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -212,15 +212,23 @@ static int symbol_valid(struct sym_entry *s)
"_SDA_BASE_", /* ppc */
"_SDA2_BASE_", /* ppc */
NULL };
+
+ static char *special_suffixes[] = {
+ "_compiled.", /* gcc < 3.0: "gcc[0-9]_compiled." */
+ "_veneer", /* arm */
+ NULL };
+
int i;
- int offset = 1;
+ char *sym_name = (char *)s->sym + 1;
+
if (s->addr < kernel_start_addr)
return 0;
/* skip prefix char */
- if (symbol_prefix_char && *(s->sym + 1) == symbol_prefix_char)
- offset++;
+ if (symbol_prefix_char && *sym_name == symbol_prefix_char)
+ sym_name++;
+
/* if --all-symbols is not specified, then symbols outside the text
* and inittext sections are discarded */
@@ -235,22 +243,26 @@ static int symbol_valid(struct sym_entry *s)
* rules.
*/
if ((s->addr == text_range_text->end &&
- strcmp((char *)s->sym + offset,
+ strcmp(sym_name,
text_range_text->end_sym)) ||
(s->addr == text_range_inittext->end &&
- strcmp((char *)s->sym + offset,
+ strcmp(sym_name,
text_range_inittext->end_sym)))
return 0;
}
/* Exclude symbols which vary between passes. */
- if (strstr((char *)s->sym + offset, "_compiled."))
- return 0;
-
for (i = 0; special_symbols[i]; i++)
- if( strcmp((char *)s->sym + offset, special_symbols[i]) == 0 )
+ if (strcmp(sym_name, special_symbols[i]) == 0)
return 0;
+ for (i = 0; special_suffixes[i]; i++) {
+ int l = strlen(sym_name) - strlen(special_suffixes[i]);
+
+ if (l >= 0 && strcmp(sym_name + l, special_suffixes[i]) == 0)
+ return 0;
+ }
+
return 1;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] Kbuild: kallsyms: drop special handling of pre-3.0 GCC symbols
2015-03-30 13:20 [PATCH 0/2] Kbuild: kallsyms: update suffix ignore logic Ard Biesheuvel
2015-03-30 13:20 ` [PATCH 1/2] Kbuild: kallsyms: ignore veneers emitted by the ARM linker Ard Biesheuvel
@ 2015-03-30 13:20 ` Ard Biesheuvel
2015-04-07 9:02 ` [PATCH 0/2] Kbuild: kallsyms: update suffix ignore logic Ard Biesheuvel
2 siblings, 0 replies; 5+ messages in thread
From: Ard Biesheuvel @ 2015-03-30 13:20 UTC (permalink / raw)
To: linux-kbuild, linux-kernel, linux-arm-kernel, arnd, mmarek, linux
Cc: Ard Biesheuvel
Since we have required at least GCC v3.2 for some time now, we
can drop the special handling of the 'gcc[0-9]_compiled.' label
which is not emitted anymore since GCC v3.0.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
scripts/kallsyms.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index f4b016782f0d..8fa81e84e295 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -214,7 +214,6 @@ static int symbol_valid(struct sym_entry *s)
NULL };
static char *special_suffixes[] = {
- "_compiled.", /* gcc < 3.0: "gcc[0-9]_compiled." */
"_veneer", /* arm */
NULL };
--
1.8.3.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] Kbuild: kallsyms: update suffix ignore logic
2015-03-30 13:20 [PATCH 0/2] Kbuild: kallsyms: update suffix ignore logic Ard Biesheuvel
2015-03-30 13:20 ` [PATCH 1/2] Kbuild: kallsyms: ignore veneers emitted by the ARM linker Ard Biesheuvel
2015-03-30 13:20 ` [PATCH 2/2] Kbuild: kallsyms: drop special handling of pre-3.0 GCC symbols Ard Biesheuvel
@ 2015-04-07 9:02 ` Ard Biesheuvel
2015-04-07 11:19 ` Michal Marek
2 siblings, 1 reply; 5+ messages in thread
From: Ard Biesheuvel @ 2015-04-07 9:02 UTC (permalink / raw)
To: linux-kbuild, linux-kernel, linux-arm-kernel, Arnd Bergmann,
Michal Marek, Russell King - ARM Linux
Cc: Ard Biesheuvel
On 30 March 2015 at 15:20, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> Two patches that update the kallsyms ignore logic.
>
> Patch #1 adds logic to introduce symbols whose names end in (or equal)
> "_veneer". This prevent kallsyms generation errors on large ARM kernels
> where the emitted veneers will be different between the first and second
> pass, due to the fact that the size of the kallsyms region itself pushes
> the .text and .init.text sections further apart during the second pass.
>
> Patch #2 removes the handling of the "gcc[0-9]_compiled." symbol. It was
> only ever emitted by GCC v2.x which we don't support anymore anyway.
>
> This series is a followup to ' [RFC PATCH 0/2] ARM large kernels'
> (http://thread.gmane.org/gmane.linux.kbuild.devel/13065), but the
> other issue addressed by patch #2 of that series will be deferred
> for now.
>
> Ard Biesheuvel (2):
> Kbuild: kallsyms: ignore veneers emitted by the ARM linker
> Kbuild: kallsyms: drop special handling of pre-3.0 GCC symbols
>
> scripts/kallsyms.c | 29 ++++++++++++++++++++---------
> 1 file changed, 20 insertions(+), 9 deletions(-)
>
Ping?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] Kbuild: kallsyms: update suffix ignore logic
2015-04-07 9:02 ` [PATCH 0/2] Kbuild: kallsyms: update suffix ignore logic Ard Biesheuvel
@ 2015-04-07 11:19 ` Michal Marek
0 siblings, 0 replies; 5+ messages in thread
From: Michal Marek @ 2015-04-07 11:19 UTC (permalink / raw)
To: Ard Biesheuvel, linux-kbuild, linux-kernel, linux-arm-kernel,
Arnd Bergmann, Russell King - ARM Linux
Dne 7.4.2015 v 11:02 Ard Biesheuvel napsal(a):
> On 30 March 2015 at 15:20, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>> Two patches that update the kallsyms ignore logic.
>>
>> Patch #1 adds logic to introduce symbols whose names end in (or equal)
>> "_veneer". This prevent kallsyms generation errors on large ARM kernels
>> where the emitted veneers will be different between the first and second
>> pass, due to the fact that the size of the kallsyms region itself pushes
>> the .text and .init.text sections further apart during the second pass.
>>
>> Patch #2 removes the handling of the "gcc[0-9]_compiled." symbol. It was
>> only ever emitted by GCC v2.x which we don't support anymore anyway.
>>
>> This series is a followup to ' [RFC PATCH 0/2] ARM large kernels'
>> (http://thread.gmane.org/gmane.linux.kbuild.devel/13065), but the
>> other issue addressed by patch #2 of that series will be deferred
>> for now.
>>
>> Ard Biesheuvel (2):
>> Kbuild: kallsyms: ignore veneers emitted by the ARM linker
>> Kbuild: kallsyms: drop special handling of pre-3.0 GCC symbols
>>
>> scripts/kallsyms.c | 29 ++++++++++++++++++++---------
>> 1 file changed, 20 insertions(+), 9 deletions(-)
>>
>
> Ping?
Applied to kbuild.git#kbuild.
Michal
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-04-07 11:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-30 13:20 [PATCH 0/2] Kbuild: kallsyms: update suffix ignore logic Ard Biesheuvel
2015-03-30 13:20 ` [PATCH 1/2] Kbuild: kallsyms: ignore veneers emitted by the ARM linker Ard Biesheuvel
2015-03-30 13:20 ` [PATCH 2/2] Kbuild: kallsyms: drop special handling of pre-3.0 GCC symbols Ard Biesheuvel
2015-04-07 9:02 ` [PATCH 0/2] Kbuild: kallsyms: update suffix ignore logic Ard Biesheuvel
2015-04-07 11:19 ` Michal Marek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).