Changeset 2eadda9 in mainline for uspace/lib/c/arch
- Timestamp:
- 2018-07-11T17:45:30Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 99d3123
- Parents:
- c2c4127
- git-author:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-11 17:08:12)
- git-committer:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-11 17:45:30)
- Location:
- uspace/lib/c/arch
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/abs32le/_link.ld.in
rc2c4127 r2eadda9 57 57 58 58 .init_array : { 59 #ifndef SHLIB 59 60 PROVIDE_HIDDEN (__init_array_start = .); 61 #endif 60 62 KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) 61 63 KEEP (*(.init_array .ctors)) 64 #ifndef SHLIB 62 65 PROVIDE_HIDDEN (__init_array_end = .); 66 #endif 63 67 } 64 68 65 69 .fini_array : { 70 #ifndef SHLIB 66 71 PROVIDE_HIDDEN (__fini_array_start = .); 72 #endif 67 73 KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) 68 74 KEEP (*(.fini_array .dtors)) 75 #ifndef SHLIB 69 76 PROVIDE_HIDDEN (__fini_array_end = .); 77 #endif 70 78 } 71 79 -
uspace/lib/c/arch/abs32le/src/entry.c
rc2c4127 r2eadda9 30 30 */ 31 31 32 #include "../../../generic/private/libc.h"33 32 #include <stddef.h> 34 33 35 34 extern void _start(void); 35 extern void __c_start(void *); 36 36 37 37 /* Normally, the entry point is defined in assembly for the architecture. */ … … 39 39 void _start(void) 40 40 { 41 __ libc_main(NULL);41 __c_start(NULL); 42 42 } 43 43 -
uspace/lib/c/arch/amd64/_link.ld.in
rc2c4127 r2eadda9 57 57 58 58 .init_array : { 59 #ifndef SHLIB 59 60 PROVIDE_HIDDEN (__init_array_start = .); 61 #endif 60 62 KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) 61 63 KEEP (*(.init_array .ctors)) 64 #ifndef SHLIB 62 65 PROVIDE_HIDDEN (__init_array_end = .); 66 #endif 63 67 } 64 68 65 69 .fini_array : { 70 #ifndef SHLIB 66 71 PROVIDE_HIDDEN (__fini_array_start = .); 72 #endif 67 73 KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) 68 74 KEEP (*(.fini_array .dtors)) 75 #ifndef SHLIB 69 76 PROVIDE_HIDDEN (__fini_array_end = .); 77 #endif 70 78 } 71 79 -
uspace/lib/c/arch/amd64/src/entry.S
rc2c4127 r2eadda9 29 29 #include <abi/asmtool.h> 30 30 31 . section .init, "ax"31 .text 32 32 33 33 .org 0 … … 46 46 47 47 # %rdi was deliberately chosen as the first argument is also in %rdi 48 # Pass PCB pointer to __ libc_main(no operation)49 call __ libc_main48 # Pass PCB pointer to __c_start (no operation) 49 call __c_start -
uspace/lib/c/arch/arm32/_link.ld.in
rc2c4127 r2eadda9 55 55 56 56 .init_array : { 57 #ifndef SHLIB 57 58 PROVIDE_HIDDEN (__init_array_start = .); 59 #endif 58 60 KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) 59 61 KEEP (*(.init_array .ctors)) 62 #ifndef SHLIB 60 63 PROVIDE_HIDDEN (__init_array_end = .); 64 #endif 61 65 } 62 66 63 67 .fini_array : { 68 #ifndef SHLIB 64 69 PROVIDE_HIDDEN (__fini_array_start = .); 70 #endif 65 71 KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) 66 72 KEEP (*(.fini_array .dtors)) 73 #ifndef SHLIB 67 74 PROVIDE_HIDDEN (__fini_array_end = .); 75 #endif 68 76 } 69 77 -
uspace/lib/c/arch/arm32/src/entry.S
rc2c4127 r2eadda9 29 29 #include <abi/asmtool.h> 30 30 31 . section .init, "ax"31 .text 32 32 33 33 .org 0 … … 51 51 sub fp, ip, #4 52 52 53 # Pass pcb_ptr to __ libc_mainas the first argument (in r0)53 # Pass pcb_ptr to __c_start as the first argument (in r0) 54 54 mov r0, r1 55 bl __ libc_main55 bl __c_start 56 56 57 57 .data -
uspace/lib/c/arch/ia32/_link.ld.in
rc2c4127 r2eadda9 116 116 117 117 .init_array : { 118 PROVIDE (__init_array_start = .); 118 #ifndef SHLIB 119 PROVIDE_HIDDEN (__init_array_start = .); 120 #endif 119 121 KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) 120 122 KEEP (*(.init_array .ctors)) 121 PROVIDE (__init_array_end = .); 123 #ifndef SHLIB 124 PROVIDE_HIDDEN (__init_array_end = .); 125 #endif 122 126 } 123 127 124 128 .fini_array : { 125 PROVIDE (__fini_array_start = .); 129 #ifndef SHLIB 130 PROVIDE_HIDDEN (__fini_array_start = .); 131 #endif 126 132 KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) 127 133 KEEP (*(.fini_array .dtors)) 128 PROVIDE (__fini_array_end = .); 134 #ifndef SHLIB 135 PROVIDE_HIDDEN (__fini_array_end = .); 136 #endif 129 137 } 130 138 -
uspace/lib/c/arch/ia32/src/entry.S
rc2c4127 r2eadda9 32 32 INTEL_SEP = 11 33 33 34 . section .init, "ax"34 .text 35 35 36 36 .org 0 … … 65 65 movl %esp, %ebp 66 66 67 # Pass the PCB pointer to __ libc_mainas the first argument67 # Pass the PCB pointer to __c_start as the first argument 68 68 pushl %edi 69 call __ libc_main69 call __c_start -
uspace/lib/c/arch/ia64/_link.ld.in
rc2c4127 r2eadda9 65 65 66 66 .init_array : { 67 #ifndef SHLIB 67 68 PROVIDE_HIDDEN (__init_array_start = .); 69 #endif 68 70 KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) 69 71 KEEP (*(.init_array .ctors)) 72 #ifndef SHLIB 70 73 PROVIDE_HIDDEN (__init_array_end = .); 74 #endif 71 75 } 72 76 73 77 .fini_array : { 78 #ifndef SHLIB 74 79 PROVIDE_HIDDEN (__fini_array_start = .); 80 #endif 75 81 KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) 76 82 KEEP (*(.fini_array .dtors)) 83 #ifndef SHLIB 77 84 PROVIDE_HIDDEN (__fini_array_end = .); 85 #endif 78 86 } 79 87 -
uspace/lib/c/arch/ia64/src/entry.S
rc2c4127 r2eadda9 29 29 #include <abi/asmtool.h> 30 30 31 . section .init, "ax"31 .text 32 32 33 33 .org 0 … … 42 42 movl gp = __gp 43 43 44 # Pass PCB pointer as the first argument to __ libc_main44 # Pass PCB pointer as the first argument to __c_start 45 45 mov out0 = r2 ;; 46 br.call.sptk.many b0 = __ libc_main46 br.call.sptk.many b0 = __c_start 47 47 -
uspace/lib/c/arch/mips32/_link.ld.in
rc2c4127 r2eadda9 62 62 63 63 .init_array : { 64 #ifndef SHLIB 64 65 PROVIDE_HIDDEN (__init_array_start = .); 66 #endif 65 67 KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) 66 68 KEEP (*(.init_array .ctors)) 69 #ifndef SHLIB 67 70 PROVIDE_HIDDEN (__init_array_end = .); 71 #endif 68 72 } 69 73 70 74 .fini_array : { 75 #ifndef SHLIB 71 76 PROVIDE_HIDDEN (__fini_array_start = .); 77 #endif 72 78 KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) 73 79 KEEP (*(.fini_array .dtors)) 80 #ifndef SHLIB 74 81 PROVIDE_HIDDEN (__fini_array_end = .); 82 #endif 75 83 } 76 84 -
uspace/lib/c/arch/mips32/src/entry.S
rc2c4127 r2eadda9 31 31 32 32 .text 33 .section .init, "ax"34 33 35 34 .set noreorder … … 51 50 .cprestore 16 52 51 53 # Pass pcb_ptr to __ libc_main() as the first argument. It is already52 # Pass pcb_ptr to __c_start() as the first argument. It is already 54 53 # in $a0. As the first argument is passed in $a0, no operation 55 54 # is needed. 56 55 57 jal __ libc_main56 jal __c_start 58 57 nop 59 58 -
uspace/lib/c/arch/ppc32/_link.ld.in
rc2c4127 r2eadda9 55 55 56 56 .init_array : { 57 #ifndef SHLIB 57 58 PROVIDE_HIDDEN (__init_array_start = .); 59 #endif 58 60 KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) 59 61 KEEP (*(.init_array .ctors)) 62 #ifndef SHLIB 60 63 PROVIDE_HIDDEN (__init_array_end = .); 64 #endif 61 65 } 62 66 63 67 .fini_array : { 68 #ifndef SHLIB 64 69 PROVIDE_HIDDEN (__fini_array_start = .); 70 #endif 65 71 KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) 66 72 KEEP (*(.fini_array .dtors)) 73 #ifndef SHLIB 67 74 PROVIDE_HIDDEN (__fini_array_end = .); 75 #endif 68 76 } 69 77 -
uspace/lib/c/arch/ppc32/src/entry.S
rc2c4127 r2eadda9 29 29 #include <abi/asmtool.h> 30 30 31 . section .init, "ax"31 .text 32 32 33 33 .org 0 … … 45 45 stwu %r1, -16(%r1) 46 46 47 # Pass the PCB pointer to __ libc_main() as the first argument.47 # Pass the PCB pointer to __c_start() as the first argument. 48 48 # The first argument is passed in r3. 49 49 mr %r3, %r6 50 bl __ libc_main50 bl __c_start -
uspace/lib/c/arch/riscv64/_link.ld.in
rc2c4127 r2eadda9 54 54 55 55 .init_array : { 56 #ifndef SHLIB 56 57 PROVIDE_HIDDEN (__init_array_start = .); 58 #endif 57 59 KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) 58 60 KEEP (*(.init_array .ctors)) 61 #ifndef SHLIB 59 62 PROVIDE_HIDDEN (__init_array_end = .); 63 #endif 60 64 } 61 65 62 66 .fini_array : { 67 #ifndef SHLIB 63 68 PROVIDE_HIDDEN (__fini_array_start = .); 69 #endif 64 70 KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) 65 71 KEEP (*(.fini_array .dtors)) 72 #ifndef SHLIB 66 73 PROVIDE_HIDDEN (__fini_array_end = .); 74 #endif 67 75 } 68 76 -
uspace/lib/c/arch/riscv64/src/entry.c
rc2c4127 r2eadda9 30 30 */ 31 31 32 #include "../../../generic/private/libc.h"33 34 32 extern void _start(void); 33 extern void __c_start(void *); 35 34 36 35 // FIXME: Implement properly. … … 38 37 void _start(void) 39 38 { 40 __ libc_main((void *)0);39 __c_start(0); 41 40 } 42 41 -
uspace/lib/c/arch/sparc64/_link.ld.in
rc2c4127 r2eadda9 58 58 59 59 .init_array : { 60 #ifndef SHLIB 60 61 PROVIDE_HIDDEN (__init_array_start = .); 62 #endif 61 63 KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) 62 64 KEEP (*(.init_array .ctors)) 65 #ifndef SHLIB 63 66 PROVIDE_HIDDEN (__init_array_end = .); 67 #endif 64 68 } 65 69 66 70 .fini_array : { 71 #ifndef SHLIB 67 72 PROVIDE_HIDDEN (__fini_array_start = .); 73 #endif 68 74 KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) 69 75 KEEP (*(.fini_array .dtors)) 76 #ifndef SHLIB 70 77 PROVIDE_HIDDEN (__fini_array_end = .); 78 #endif 71 79 } 72 80 -
uspace/lib/c/arch/sparc64/src/entry.S
rc2c4127 r2eadda9 29 29 #include <abi/asmtool.h> 30 30 31 . section .init, "ax"31 .text 32 32 33 33 .org 0 … … 46 46 add %g0, -0x7ff, %fp 47 47 48 # Pass pcb_ptr as the first argument to __ libc_main()49 call __ libc_main48 # Pass pcb_ptr as the first argument to __c_start() 49 call __c_start 50 50 mov %i1, %o0
Note:
See TracChangeset
for help on using the changeset viewer.