Results 1 to 7 of 7
I'm compiling a simple helloworld program ,stuck in the final ld step
# ld -o hello hello.o -lc
ld: warning: cannot find entry symbol _start; defaulting to
I googled about ...
- 10-21-2009 #1
ld warning cannot find entry symbol _start defaulting to
I'm compiling a simple helloworld program ,stuck in the final ld step
I googled about this error message and found I would need to pass# ld -o hello hello.o -lc
ld: warning: cannot find entry symbol _start; defaulting to
/usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtn.o for runtime support.
(http://www.lisha.ufsc.br/teaching/os...ise/hello.html)
But even after adding them , I'm unable to get the working binary.ld /usr/lib/crt1.o /usr/lib/crti.o -lc hello.o /usr/lib/crtn.o -o hello
Looking for help from LF members
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 10-21-2009 #2
- 10-21-2009 #3
yes thanks,that's working fine ...but I need to create it using "ld" ...that's the issue.
I'm doing all compilation steps manually.Say first ran preprocessor (gcc -E ) then compilation (gcc -S ) and then assembler(gcc -c) and finally reached linker ..and stuck here
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 10-21-2009 #4Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Once you have your .o files, you can still use gcc to link them to an executable. It will better deal with all the little cruft that needs to be passed to ld to create a viable executable.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 10-23-2009 #5
Thanks Rubberman, For academic purpose I was looking to create this binary ,seems like it's pretty hard to get ld working
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 10-23-2009 #6Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
The ld command can be very order dependent. And the startup code depends a great deal upon the language(s) used - such as C vs. C++, Fortran, et al. That's why I usually let gcc deal with that cruft. I do have to say that my wife uses ld a lot for the HEP (high energy physics) software she develops and maintains for Fermilab and CERN. Probably because they use a lot of different languages and systems. Sorry that I'm not being much help here...
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 10-23-2009 #7
Yes,a month ago when i tried ld first it didn't work. Then I changed the order of arguments in
ld command - it worked
(Stupid me , I forgot the order - I tried to check .bash_history file ..but it is lost)...now in the process of documenting those steps ..somehow missed that vital ld part. anyway I'll search for it...
No problem,thanks for help.
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------


Reply With Quote
