* [PATCH] kallsyms: reduce size a little on 64-bit
@ 2018-08-28 15:00 Jan Beulich
2018-09-02 17:12 ` Masahiro Yamada
2018-09-03 12:09 ` [PATCH v2] " Jan Beulich
0 siblings, 2 replies; 5+ messages in thread
From: Jan Beulich @ 2018-08-28 15:00 UTC (permalink / raw)
To: linux-kbuild; +Cc: Michal Marek, Masahiro Yamada
Both kallsyms_num_syms and kallsyms_markers[] don't really need to use
unsigned long as their (base) types; unsigned int fully suffices.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
kernel/kallsyms.c | 4 ++--
scripts/kallsyms.c | 6 ++++--
2 files changed, 6 insertions(+), 4 deletions(-)
--- 4.19-rc1/kernel/kallsyms.c
+++ 4.19-rc1-kallsyms-reduce-size/kernel/kallsyms.c
@@ -37,7 +37,7 @@ extern const u8 kallsyms_names[] __weak;
* Tell the compiler that the count isn't in the small data section if the arch
* has one (eg: FRV).
*/
-extern const unsigned long kallsyms_num_syms
+extern const unsigned int kallsyms_num_syms
__attribute__((weak, section(".rodata")));
extern const unsigned long kallsyms_relative_base
@@ -46,7 +46,7 @@ __attribute__((weak, section(".rodata"))
extern const u8 kallsyms_token_table[] __weak;
extern const u16 kallsyms_token_index[] __weak;
-extern const unsigned long kallsyms_markers[] __weak;
+extern const unsigned int kallsyms_markers[] __weak;
/*
* Expand a compressed symbol data into the resulting uncompressed string,
--- 4.19-rc1/scripts/kallsyms.c
+++ 4.19-rc1-kallsyms-reduce-size/scripts/kallsyms.c
@@ -182,6 +182,8 @@ static int symbol_in_range(struct sym_en
for (i = 0; i < entries; ++i) {
ar = &ranges[i];
+ if (!ar->end)
+ continue;
if (s->addr >= ar->start && s->addr <= ar->end)
return 1;
}
@@ -405,7 +407,7 @@ static void write_src(void)
}
output_label("kallsyms_num_syms");
- printf("\tPTR\t%u\n", table_cnt);
+ printf("\t.long\t%u\n", table_cnt);
printf("\n");
/* table of offset markers, that give the offset in the compressed stream
@@ -434,7 +436,7 @@ static void write_src(void)
output_label("kallsyms_markers");
for (i = 0; i < ((table_cnt + 255) >> 8); i++)
- printf("\tPTR\t%d\n", markers[i]);
+ printf("\t.long\t%u\n", markers[i]);
printf("\n");
free(markers);
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kallsyms: reduce size a little on 64-bit
2018-08-28 15:00 [PATCH] kallsyms: reduce size a little on 64-bit Jan Beulich
@ 2018-09-02 17:12 ` Masahiro Yamada
2018-09-03 11:24 ` Jan Beulich
2018-09-03 12:09 ` [PATCH v2] " Jan Beulich
1 sibling, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2018-09-02 17:12 UTC (permalink / raw)
To: Jan Beulich; +Cc: Linux Kbuild mailing list, Michal Marek
Hi.
2018-08-29 0:00 GMT+09:00 Jan Beulich <JBeulich@suse.com>:
> Both kallsyms_num_syms and kallsyms_markers[] don't really need to use
> unsigned long as their (base) types; unsigned int fully suffices.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> --- 4.19-rc1/scripts/kallsyms.c
> +++ 4.19-rc1-kallsyms-reduce-size/scripts/kallsyms.c
> @@ -182,6 +182,8 @@ static int symbol_in_range(struct sym_en
> for (i = 0; i < entries; ++i) {
> ar = &ranges[i];
>
> + if (!ar->end)
> + continue;
> if (s->addr >= ar->start && s->addr <= ar->end)
> return 1;
> }
What is this hunk doing?
At least, I cannot understand it from the patch description.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kallsyms: reduce size a little on 64-bit
2018-09-02 17:12 ` Masahiro Yamada
@ 2018-09-03 11:24 ` Jan Beulich
0 siblings, 0 replies; 5+ messages in thread
From: Jan Beulich @ 2018-09-03 11:24 UTC (permalink / raw)
To: Masahiro Yamada; +Cc: Michal Marek, linux-kbuild
>>> On 02.09.18 at 19:12, <yamada.masahiro@socionext.com> wrote:
> 2018-08-29 0:00 GMT+09:00 Jan Beulich <JBeulich@suse.com>:
>> --- 4.19-rc1/scripts/kallsyms.c
>> +++ 4.19-rc1-kallsyms-reduce-size/scripts/kallsyms.c
>> @@ -182,6 +182,8 @@ static int symbol_in_range(struct sym_en
>> for (i = 0; i < entries; ++i) {
>> ar = &ranges[i];
>>
>> + if (!ar->end)
>> + continue;
>> if (s->addr >= ar->start && s->addr <= ar->end)
>> return 1;
>> }
>
>
> What is this hunk doing?
>
> At least, I cannot understand it from the patch description.
Hmm, I agree, it looks like it is addressing an unrelated issue. I'll
re-submit with it dropped. The patch here dates back many
years, so I suppose I noticed this other issue at the same time,
but then forgot to split out the extra change.
Jan
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] kallsyms: reduce size a little on 64-bit
2018-08-28 15:00 [PATCH] kallsyms: reduce size a little on 64-bit Jan Beulich
2018-09-02 17:12 ` Masahiro Yamada
@ 2018-09-03 12:09 ` Jan Beulich
2018-09-04 0:33 ` Masahiro Yamada
1 sibling, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2018-09-03 12:09 UTC (permalink / raw)
To: linux-kbuild; +Cc: Michal Marek, Masahiro Yamada
Both kallsyms_num_syms and kallsyms_markers[] don't really need to use
unsigned long as their (base) types; unsigned int fully suffices.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: Drop unrelated hunk.
---
kernel/kallsyms.c | 4 ++--
scripts/kallsyms.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
--- 4.19-rc2/kernel/kallsyms.c
+++ 4.19-rc2-kallsyms-reduce-size/kernel/kallsyms.c
@@ -37,7 +37,7 @@ extern const u8 kallsyms_names[] __weak;
* Tell the compiler that the count isn't in the small data section if the arch
* has one (eg: FRV).
*/
-extern const unsigned long kallsyms_num_syms
+extern const unsigned int kallsyms_num_syms
__attribute__((weak, section(".rodata")));
extern const unsigned long kallsyms_relative_base
@@ -46,7 +46,7 @@ __attribute__((weak, section(".rodata"))
extern const u8 kallsyms_token_table[] __weak;
extern const u16 kallsyms_token_index[] __weak;
-extern const unsigned long kallsyms_markers[] __weak;
+extern const unsigned int kallsyms_markers[] __weak;
/*
* Expand a compressed symbol data into the resulting uncompressed string,
--- 4.19-rc2/scripts/kallsyms.c
+++ 4.19-rc2-kallsyms-reduce-size/scripts/kallsyms.c
@@ -405,7 +405,7 @@ static void write_src(void)
}
output_label("kallsyms_num_syms");
- printf("\tPTR\t%u\n", table_cnt);
+ printf("\t.long\t%u\n", table_cnt);
printf("\n");
/* table of offset markers, that give the offset in the compressed stream
@@ -434,7 +434,7 @@ static void write_src(void)
output_label("kallsyms_markers");
for (i = 0; i < ((table_cnt + 255) >> 8); i++)
- printf("\tPTR\t%d\n", markers[i]);
+ printf("\t.long\t%u\n", markers[i]);
printf("\n");
free(markers);
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] kallsyms: reduce size a little on 64-bit
2018-09-03 12:09 ` [PATCH v2] " Jan Beulich
@ 2018-09-04 0:33 ` Masahiro Yamada
0 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2018-09-04 0:33 UTC (permalink / raw)
To: Jan Beulich; +Cc: Linux Kbuild mailing list, Michal Marek
2018-09-03 21:09 GMT+09:00 Jan Beulich <JBeulich@suse.com>:
> Both kallsyms_num_syms and kallsyms_markers[] don't really need to use
> unsigned long as their (base) types; unsigned int fully suffices.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> v2: Drop unrelated hunk.
> ---
Applied to linux-kbuild/fixes. Thanks!
> kernel/kallsyms.c | 4 ++--
> scripts/kallsyms.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> --- 4.19-rc2/kernel/kallsyms.c
> +++ 4.19-rc2-kallsyms-reduce-size/kernel/kallsyms.c
> @@ -37,7 +37,7 @@ extern const u8 kallsyms_names[] __weak;
> * Tell the compiler that the count isn't in the small data section if the arch
> * has one (eg: FRV).
> */
> -extern const unsigned long kallsyms_num_syms
> +extern const unsigned int kallsyms_num_syms
> __attribute__((weak, section(".rodata")));
>
> extern const unsigned long kallsyms_relative_base
> @@ -46,7 +46,7 @@ __attribute__((weak, section(".rodata"))
> extern const u8 kallsyms_token_table[] __weak;
> extern const u16 kallsyms_token_index[] __weak;
>
> -extern const unsigned long kallsyms_markers[] __weak;
> +extern const unsigned int kallsyms_markers[] __weak;
>
> /*
> * Expand a compressed symbol data into the resulting uncompressed string,
> --- 4.19-rc2/scripts/kallsyms.c
> +++ 4.19-rc2-kallsyms-reduce-size/scripts/kallsyms.c
> @@ -405,7 +405,7 @@ static void write_src(void)
> }
>
> output_label("kallsyms_num_syms");
> - printf("\tPTR\t%u\n", table_cnt);
> + printf("\t.long\t%u\n", table_cnt);
> printf("\n");
>
> /* table of offset markers, that give the offset in the compressed stream
> @@ -434,7 +434,7 @@ static void write_src(void)
>
> output_label("kallsyms_markers");
> for (i = 0; i < ((table_cnt + 255) >> 8); i++)
> - printf("\tPTR\t%d\n", markers[i]);
> + printf("\t.long\t%u\n", markers[i]);
> printf("\n");
>
> free(markers);
>
>
>
>
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-09-04 4:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-28 15:00 [PATCH] kallsyms: reduce size a little on 64-bit Jan Beulich
2018-09-02 17:12 ` Masahiro Yamada
2018-09-03 11:24 ` Jan Beulich
2018-09-03 12:09 ` [PATCH v2] " Jan Beulich
2018-09-04 0:33 ` Masahiro Yamada
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.