This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

Re: A patch for csu/gmon-start.c


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)

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