This is the mail archive of the gdb@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]

/lib64/ld64.so.1 not being added to target sections list on ppc64


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.


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