* /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
* Re: /lib64/ld64.so.1 not being added to target sections list on ppc64
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
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2007-02-06 1:50 UTC (permalink / raw)
To: Paul Gilliam; +Cc: gdb
On Mon, Feb 05, 2007 at 05:33:21PM -0800, Paul Gilliam wrote:
> 1) why are there two section tables?
History. Hard to change, but probably advisable to change. I believe
the problems will mostly deal with relocation and applying offsets to
sections.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: /lib64/ld64.so.1 not being added to target sections list on ppc64
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
1 sibling, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2007-02-06 9:59 UTC (permalink / raw)
To: Paul Gilliam; +Cc: gdb
Paul Gilliam <gilliam@us.ibm.com> writes:
> 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?
The problem is that there are two malloc implementation, the early one in
ld64.so and the real one in libc.so. Unless you have debugging symbols
for libc.so the real one is never found.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ 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