Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


Closed Thread
  Search this Thread
Old 03-15-2004, 12:12 PM   #1
LQ Newbie
Registered: Mar 2004
Posts: 2

Rep: Reputation: 0
Question /usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 08048184

Hi All,
I have a very simple program at this point

#include <string.h>

int main()

return 1;

I compile using
gcc -Wall -ansi -c -o foo.c.o foo.c

and try to link using

/usr/bin/ld -o ld.o foo.c.o -lc

and I get

/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 08048100

Could someone please help me with what's going on, so that I could move on to writing some real code. I have about a few hundred object files to link and using "ld" is my only option at this time.

Old 03-15-2004, 01:13 PM   #2
Senior Member
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 58
Try compiling with just: gcc -Wall -ansi foo.c -o foo
Old 03-15-2004, 01:29 PM   #3
jim mcnamara
Registered: May 2002
Posts: 964

Rep: Reputation: 35
The symbol you are missing is part of a default library, crt0.o.
Using the gcc command itsme86 gave you automatically links that symbol into your program for you.
Old 03-15-2004, 01:31 PM   #4
LQ Newbie
Registered: Mar 2004
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks. This seems to help. Could you please let me kow what's the difference here?

Also -- one problem I have is, if I have references to other functions, say, I am compiling and linking multiple modules, how could I avoid the linker errors while compiling?

Old 10-31-2010, 03:21 PM   #5
LQ Newbie
Registered: Oct 2010
Posts: 2

Rep: Reputation: 0
Using JWASM and /usr/bin/LD in ubuntu 10.10

Dear People using JWASM,
I got the same error as above unable to find _start when I called the linker and it was caused by putting an underscore on the definition of the start label i.e. using _start: instead of using start:
;Helloworld.asm date 31 Oct 2010
;jwasm -elf -Fo helloworld.o helloworld.asm
;/usr/bin/ld -o ./helloworld ./helloworld.o

.model flat,c
option casemap:none
public start
;include ./include/
stdout equ 1
SYS_EXIT equ 1

string db "Hello, world!",10


call main

mov eax, SYS_EXIT
int 80h
main proc
mov ecx, offset string
mov edx, sizeof string
mov ebx, stdout
mov eax, SYS_WRITE
int 80h
main endp

end start

The above is the sample code for helloworld.asm
try it out with the jwasm compiler for linux and ld which is in /usr/bin/ld

I found the error by looking at the object table with the command

objdump -hrt helloworld.o and that showed that start was being given an underscore at some point by the assembler when producing the object file helloworld.o
Old 11-01-2010, 08:22 AM   #6
Senior Member
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
centruion-21, you'll have much better luck creating a new post than tacking onto a post from '04. In addition, you've created a duplicate post on another thread which is not allowed. I've split your other thread into a new thread.

Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
warning : /usr/lib64/ undefined symbol: awt586 SUSE / openSUSE 2 07-19-2005 04:18 PM
path in services wrong for clamav updated frm 0.75 to 0.80 usr/bin vs usr/local/bin Emmanuel_uk Linux - Newbie 3 04-22-2005 01:02 AM
Is '/usr/bin/find' reliable if '/bin/ls' has been replaced? DigaMe Linux - Security 2 11-12-2004 10:42 PM
/usr/bin/ld: cannot find -lselinux masand Linux - Software 6 09-03-2004 06:19 AM
/usr/bin/ld: cannot find -lc aa2bi Linux - Newbie 2 06-09-2004 06:32 AM

All times are GMT -5. The time now is 05:30 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration