[parisc-linux] [PATCH-2.5] Various cleanups
John David Anglin
dave@hiauly1.hia.nrc.ca
Mon, 12 May 2003 10:58:48 -0400 (EDT)
> > I'm not applying these bits. It's just not reasonable to add (void *)
> > casts to every function pointer comparison. I know Linus will reject it.
> > We need to find a better way to fix this one -- and I suspect the right
> > way is to implement a __canonicalize_funcptr_for_compare in the kernel
> > and EXPORT_SYMBOL it.
>
> I thougt about that, but didn't do it this way because I didn't like the
> approach to double libgcc's __canonicalize_funcptr_for_compare. Maybe
> we'd simply find a way to EXPORT_SYMBOL libgcc's version of that one...
No, you don't want to use the libgcc version as it is specific to
user programs. A kernel version is needed. I think all that needs to
be done is return the function pointer passed to it. It should totally
disappear if inlined. Thus, __canonicalize_funcptr_for_compare could
be defined in a header.
It might actually be necessary to do function pointer canonicalization
in the kernel in situations involving loadable modules. One would
have to look at how the loader manages the plabels.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)