Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* /lib64/ld64.so.1 not being added to target sections list on ppc64
@ 2007-02-06  1:33 Paul Gilliam
  2007-02-06  1:50 ` Daniel Jacobowitz
  2007-02-06  9:59 ` Andreas Schwab
  0 siblings, 2 replies; 3+ messages in thread
From: Paul Gilliam @ 2007-02-06  1:33 UTC (permalink / raw)
  To: gdb

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-06  9:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-06  1:33 /lib64/ld64.so.1 not being added to target sections list on ppc64 Paul Gilliam
2007-02-06  1:50 ` Daniel Jacobowitz
2007-02-06  9:59 ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox