[parisc-linux] [PATCH-2.5] Various cleanups

John David Anglin dave@hiauly1.hia.nrc.ca
Mon, 12 May 2003 12:24:21 -0400 (EDT)


> how does that work? __c_f_f_c is emitted by the compiler internally,
> right? how can we define an inline version of this function?

Dooh, you are correct.  I wrote a little test program and the libcall
doesn't get inlined.

So if no canonicalization is needed, you want something like:

typedef int (*fptr_t) (void);

unsigned int __canonicalize_funcptr_for_compare (fptr_t)
      __attribute__ ((visibility ("hidden")));

unsigned int
__canonicalize_funcptr_for_compare (fptr)
   fptr_t fptr;
{
  return (unsigned int)fptr;
}

The libgcc version is hidden.  That's because shared libraries need
their own copy which accesses the got table in the shared library.
Probably in the kernel implementation, a single copy of the routine
is sufficient and you don't want the hidden attibute.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)