[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#193656: [hppa] patch to fix funcptr for _start



Package: glibc
Version: 2.3.1-17
Severity: important

hppa uses function descriptors, so we need a sysdeps/hppa/elf/entry.h
(similar to ppc64, ia64, etc). There used to be a kernel workaround for
this in 2.4, but we've removed it in 2.5 and this needs to be fixed
properly. Will be submitting upstream shortly.

dpatch attached. please apply.

randolph
-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/
#! /bin/sh -e

# All lines beginning with `# DP:' are a description of the patch.
# DP: Description: Define entry.h properly for hppa -- we have func descriptors
# DP: Author: Randolph Chung <tausq@debian.org>
# DP: Upstream status: Pending
# DP: Status Details: will be submitted upstream
# DP: Date: Thu, 15 May 2003 22:31:50 -0700

if [ $# -ne 2 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
    -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
    *)
	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
	exit 1
esac
exit 0

2003-05-15  Randolph Chung  <tausq@debian.org>

	* sysdep/hppa/elf/entry.h: New file.

--- glibc/sysdeps/hppa/elf/entry.h	2003-05-15 22:29:52.000000000 -0700
+++ glibc/sysdeps/hppa/elf/entry.h	2003-05-15 22:29:52.000000000 -0700
@@ -0,0 +1,10 @@
+#ifndef __ASSEMBLY__
+extern void _start (void);
+#endif
+
+/* The function's entry point is stored in the first word of the
+   function descriptor (plabel) of _start().  */
+#define ENTRY_POINT (*(long *)(((long)_start) & ~2))
+
+/* We have to provide a special declaration.  */
+#define ENTRY_POINT_DECL(class) class void _start (void);

Reply to: