title: gcov stopped to generate gcda file after added -rdynamic flag (__gcov_flush()  called through gdb)
body: <p>I've got some server in c++ (commands acquired from build-system):</p>
  
  <pre><code>g++ -o obj/server.o -c -m64 -isystem/opt/boost/include -Wall -Werror -march=core2 -ftest-coverage -fprofile-arcs -DGCOV_ENABLED= -Iinclude -I/opt/hydraOST/lzopro/include -I/usr/include/libxml2 -Idaemon/include src/server.cpp
  
  g++ -o bin/server.exe -rdynamic -ftest-coverage -fprofile-arcs -m64 -Wl,-rpath=\$ORIGIN -Wl,-rpath=/opt/hydraOST/lzopro/lib  obj/server.o (+ other libs)
  </code></pre>
  
  <p>As it's daemon and I'm stopping it with signal but to enforce dumping gcov data before <code>kill $PID</code> I'm using <em>gdb</em>:</p>
  
  <pre><code>gdb -p $PID -batch -x gcov/dumpGcovData
  </code></pre>
  
  <p>where contents of <em>gcov/dumpGcovData</em>:</p>
  
  <pre><code>call __gcov_flush()
  thread apply all call __gcov_flush()
  </code></pre>
  
  <p>I know that linking should be with <code>-lgcov</code> but as it was working in that way so I didn't change it in build system. The problem occured just after added <code>-rdynamic</code> flag (<strong>without that flag it worked properly</strong>).</p>