A patch for csu/gmon-start.c
H . J . Lu
hjl@valinux.com
Wed Apr 19 11:20:00 GMT 2000
On Wed, Apr 19, 2000 at 08:05:10PM +0200, Mark Kettenis wrote:
> Date: Wed, 19 Apr 2000 10:40:37 -0700
> From: "H . J . Lu" <hjl@valinux.com>
>
> On ia64, the address of a function is not the address of the
> label of the function.
>
> Why is this the case? Looks pretty broken to me. Are you sure this
> *really* is the case, and can you explain why? Are you sure it's not
> some kind of bug in the ia64 toolchain.
That is no bug. That is how function pointer works on ia64.
extern void foo ();
&foo or foo doesn't give you the address of label "foo" on ia64. It
returns the address of the function descriptor for "foo".
>
> Both _start and etext refer to locations in the text segment.
> Declaring them as functions makes sure the addresses are looked up
> right for systems where the text segment uses different addressing as
> the data segment I suppose. You patch changes this!
That is exactly the case for ia64. In this case, we want to the
memory addresses of labels "_start" and "etext".
--
H.J. Lu (hjl@gnu.org)
More information about the Libc-hacker
mailing list