L4Ka. Regression with 4.7 and 4.8 ?
BERTRAND Joël
joel.bertrand@systella.fr
Sun Jun 23 09:57:00 GMT 2013
Oleg Endo a écrit :
> On Sat, 2013-06-22 at 21:38 +0200, BERTRAND Joël wrote:
>> Oleg Endo a écrit :
>>> The code in idt.c compiled with 4.6 puts static initialization functions
>>> into the .ctors section, while 4.7 puts them into the .init_array
>>> section. Probably this happens only for this single file in the whole
>>> kernel. My guess is that the .init_array section is not handled
>>> properly by the startup code of the kernel. Or maybe it's even stripped
>>> out completely (missing in the linker script). Either way, it seems
>>> that static initialization for idt.c is not being done properly and thus
>>> the code crashes.
>>
>> I don't think that ctors are stripped by linker script. This script is
>> built by makefile. Here is my script :
>>
>>
>> OUTPUT_FORMAT("elf64-x86-64")
>> OUTPUT_ARCH("i386:x86-64")
>> BOOTMEM_SIZE = 1024K;
>> ...
>
> As I initially assumed, the .init_array section seems to be missing in
> the linker script, so it gets stripped. The .init_array section has to
> be handled for code generated by GCC 4.7. I would say this is an issue
> of the L4 software, not GCC.
OK. I have done some test since yesterday. I have tried to include
.init_array in kernel.
If I modify my linker script like this :
SECTIONS
{
. = ALIGN(4k);
.text _start_text : AT (ADDR(.text) - KERNEL_OFFSET)
{
*(.text);
*(.gnu.linkonce.*);
*(.spinlock);
}
. = ALIGN(4k);
.init_array . : AT (ADDR(.init_array) - KERNEL_OFFSET)
{
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array))
PROVIDE_HIDDEN (__init_array_end = .);
}
. = ALIGN(4k);
.rodata . : AT (ADDR(.rodata) - KERNEL_OFFSET)
...
I obtain a kernel with an .init_array section. But result is the same as
I suppose that kickstart does not load this new section in memory.
I have tried to write .init_array in .text section with :
.text _start_text : AT (ADDR(.text) - KERNEL_OFFSET)
{
*(.text);
*(.gnu.linkonce.*);
*(.spinlock);
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array))
PROVIDE_HIDDEN (__init_array_end = .);
}
I believe that .init_array is included in text section and loaded by
kickstart into memory, but kernel only reboots too.
Regards,
JKB
More information about the Gcc-help
mailing list