HPUX function address.

Daniel Grunblatt daniel@grunblatt.com.ar
Wed Oct 15 22:49:00 GMT 2003


On Tuesday 14 October 2003 18:31, law@redhat.com wrote:
>
> Nope.  0x207ee is the address of the procedure descriptor.
>
> 0x207ec will contain the function's actual address
> 0x207f0 will contain the function's DP value

(gdb) b 12
Breakpoint 1 at 0x10524: file func.c, line 12.
(gdb) r
Starting program: /house/grunblat/hp-ux/c/func 

Breakpoint 1, main () at func.c:12
12              printf("0x%x\n", (long)func);
(gdb) p func
$1 = {int ()} 0x104fc <func>
(gdb) x/8wx 0x207ec
0x207ec <__DTOR_END__+44>:      0x00020818      0x0000003c      0x40139e88      
0x40174af0
0x207fc <__DTOR_END__+60>:      0x40049c54      0x40174af0      0x000105e8      
0x000206ec
(gdb) x/8wx 0x00020818
0x20818 <__DTOR_END__+88>:      0xea9f1fdd      0xd6801c1e      0x4000c7d8      
0x40026754
0x20828 <_GLOBAL_OFFSET_TABLE_>:        0x00020704      0x40027d08      
0x00000000      0x00000000
(gdb) 

0x207ec doesn't contain it, I was wrong to say HP-UX, it's a linux running on 
hppa, is that the problem? or can I just call  0x00020818 and expect 'func' 
to be reached?

>
> When you dereference the function you get a call to $$dyncall which
> extracts the DP value from the desciptor and stuffs it into $r27, then
> extracts the function's actual address and transfers control to that
> actual address.
>
> GDB does not construct procedure descriptors when you try to print a
> function's address.
>
> FWIW, similar schemes are found on IA-64 as well.
>
>  >Is there a compiler switch I'm missing?
>  >Should I just try another compiler version?
>
> Nope.  This is how things are expected to work on PAs.
>
> jeff

Thanks for your reply,
Daniel Grunblatt.



More information about the Gcc mailing list