Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Paul Gilliam <gilliam@us.ibm.com>
To: gdb@sourceware.org
Subject: /lib64/ld64.so.1 not being added to target sections list on ppc64
Date: Tue, 06 Feb 2007 01:33:00 -0000	[thread overview]
Message-ID: <OF2F87BDDD.E08F3E42-ON8825727A.00065CB6-8825727A.00088C21@us.ibm.com> (raw)

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.


             reply	other threads:[~2007-02-06  1:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-06  1:33 Paul Gilliam [this message]
2007-02-06  1:50 ` Daniel Jacobowitz
2007-02-06  9:59 ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OF2F87BDDD.E08F3E42-ON8825727A.00065CB6-8825727A.00088C21@us.ibm.com \
    --to=gilliam@us.ibm.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox