Forum Discussion
Altera_Forum
Honored Contributor
20 years agoimplementing own _start function
Hi all,
I am trying to implement my own _start function. According to the hello_alt_main readme file any definition of _start in my directory will override the library definition. If I built my project I get an error message saying that there are multiple definitions of _start and that it was first defined in crt0.S. Obviously, my _start function does not just override the function in crt0.S I define _start as global of type function Any ideas?3 Replies
- Altera_Forum
Honored Contributor
Are you feeding the linker the -nostdlib flag?
- Altera_Forum
Honored Contributor
No, I didn't, thanks for the hint!
I am using the -nostartfiles flag now and provide my own crt0.S file. That just works fine and according to the linker, program size (code + initialized data) remains the same (196 bytes). I am using hello_led example for testing and changed the function name “alt_main” to “start_main”. There is just a minor difference in size of the elf file (3901 to 3473 bytes) which I do not know where it possibly could come from. --wolf - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by pfab@Nov 9 2005, 03:22 PM i am using hello_led example for testing and changed the function name “alt_main” to “start_main”.there is just a minor difference in size of the elf file (3901 to 3473 bytes) which i do not know where it possibly could come from.
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=10873)
--- quote end ---
--- Quote End --- Take a look at the objdump file to see if there are some functions more that are linked to the elf from the stdlib... Paolo