* [PATCH] Handle non ABS crc symbols
@ 2013-08-09 19:45 Andi Kleen
2013-08-13 20:02 ` Michal Marek
0 siblings, 1 reply; 3+ messages in thread
From: Andi Kleen @ 2013-08-09 19:45 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, linux-kbuild, Andi Kleen
From: Andi Kleen <ak@linux.intel.com>
For some reason I managed to trick gcc into create CRC symbols that
are not absolute anymore, but weak.
Make modpost handle this case.
Andrew, this should fix the bizarre warning. Seems like a toolchain
bug to me.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
scripts/mod/modpost.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 6216434..b3dd735 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -599,18 +599,17 @@ static void handle_modversions(struct module *mod, struct elf_info *info,
else
export = export_from_sec(info, get_secindex(info, sym));
+ /* CRC'd symbol */
+ if (strncmp(symname, CRC_PFX, strlen(CRC_PFX)) == 0) {
+ crc = (unsigned int) sym->st_value;
+ sym_update_crc(symname + strlen(CRC_PFX), mod, crc,
+ export);
+ }
+
switch (sym->st_shndx) {
case SHN_COMMON:
warn("\"%s\" [%s] is COMMON symbol\n", symname, mod->name);
break;
- case SHN_ABS:
- /* CRC'd symbol */
- if (strncmp(symname, CRC_PFX, strlen(CRC_PFX)) == 0) {
- crc = (unsigned int) sym->st_value;
- sym_update_crc(symname + strlen(CRC_PFX), mod, crc,
- export);
- }
- break;
case SHN_UNDEF:
/* undefined symbol */
if (ELF_ST_BIND(sym->st_info) != STB_GLOBAL &&
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Handle non ABS crc symbols
2013-08-09 19:45 [PATCH] Handle non ABS crc symbols Andi Kleen
@ 2013-08-13 20:02 ` Michal Marek
2013-08-14 1:46 ` Rusty Russell
0 siblings, 1 reply; 3+ messages in thread
From: Michal Marek @ 2013-08-13 20:02 UTC (permalink / raw)
To: Andi Kleen; +Cc: akpm, linux-kernel, linux-kbuild, Andi Kleen, Rusty Russell
Added Rusty to CC.
Dne 9.8.2013 21:45, Andi Kleen napsal(a):
> From: Andi Kleen <ak@linux.intel.com>
>
> For some reason I managed to trick gcc into create CRC symbols that
> are not absolute anymore, but weak.
>
> Make modpost handle this case.
>
> Andrew, this should fix the bizarre warning. Seems like a toolchain
> bug to me.
>
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
> scripts/mod/modpost.c | 15 +++++++--------
> 1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index 6216434..b3dd735 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -599,18 +599,17 @@ static void handle_modversions(struct module *mod, struct elf_info *info,
> else
> export = export_from_sec(info, get_secindex(info, sym));
>
> + /* CRC'd symbol */
> + if (strncmp(symname, CRC_PFX, strlen(CRC_PFX)) == 0) {
> + crc = (unsigned int) sym->st_value;
> + sym_update_crc(symname + strlen(CRC_PFX), mod, crc,
> + export);
> + }
> +
> switch (sym->st_shndx) {
> case SHN_COMMON:
> warn("\"%s\" [%s] is COMMON symbol\n", symname, mod->name);
> break;
> - case SHN_ABS:
> - /* CRC'd symbol */
> - if (strncmp(symname, CRC_PFX, strlen(CRC_PFX)) == 0) {
> - crc = (unsigned int) sym->st_value;
> - sym_update_crc(symname + strlen(CRC_PFX), mod, crc,
> - export);
> - }
> - break;
> case SHN_UNDEF:
> /* undefined symbol */
> if (ELF_ST_BIND(sym->st_info) != STB_GLOBAL &&
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Handle non ABS crc symbols
2013-08-13 20:02 ` Michal Marek
@ 2013-08-14 1:46 ` Rusty Russell
0 siblings, 0 replies; 3+ messages in thread
From: Rusty Russell @ 2013-08-14 1:46 UTC (permalink / raw)
To: Michal Marek, Andi Kleen
Cc: akpm, linux-kernel, linux-kbuild, Andi Kleen, anton
Michal Marek <mmarek@suse.cz> writes:
> Added Rusty to CC.
>
> Dne 9.8.2013 21:45, Andi Kleen napsal(a):
>> From: Andi Kleen <ak@linux.intel.com>
>>
>> For some reason I managed to trick gcc into create CRC symbols that
>> are not absolute anymore, but weak.
>>
>> Make modpost handle this case.
>>
>> Andrew, this should fix the bizarre warning. Seems like a toolchain
>> bug to me.
>>
>> Signed-off-by: Andi Kleen <ak@linux.intel.com>
Do you also end up with relocated CRCs, like ppc does?
See ARCH_RELOCATES_KCRCTAB in kernel/module.c.
Cheers,
Rusty.
>> ---
>> scripts/mod/modpost.c | 15 +++++++--------
>> 1 file changed, 7 insertions(+), 8 deletions(-)
>>
>> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
>> index 6216434..b3dd735 100644
>> --- a/scripts/mod/modpost.c
>> +++ b/scripts/mod/modpost.c
>> @@ -599,18 +599,17 @@ static void handle_modversions(struct module *mod, struct elf_info *info,
>> else
>> export = export_from_sec(info, get_secindex(info, sym));
>>
>> + /* CRC'd symbol */
>> + if (strncmp(symname, CRC_PFX, strlen(CRC_PFX)) == 0) {
>> + crc = (unsigned int) sym->st_value;
>> + sym_update_crc(symname + strlen(CRC_PFX), mod, crc,
>> + export);
>> + }
>> +
>> switch (sym->st_shndx) {
>> case SHN_COMMON:
>> warn("\"%s\" [%s] is COMMON symbol\n", symname, mod->name);
>> break;
>> - case SHN_ABS:
>> - /* CRC'd symbol */
>> - if (strncmp(symname, CRC_PFX, strlen(CRC_PFX)) == 0) {
>> - crc = (unsigned int) sym->st_value;
>> - sym_update_crc(symname + strlen(CRC_PFX), mod, crc,
>> - export);
>> - }
>> - break;
>> case SHN_UNDEF:
>> /* undefined symbol */
>> if (ELF_ST_BIND(sym->st_info) != STB_GLOBAL &&
>>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-08-14 3:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-09 19:45 [PATCH] Handle non ABS crc symbols Andi Kleen
2013-08-13 20:02 ` Michal Marek
2013-08-14 1:46 ` Rusty Russell
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.