/* Subroutine for function pointer canonicalization on PA-RISC with ELF32.
- Copyright 2002 Free Software Foundation, Inc.
+ Copyright 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
Contributed by John David Anglin (dave.anglin@nrc.ca).
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
/* WARNING: The code is this function depends on internal and undocumented
details of the GNU linker and dynamic loader as implemented for parisc
__attribute__ ((visibility ("hidden")));
unsigned int
-__canonicalize_funcptr_for_compare (fptr)
- fptr_t fptr;
+__canonicalize_funcptr_for_compare (fptr_t fptr)
{
static unsigned int fixup_plabel[2];
static fixup_t fixup;
unsigned int *plabel, *got;
- /* -1 is special. It is used in crtend to mark the end of a list of
- function pointers. Also return immediately if the plabel bit is
- not set in the function pointer. In this case, the function pointer
- points directly to the function. */
- if ((int) fptr == -1 || !((int) fptr & 2))
+ /* -1 and page 0 are special. -1 is used in crtend to mark the end of
+ a list of function pointers. Also return immediately if the plabel
+ bit is not set in the function pointer. In this case, the function
+ pointer points directly to the function. */
+ if ((int) fptr == -1 || (unsigned int) fptr < 4096 || !((int) fptr & 2))
return (unsigned int) fptr;
/* The function pointer points to a function descriptor (plabel). If
/* Find the first "bl" branch in the offset search list. This is a
call to fixup or a magic branch to fixup at the beginning of the
trampoline template. The fixup function does the actual runtime
- resolution of function decriptors. We only look for "bl" branches
+ resolution of function descriptors. We only look for "bl" branches
with a 17-bit pc-relative displacement. */
for (i = 0; i < NOFFSETS; i++)
{