Changeset 2eadda9 in mainline for uspace/lib/c/arch


Ignore:
Timestamp:
2018-07-11T17:45:30Z (7 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
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)
Message:

Remove undefined references to main program from shared libc.

Location:
uspace/lib/c/arch
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/abs32le/_link.ld.in

    rc2c4127 r2eadda9  
    5757
    5858        .init_array : {
     59#ifndef SHLIB
    5960                PROVIDE_HIDDEN (__init_array_start = .);
     61#endif
    6062                KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
    6163                KEEP (*(.init_array .ctors))
     64#ifndef SHLIB
    6265                PROVIDE_HIDDEN (__init_array_end = .);
     66#endif
    6367        }
    6468
    6569        .fini_array : {
     70#ifndef SHLIB
    6671                PROVIDE_HIDDEN (__fini_array_start = .);
     72#endif
    6773                KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
    6874                KEEP (*(.fini_array .dtors))
     75#ifndef SHLIB
    6976                PROVIDE_HIDDEN (__fini_array_end = .);
     77#endif
    7078        }
    7179
  • uspace/lib/c/arch/abs32le/src/entry.c

    rc2c4127 r2eadda9  
    3030 */
    3131
    32 #include "../../../generic/private/libc.h"
    3332#include <stddef.h>
    3433
    3534extern void _start(void);
     35extern void __c_start(void *);
    3636
    3737/* Normally, the entry point is defined in assembly for the architecture. */
     
    3939void _start(void)
    4040{
    41         __libc_main(NULL);
     41        __c_start(NULL);
    4242}
    4343
  • uspace/lib/c/arch/amd64/_link.ld.in

    rc2c4127 r2eadda9  
    5757
    5858        .init_array : {
     59#ifndef SHLIB
    5960                PROVIDE_HIDDEN (__init_array_start = .);
     61#endif
    6062                KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
    6163                KEEP (*(.init_array .ctors))
     64#ifndef SHLIB
    6265                PROVIDE_HIDDEN (__init_array_end = .);
     66#endif
    6367        }
    6468
    6569        .fini_array : {
     70#ifndef SHLIB
    6671                PROVIDE_HIDDEN (__fini_array_start = .);
     72#endif
    6773                KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
    6874                KEEP (*(.fini_array .dtors))
     75#ifndef SHLIB
    6976                PROVIDE_HIDDEN (__fini_array_end = .);
     77#endif
    7078        }
    7179
  • uspace/lib/c/arch/amd64/src/entry.S

    rc2c4127 r2eadda9  
    2929#include <abi/asmtool.h>
    3030
    31 .section .init, "ax"
     31.text
    3232
    3333.org 0
     
    4646
    4747        # %rdi was deliberately chosen as the first argument is also in %rdi
    48         # Pass PCB pointer to __libc_main (no operation)
    49         call __libc_main
     48        # Pass PCB pointer to __c_start (no operation)
     49        call __c_start
  • uspace/lib/c/arch/arm32/_link.ld.in

    rc2c4127 r2eadda9  
    5555
    5656        .init_array : {
     57#ifndef SHLIB
    5758                PROVIDE_HIDDEN (__init_array_start = .);
     59#endif
    5860                KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
    5961                KEEP (*(.init_array .ctors))
     62#ifndef SHLIB
    6063                PROVIDE_HIDDEN (__init_array_end = .);
     64#endif
    6165        }
    6266
    6367        .fini_array : {
     68#ifndef SHLIB
    6469                PROVIDE_HIDDEN (__fini_array_start = .);
     70#endif
    6571                KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
    6672                KEEP (*(.fini_array .dtors))
     73#ifndef SHLIB
    6774                PROVIDE_HIDDEN (__fini_array_end = .);
     75#endif
    6876        }
    6977
  • uspace/lib/c/arch/arm32/src/entry.S

    rc2c4127 r2eadda9  
    2929#include <abi/asmtool.h>
    3030
    31 .section .init, "ax"
     31.text
    3232
    3333.org 0
     
    5151        sub fp, ip, #4
    5252
    53         # Pass pcb_ptr to __libc_main as the first argument (in r0)
     53        # Pass pcb_ptr to __c_start as the first argument (in r0)
    5454        mov r0, r1
    55         bl __libc_main
     55        bl __c_start
    5656
    5757.data
  • uspace/lib/c/arch/ia32/_link.ld.in

    rc2c4127 r2eadda9  
    116116
    117117        .init_array : {
    118                 PROVIDE (__init_array_start = .);
     118#ifndef SHLIB
     119                PROVIDE_HIDDEN (__init_array_start = .);
     120#endif
    119121                KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
    120122                KEEP (*(.init_array .ctors))
    121                 PROVIDE (__init_array_end = .);
     123#ifndef SHLIB
     124                PROVIDE_HIDDEN (__init_array_end = .);
     125#endif
    122126        }
    123127
    124128        .fini_array : {
    125                 PROVIDE (__fini_array_start = .);
     129#ifndef SHLIB
     130                PROVIDE_HIDDEN (__fini_array_start = .);
     131#endif
    126132                KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
    127133                KEEP (*(.fini_array .dtors))
    128                 PROVIDE (__fini_array_end = .);
     134#ifndef SHLIB
     135                PROVIDE_HIDDEN (__fini_array_end = .);
     136#endif
    129137        }
    130138
  • uspace/lib/c/arch/ia32/src/entry.S

    rc2c4127 r2eadda9  
    3232INTEL_SEP = 11
    3333
    34 .section .init, "ax"
     34.text
    3535
    3636.org 0
     
    6565        movl %esp, %ebp
    6666
    67         # Pass the PCB pointer to __libc_main as the first argument
     67        # Pass the PCB pointer to __c_start as the first argument
    6868        pushl %edi
    69         call __libc_main
     69        call __c_start
  • uspace/lib/c/arch/ia64/_link.ld.in

    rc2c4127 r2eadda9  
    6565
    6666        .init_array : {
     67#ifndef SHLIB
    6768                PROVIDE_HIDDEN (__init_array_start = .);
     69#endif
    6870                KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
    6971                KEEP (*(.init_array .ctors))
     72#ifndef SHLIB
    7073                PROVIDE_HIDDEN (__init_array_end = .);
     74#endif
    7175        }
    7276
    7377        .fini_array : {
     78#ifndef SHLIB
    7479                PROVIDE_HIDDEN (__fini_array_start = .);
     80#endif
    7581                KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
    7682                KEEP (*(.fini_array .dtors))
     83#ifndef SHLIB
    7784                PROVIDE_HIDDEN (__fini_array_end = .);
     85#endif
    7886        }
    7987
  • uspace/lib/c/arch/ia64/src/entry.S

    rc2c4127 r2eadda9  
    2929#include <abi/asmtool.h>
    3030
    31 .section .init, "ax"
     31.text
    3232
    3333.org 0
     
    4242        movl gp = __gp
    4343
    44         # Pass PCB pointer as the first argument to __libc_main
     44        # Pass PCB pointer as the first argument to __c_start
    4545        mov out0 = r2 ;;
    46         br.call.sptk.many b0 = __libc_main
     46        br.call.sptk.many b0 = __c_start
    4747
  • uspace/lib/c/arch/mips32/_link.ld.in

    rc2c4127 r2eadda9  
    6262
    6363        .init_array : {
     64#ifndef SHLIB
    6465                PROVIDE_HIDDEN (__init_array_start = .);
     66#endif
    6567                KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
    6668                KEEP (*(.init_array .ctors))
     69#ifndef SHLIB
    6770                PROVIDE_HIDDEN (__init_array_end = .);
     71#endif
    6872        }
    6973
    7074        .fini_array : {
     75#ifndef SHLIB
    7176                PROVIDE_HIDDEN (__fini_array_start = .);
     77#endif
    7278                KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
    7379                KEEP (*(.fini_array .dtors))
     80#ifndef SHLIB
    7481                PROVIDE_HIDDEN (__fini_array_end = .);
     82#endif
    7583        }
    7684
  • uspace/lib/c/arch/mips32/src/entry.S

    rc2c4127 r2eadda9  
    3131
    3232.text
    33 .section .init, "ax"
    3433
    3534.set noreorder
     
    5150        .cprestore 16
    5251
    53         # Pass pcb_ptr to __libc_main() as the first argument. It is already
     52        # Pass pcb_ptr to __c_start() as the first argument. It is already
    5453        # in $a0. As the first argument is passed in $a0, no operation
    5554        # is needed.
    5655
    57         jal __libc_main
     56        jal __c_start
    5857        nop
    5958
  • uspace/lib/c/arch/ppc32/_link.ld.in

    rc2c4127 r2eadda9  
    5555
    5656        .init_array : {
     57#ifndef SHLIB
    5758                PROVIDE_HIDDEN (__init_array_start = .);
     59#endif
    5860                KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
    5961                KEEP (*(.init_array .ctors))
     62#ifndef SHLIB
    6063                PROVIDE_HIDDEN (__init_array_end = .);
     64#endif
    6165        }
    6266
    6367        .fini_array : {
     68#ifndef SHLIB
    6469                PROVIDE_HIDDEN (__fini_array_start = .);
     70#endif
    6571                KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
    6672                KEEP (*(.fini_array .dtors))
     73#ifndef SHLIB
    6774                PROVIDE_HIDDEN (__fini_array_end = .);
     75#endif
    6876        }
    6977
  • uspace/lib/c/arch/ppc32/src/entry.S

    rc2c4127 r2eadda9  
    2929#include <abi/asmtool.h>
    3030
    31 .section .init, "ax"
     31.text
    3232
    3333.org 0
     
    4545        stwu %r1, -16(%r1)
    4646
    47         # Pass the PCB pointer to __libc_main() as the first argument.
     47        # Pass the PCB pointer to __c_start() as the first argument.
    4848        # The first argument is passed in r3.
    4949        mr %r3, %r6
    50         bl __libc_main
     50        bl __c_start
  • uspace/lib/c/arch/riscv64/_link.ld.in

    rc2c4127 r2eadda9  
    5454
    5555        .init_array : {
     56#ifndef SHLIB
    5657                PROVIDE_HIDDEN (__init_array_start = .);
     58#endif
    5759                KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
    5860                KEEP (*(.init_array .ctors))
     61#ifndef SHLIB
    5962                PROVIDE_HIDDEN (__init_array_end = .);
     63#endif
    6064        }
    6165
    6266        .fini_array : {
     67#ifndef SHLIB
    6368                PROVIDE_HIDDEN (__fini_array_start = .);
     69#endif
    6470                KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
    6571                KEEP (*(.fini_array .dtors))
     72#ifndef SHLIB
    6673                PROVIDE_HIDDEN (__fini_array_end = .);
     74#endif
    6775        }
    6876
  • uspace/lib/c/arch/riscv64/src/entry.c

    rc2c4127 r2eadda9  
    3030 */
    3131
    32 #include "../../../generic/private/libc.h"
    33 
    3432extern void _start(void);
     33extern void __c_start(void *);
    3534
    3635// FIXME: Implement properly.
     
    3837void _start(void)
    3938{
    40         __libc_main((void *) 0);
     39        __c_start(0);
    4140}
    4241
  • uspace/lib/c/arch/sparc64/_link.ld.in

    rc2c4127 r2eadda9  
    5858
    5959        .init_array : {
     60#ifndef SHLIB
    6061                PROVIDE_HIDDEN (__init_array_start = .);
     62#endif
    6163                KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
    6264                KEEP (*(.init_array .ctors))
     65#ifndef SHLIB
    6366                PROVIDE_HIDDEN (__init_array_end = .);
     67#endif
    6468        }
    6569
    6670        .fini_array : {
     71#ifndef SHLIB
    6772                PROVIDE_HIDDEN (__fini_array_start = .);
     73#endif
    6874                KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
    6975                KEEP (*(.fini_array .dtors))
     76#ifndef SHLIB
    7077                PROVIDE_HIDDEN (__fini_array_end = .);
     78#endif
    7179        }
    7280
  • uspace/lib/c/arch/sparc64/src/entry.S

    rc2c4127 r2eadda9  
    2929#include <abi/asmtool.h>
    3030
    31 .section .init, "ax"
     31.text
    3232
    3333.org 0
     
    4646        add %g0, -0x7ff, %fp
    4747
    48         # Pass pcb_ptr as the first argument to __libc_main()
    49         call __libc_main
     48        # Pass pcb_ptr as the first argument to __c_start()
     49        call __c_start
    5050        mov %i1, %o0
Note: See TracChangeset for help on using the changeset viewer.