summaryrefslogtreecommitdiffstats
path: root/linker/arch/x86/begin.S
blob: 8f468e6b6b10ff6d346622c8016ee1762788fe15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
.text
.align 4
.type _start, @function
.globl _start

_start:
        /* save the elfdata ptr to %eax, AND push it onto the stack */
        mov    %esp, %eax
        pushl  %esp

        pushl  %eax
        call   __linker_init

        /* linker init returns (%eax) the _entry address in the main image */
        /* entry point expects sp to point to elfdata */
        popl   %esp
        jmp    *%eax

.section .ctors, "wa"
.globl __CTOR_LIST__

__CTOR_LIST__:
        .long -1