This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug symtab/11766] New: gdb does not resolve correctly symbols in binaries loaded twice with dlmopen


The crux of the problem is that gdb believes that two entries in the inferior
linkmap are the same if the associated filename is the same. If you use dlmopen
to load the same binary twice at different base addresses, the correct test for
equality is if the filenames are the same _and_ the base addresses are the same.

the attached tarball contains a minimal testcase to reproduce this bug and the
attached patch fixes this bug as suggested by tom tromey on the gdb mailing-list.

how to reproduce:
tar zxf test.tar.gz
cd test
gdb ./test
run b

output:
#0  0x00007ffff785c567 in ?? ()
#1  0x00007fffffffe0b0 in ?? ()
#2  0x0000000000400641 in call (h=0x7ffff785c557, 


expected output:
the symbol 'bar' should be resolved.

-- 
           Summary: gdb does not resolve correctly symbols in binaries
                    loaded twice with dlmopen
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: symtab
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: mathieu dot lacage at gmail dot com
                CC: gdb-prs at sourceware dot org
 GCC build triplet: x86_64-redhat-linux-gnu
  GCC host triplet: x86_64-redhat-linux-gnu
GCC target triplet: x86_64-redhat-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=11766

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]