From: Lionel Sambuc Date: Thu, 21 Aug 2014 11:35:45 +0000 (+0200) Subject: Fix bitcode support for kernel X-Git-Tag: v3.3.0~33 X-Git-Url: http://zhaoyanbai.com/repos/COPYRIGHT?a=commitdiff_plain;h=5f5dcc545f54b4b1cc77676a01888a80436d24a9;p=minix.git Fix bitcode support for kernel --- diff --git a/minix/kernel/arch/earm/kernel.lds b/minix/kernel/arch/earm/kernel.lds index 9070b38bb..b41fcad29 100644 --- a/minix/kernel/arch/earm/kernel.lds +++ b/minix/kernel/arch/earm/kernel.lds @@ -24,9 +24,9 @@ SECTIONS . += _kern_offset; . = ALIGN(4096); usermapped_start = .; - .usermapped_glo : AT(ADDR(.usermapped_glo) - _kern_offset) { usermapped_glo*.o(*) } + .usermapped_glo : AT(ADDR(.usermapped_glo) - _kern_offset) { *(.usermapped_glo) } . = ALIGN(4096); usermapped_nonglo_start = .; - .usermapped : AT(ADDR(.usermapped) - _kern_offset) { usermapped_*.o(*) } + .usermapped : AT(ADDR(.usermapped) - _kern_offset) { *(.usermapped) } . = ALIGN(4096); usermapped_end = .; .text : AT(ADDR(.text) - _kern_offset) { *(.text*) } _etext = .; @@ -47,5 +47,4 @@ SECTIONS { *(.ARM.exidx*) } - } diff --git a/minix/kernel/arch/i386/kernel.lds b/minix/kernel/arch/i386/kernel.lds index b38544e72..24c0c1f90 100644 --- a/minix/kernel/arch/i386/kernel.lds +++ b/minix/kernel/arch/i386/kernel.lds @@ -16,15 +16,15 @@ SECTIONS .unpaged_text : { unpaged_*.o(.text) } .unpaged_data ALIGN(4096) : { unpaged_*.o(.data .rodata*) } - .unpaged_bss ALIGN(4096) : { unpaged_*.o(.bss COMMON) } + .unpaged_bss ALIGN(4096) : { unpaged_*.o(.bss COMMON) } __k_unpaged__kern_unpaged_end = .; . += _kern_offset; . = ALIGN(4096); usermapped_start = .; - .usermapped_glo : AT(ADDR(.usermapped_glo) - _kern_offset) { usermapped_glo*.o(*) } + .usermapped_glo : AT(ADDR(.usermapped_glo) - _kern_offset) { *(.usermapped_glo) } . = ALIGN(4096); usermapped_nonglo_start = .; - .usermapped : AT(ADDR(.usermapped) - _kern_offset) { usermapped_*.o(*) } + .usermapped : AT(ADDR(.usermapped) - _kern_offset) { *(.usermapped) } . = ALIGN(4096); usermapped_end = .; .text : AT(ADDR(.text) - _kern_offset) { *(.text*) } .data ALIGN(4096) : AT(ADDR(.data) - _kern_offset) { *(.data .rodata* ) } diff --git a/minix/kernel/arch/i386/usermapped_data_arch.c b/minix/kernel/arch/i386/usermapped_data_arch.c index a475787c6..da84ce324 100644 --- a/minix/kernel/arch/i386/usermapped_data_arch.c +++ b/minix/kernel/arch/i386/usermapped_data_arch.c @@ -1,7 +1,7 @@ #include "kernel/kernel.h" #include "arch_proto.h" -struct minix_ipcvecs minix_ipcvecs_softint = { +struct minix_ipcvecs minix_ipcvecs_softint __section(".usermapped") = { .send = usermapped_send_softint, .receive = usermapped_receive_softint, .sendrec = usermapped_sendrec_softint, @@ -11,7 +11,7 @@ struct minix_ipcvecs minix_ipcvecs_softint = { .senda = usermapped_senda_softint }; -struct minix_ipcvecs minix_ipcvecs_sysenter = { +struct minix_ipcvecs minix_ipcvecs_sysenter __section(".usermapped") = { .send = usermapped_send_sysenter, .receive = usermapped_receive_sysenter, .sendrec = usermapped_sendrec_sysenter, @@ -21,7 +21,7 @@ struct minix_ipcvecs minix_ipcvecs_sysenter = { .senda = usermapped_senda_sysenter }; -struct minix_ipcvecs minix_ipcvecs_syscall = { +struct minix_ipcvecs minix_ipcvecs_syscall __section(".usermapped") = { .send = usermapped_send_syscall, .receive = usermapped_receive_syscall, .sendrec = usermapped_sendrec_syscall, diff --git a/minix/kernel/arch/i386/usermapped_glo_ipc.S b/minix/kernel/arch/i386/usermapped_glo_ipc.S index cb3b55b34..a5a1cde1d 100644 --- a/minix/kernel/arch/i386/usermapped_glo_ipc.S +++ b/minix/kernel/arch/i386/usermapped_glo_ipc.S @@ -1,6 +1,14 @@ #include #include +/* Redefine _ENTRY to put the following function in the section + * ".usermapped_glo". */ +#undef _ENTRY +#define _ENTRY(x) \ + _ALIGN_TEXT; .globl x; .type x,@function; x: + +.section .usermapped_glo, "wax", @progbits + /**========================================================================* */ /* IPC assembly routines * */ /**========================================================================* */ diff --git a/minix/kernel/usermapped_data.c b/minix/kernel/usermapped_data.c index bec1696f5..4ee09f622 100644 --- a/minix/kernel/usermapped_data.c +++ b/minix/kernel/usermapped_data.c @@ -1,11 +1,11 @@ #include "kernel/kernel.h" /* This is the user-visible struct that has pointers to other bits of data. */ -struct minix_kerninfo minix_kerninfo; +struct minix_kerninfo minix_kerninfo __section(".usermapped"); /* Kernel information structures. */ -struct kinfo kinfo; /* kernel information for users */ -struct machine machine; /* machine information for users */ -struct kmessages kmessages; /* diagnostic messages in kernel */ -struct loadinfo loadinfo; /* status of load average */ +struct kinfo kinfo __section(".usermapped"); /* kernel information for users */ +struct machine machine __section(".usermapped"); /* machine information for users */ +struct kmessages kmessages __section(".usermapped"); /* diagnostic messages in kernel */ +struct loadinfo loadinfo __section(".usermapped"); /* status of load average */