Skip to content

Commit

Permalink
FIX: renamed ***-start symbol to ***_start (more consistent with othe…
Browse files Browse the repository at this point in the history
…r startup symbols).
  • Loading branch information
dockimbel committed Feb 26, 2012
1 parent 5bba028 commit 4d7a98f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions red-system/emitter.r
Original file line number Diff line number Diff line change
Expand Up @@ -563,15 +563,15 @@ emitter: context [

start-prolog: does [ ;-- libc init prolog
append compiler/functions [ ;-- create a fake function to
***-start [0 native cdecl []] ;-- let the linker write the entry point
***_start [0 native cdecl []] ;-- let the linker write the entry point
]
append symbols [
***-start [native 0 []]
***_start [native 0 []]
]
]

start-epilog: does [ ;-- libc init epilog
poke second find/last symbols '***-start 2 tail-ptr - 1 ;-- save the "main" entry point
poke second find/last symbols '***_start 2 tail-ptr - 1 ;-- save the "main" entry point
]

init: func [link? [logic!] job [object!]][
Expand Down
8 changes: 6 additions & 2 deletions red-system/runtime/start.reds
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ system: declare struct! [ ;-- trimmed down temporary system definition
]

#switch OS [
Linux [
Windows [] ;-- nothing to do, initialization occurs in DLL init entry point
Syllable [

]
#default [
#import [LIBC-file cdecl [
libc-start: "__libc_start_main" [
main [function! []]
Expand Down Expand Up @@ -54,6 +58,6 @@ system: declare struct! [ ;-- trimmed down temporary system definition

;; Finally, call into libc's startup routine.
***__stack_end: system/stack/top
libc-start :***-start ***__argc ***__argv null null null ***__stack_end
libc-start :***_start ***__argc ***__argv null null null ***__stack_end
]
]

0 comments on commit 4d7a98f

Please sign in to comment.