All of lore.kernel.org
 help / color / mirror / Atom feed
* [QUESTION] Compile error on ppc32 with compilation option '-fdata-sections'
@ 2021-10-19  2:14 Ye Weihua
  2021-10-20  2:59 ` Ye Weihua
  2021-10-20 16:55 ` Kees Cook
  0 siblings, 2 replies; 4+ messages in thread
From: Ye Weihua @ 2021-10-19  2:14 UTC (permalink / raw)
  To: masahiroy, michal.lkml, keescook, daniel, andriin; +Cc: linux-kbuild

Hi,


When I was compiling the ppc32 kernel with the compilation option 
'-fdata-sections', a compilation error occurred and the message was as 
follows:


     "Inconsistent kallsyms data

     Try make KALLSYMS_EXTRA_PASS=1 as a workaround"


After comparing the symbol tables, I found that the "_end" and 
"__bss_stop" positions in Symtem.map and tmp_System.map are different: 
in Symtem.map they are in the middle of the symbol table. In 
tmp_System.map, they are at the end of the symbol table.


commit af73d78bd384aa9b add "strip-debug" to improve performance. 
However, the addition takes effect only for tmp_vmlinux but not for 
vmlinux. As a result, the symbol tables are different after the 
"-fdata-sections" compilation option is enabled.


How the "strip-debug" compilation option affects symbol table order?

Can "strip-debug" be added during vmlinux generation?


Kind regards,

Weihua

.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [QUESTION] Compile error on ppc32 with compilation option '-fdata-sections'
  2021-10-19  2:14 [QUESTION] Compile error on ppc32 with compilation option '-fdata-sections' Ye Weihua
@ 2021-10-20  2:59 ` Ye Weihua
  2021-10-20 16:55 ` Kees Cook
  1 sibling, 0 replies; 4+ messages in thread
From: Ye Weihua @ 2021-10-20  2:59 UTC (permalink / raw)
  To: masahiroy, michal.lkml, keescook, daniel, andriin; +Cc: linux-kbuild

Hi,


I did additional testing on other architectures and found that only the 
ppc32 had this problem. Is there a difference between the compiler's 
support for the ppc32 architecture and other architectures?


I hope you'll take the time to reply. Thanks.


Kind regards,

Weihua

.

On 2021/10/19 10:14, Ye Weihua wrote:
> Hi,
>
>
> When I was compiling the ppc32 kernel with the compilation option 
> '-fdata-sections', a compilation error occurred and the message was as 
> follows:
>
>
>     "Inconsistent kallsyms data
>
>     Try make KALLSYMS_EXTRA_PASS=1 as a workaround"
>
>
> After comparing the symbol tables, I found that the "_end" and 
> "__bss_stop" positions in Symtem.map and tmp_System.map are different: 
> in Symtem.map they are in the middle of the symbol table. In 
> tmp_System.map, they are at the end of the symbol table.
>
>
> commit af73d78bd384aa9b add "strip-debug" to improve performance. 
> However, the addition takes effect only for tmp_vmlinux but not for 
> vmlinux. As a result, the symbol tables are different after the 
> "-fdata-sections" compilation option is enabled.
>
>
> How the "strip-debug" compilation option affects symbol table order?
>
> Can "strip-debug" be added during vmlinux generation?
>
>
> Kind regards,
>
> Weihua
>
> .
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [QUESTION] Compile error on ppc32 with compilation option '-fdata-sections'
  2021-10-19  2:14 [QUESTION] Compile error on ppc32 with compilation option '-fdata-sections' Ye Weihua
  2021-10-20  2:59 ` Ye Weihua
@ 2021-10-20 16:55 ` Kees Cook
  2021-10-21  1:46   ` Ye Weihua
  1 sibling, 1 reply; 4+ messages in thread
From: Kees Cook @ 2021-10-20 16:55 UTC (permalink / raw)
  To: Ye Weihua; +Cc: masahiroy, michal.lkml, daniel, andriin, linux-kbuild

On Tue, Oct 19, 2021 at 10:14:34AM +0800, Ye Weihua wrote:
> Hi,
> 
> 
> When I was compiling the ppc32 kernel with the compilation option
> '-fdata-sections', a compilation error occurred and the message was as
> follows:
> 
> 
>     "Inconsistent kallsyms data
> 
>     Try make KALLSYMS_EXTRA_PASS=1 as a workaround"
> 
> 
> After comparing the symbol tables, I found that the "_end" and "__bss_stop"
> positions in Symtem.map and tmp_System.map are different: in Symtem.map they
> are in the middle of the symbol table. In tmp_System.map, they are at the
> end of the symbol table.
> 
> 
> commit af73d78bd384aa9b add "strip-debug" to improve performance. However,
> the addition takes effect only for tmp_vmlinux but not for vmlinux. As a
> result, the symbol tables are different after the "-fdata-sections"
> compilation option is enabled.
> 
> 
> How the "strip-debug" compilation option affects symbol table order?
> 
> Can "strip-debug" be added during vmlinux generation?

How did you add -fdata-sections? There needs to be a lot of special
handling to use that option...

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [QUESTION] Compile error on ppc32 with compilation option '-fdata-sections'
  2021-10-20 16:55 ` Kees Cook
@ 2021-10-21  1:46   ` Ye Weihua
  0 siblings, 0 replies; 4+ messages in thread
From: Ye Weihua @ 2021-10-21  1:46 UTC (permalink / raw)
  To: Kees Cook; +Cc: masahiroy, michal.lkml, daniel, andriin, linux-kbuild


On 2021/10/21 0:55, Kees Cook wrote:
> On Tue, Oct 19, 2021 at 10:14:34AM +0800, Ye Weihua wrote:
>> Hi,
>>
>>
>> When I was compiling the ppc32 kernel with the compilation option
>> '-fdata-sections', a compilation error occurred and the message was as
>> follows:
>>
>>
>>      "Inconsistent kallsyms data
>>
>>      Try make KALLSYMS_EXTRA_PASS=1 as a workaround"
>>
>>
>> After comparing the symbol tables, I found that the "_end" and "__bss_stop"
>> positions in Symtem.map and tmp_System.map are different: in Symtem.map they
>> are in the middle of the symbol table. In tmp_System.map, they are at the
>> end of the symbol table.
>>
>>
>> commit af73d78bd384aa9b add "strip-debug" to improve performance. However,
>> the addition takes effect only for tmp_vmlinux but not for vmlinux. As a
>> result, the symbol tables are different after the "-fdata-sections"
>> compilation option is enabled.
>>
>>
>> How the "strip-debug" compilation option affects symbol table order?
>>
>> Can "strip-debug" be added during vmlinux generation?
> How did you add -fdata-sections? There needs to be a lot of special
> handling to use that option...

I added "-fdata-sections" to the "CFLAGS_KERNEL" field and "-Wl,--gc-sections" to "LDFLAGS_VMLINUX" in Makefile. I've configured it this way on other architectures, but I haven't had the same problem with the exception of ppc32. Are there any other configurations or steps required?

Thanks.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-21  1:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-19  2:14 [QUESTION] Compile error on ppc32 with compilation option '-fdata-sections' Ye Weihua
2021-10-20  2:59 ` Ye Weihua
2021-10-20 16:55 ` Kees Cook
2021-10-21  1:46   ` Ye Weihua

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.