Fix skipping first library for NaCl glibc programs.

NaCl glibc programs are started as dynamic linker with command line parameters.
So exec_bfd points out to the dynamic linker which has a .dynamic section. This
leads to ignore_first = 1 and skipping main program in dynamic library list. By
using interpreter check instead we weaken the condition to include the NaCl
case.

This adds to ignore_first = 0 branch all cases where main program doesn't have
an interpreter but has a .dynamic section i.e. launched program is a dynamic
linker or statically linked program that somehow loaded dynamic linker later. In
first case main (not a linker) program is first in the list. In the second case
statically linked program is not present in the list.

In Linux this adds main program to the list of shared libraries too if it is
launched via dynamic linker. But gdb can't load symbols for it since main
program has an empty name in the list.

BUG= http://code.google.com/p/nativeclient/issues/detail?id=2774
TEST= none
R=eaeltsin@google.com

Review URL: https://chromiumcodereview.appspot.com/10440066
1 file changed