From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20763 invoked by alias); 6 Feb 2007 01:33:36 -0000 Received: (qmail 20755 invoked by uid 22791); 6 Feb 2007 01:33:35 -0000 X-Spam-Check-By: sourceware.org Received: from e36.co.us.ibm.com (HELO e36.co.us.ibm.com) (32.97.110.154) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 06 Feb 2007 01:33:25 +0000 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e36.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id l161XNGB004956 for ; Mon, 5 Feb 2007 20:33:23 -0500 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v8.2) with ESMTP id l161XNNb520978 for ; Mon, 5 Feb 2007 18:33:23 -0700 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l161XNId028182 for ; Mon, 5 Feb 2007 18:33:23 -0700 Received: from d03nm113.boulder.ibm.com (d03nm113.boulder.ibm.com [9.17.195.139]) by d03av03.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l161XNcP028179 for ; Mon, 5 Feb 2007 18:33:23 -0700 To: gdb@sourceware.org MIME-Version: 1.0 Subject: /lib64/ld64.so.1 not being added to target sections list on ppc64 X-Mailer: Lotus Notes Release 7.0 HF277 June 21, 2006 Message-ID: From: Paul Gilliam Date: Tue, 06 Feb 2007 01:33:00 -0000 Content-Type: text/plain; charset="US-ASCII" Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-02/txt/msg00032.txt.bz2 I am tracking down a bug where the inf. gets a segfault when the user sets a pointer variable to point to a string: (gdb) set var ptr1="foo" gdb "calls" 'malloc' in the inf. It gets a function pointer to 'malloc', but fails to convert it to a function address because none of the sections of the object file with the .opd section corresponding to the function pointer are loaded into the target sections table. So 'Convert_Function_Pointer_To_Address' (or whatever it's called) just returns the function pointer. When gdb tries to 'call' that (non-executable) address, a segfault happens. The .opd section corresponding to the function pointer is in the /lib64/ld64.so.1 object file. But wait, there's more! There is another table of sections that is used when the gdb command 'info symbol' is used. If I go: (gdb) p &malloc (gdb) info symbol $1 gdb responds 'malloc is in the .opd section' I don't understand: 1) why are there two section tables? 2) why aren't sections from /lib64/ld64.so.1 being loaded into the target sections table? 3) why is the function pointer for 'malloc' pointing to a plt in the /lib64/ld64.so object and not one in the main executable? I welcome any insight any of you might have. Thanks in advance, -=# Paul Gilliam #=- PS: I have changed jobs and don't work on GDB any more, but this one bug followed me to my new job.