title: gdb doesn't stop on breakpoint
body: <p>I'm trying to debug a shared library which run under <a href="http://check.sourceforge.net/" rel="noreferrer">check</a> in unit-testing scenario.
  The shared library is statically linked (no <code>dlload</code>) and both the unit-testing application and the shared library are compiled with debugging symbols (<code>-g</code>)</p>
  
  <p>In <code>gdb</code> I want to set a breakpoint in a function contained in the shared library.
  I set a breakpoint successfully, but when it runs it just passes over the break-point.</p>
  
  <p><strong>What I've tried already:</strong></p>
  
  <p>I placed a <code>printf</code> in the shared library, it is printed out, so the function is actually called.</p>
  
  <p><strong>Here's the Makefile I'm using for compilation:</strong></p>
  
  <pre><code>SHELL = /bin/sh
  CC    = gcc
  CFLAGS       = -g -Wall -std=gnu99 -Iinclude
  EXTRA_FLAGS  = -fPIC -shared
  LIBFLAGS     = -fPIC -shared 
  LDFLAGS      = -shared -pthread -lcheck
  DEBUGFLAGS   = -O0 -D _DEBUG
  RELEASEFLAGS = -O2 -D NDEBUG -combine -fwhole-program
  TEST_LDFLAGS = -lcheck -lllist -Llib -Wl,-rpath $(OBJDIR)
  
  OBJDIR  = lib
  TARGET  = $(OBJDIR)/libllist.so
  TEST_TARGET = starttest
  SOURCES = $(shell echo src/*.c)
  HEADERS = $(shell echo inc/*.h)
  TEST_SOURCES = $(shell echo tests/*.c)
  TEST_OBJECTS = $(TEST_SOURCES:.c=.o)
  OBJECTS = $(SOURCES:.c=.o)
  PREFIX = $(DESTDIR)/usr/local
  BINDIR = $(PREFIX)/bin
  
  all: $(TARGET) tests
  $(TARGET): $(OBJECTS)
      mkdir -p $(OBJDIR)
      $(CC) $(FLAGS) $(LIBFLAGS) $(DEBUGFLAGS) -o $(TARGET) $(OBJECTS)
  
  
  tests: $(TEST_OBJECTS)
      $(CC) $(FLAGS) -o $(TEST_TARGET) $(TEST_OBJECTS) $(TEST_LDFLAGS)
  
  # Need a special rule to compile the lib to allow EXTRA_FLAGS
  $(OBJECTS): $(SOURCES)
      @echo [Compiling]: $&lt;
      $(CC) $(CFLAGS) $(EXTRA_FLAGS) -o $@ -c $&lt;
  
  clean:
      rm -rf $(TEST_OBJECTS) $(OBJECTS) *~ $(TARGET) $(TEST_TARGET)
  
  runtests:
      ./$(TEST_TARGET)
  </code></pre>