title: Makefile: multiple definition of '_start'
body: <p>My makefile has a problem.</p>
  
  
  
  <pre class="lang-none prettyprint-override"><code>eos$ make
  gcc objects.o -o bumper_cars
  objects.o: In function `_start':
  (.text+0x0): multiple definition of `_start'
  /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crt1.o:(.text+0x0): first defined here
  objects.o: In function `_fini':
  (.fini+0x0): multiple definition of `_fini'
  /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crti.o:(.fini+0x0): first defined here
  objects.o:(.rodata+0x0): multiple definition of `_IO_stdin_used'
  /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crt1.o:(.rodata.cst4+0x0):     first defined here
  objects.o: In function `__data_start':
  (.data+0x0): multiple definition of `__data_start'
  /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crt1.o:(.data+0x0): first defined here
  objects.o:(.rodata+0x8): multiple definition of `__dso_handle'
  /usr/lib/gcc/x86_64-redhat-linux/4.4.7/crtbegin.o:(.rodata+0x0): first defined here
  objects.o: In function `_init':
  (.init+0x0): multiple definition of `_init'
  /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crti.o:(.init+0x0): first defined here
  /usr/lib/gcc/x86_64-redhat-linux/4.4.7/crtend.o:(.dtors+0x0): multiple definition of     `__DTOR_END__'
  objects.o:(.dtors+0x8): first defined here
  /usr/bin/ld: warning: Cannot create .eh_frame_hdr section, --eh-frame-hdr ignored.
  /usr/bin/ld: error in objects.o(.eh_frame); no .eh_frame_hdr table will be created.
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>And the makefile:</p>
  
  <pre class="lang-none prettyprint-override"><code>CC =  gcc
  CFLAGS = -Wall -std=c99 -g -pthread
  
  all: objects.o bumper_cars
  
  objects.o: bumper_cars.c sleeper.c sleeper.h
      $(CC) $(CFLAGS) $^ -o $@ -c
  
  bumper_cars: objects.o
      $(CC) $^ -o $@
  
  clean:
      rm -f bumper_cars.o
      rm -f bumper_cars
  </code></pre>