From c0dfd91f4ec332ad7732778c19a36cea393adfdf Mon Sep 17 00:00:00 2001 From: "Guillermo J. Rozas" Date: Sat, 12 Jun 1993 22:31:31 +0000 Subject: [PATCH] GCC now supports shared libraries in HP-UX. The closure hack has to be used with it as well. --- v7/src/microcode/cmpintmd/hppa.h | 43 ++++++++++---------------------- v8/src/microcode/cmpintmd/hppa.h | 43 ++++++++++---------------------- 2 files changed, 26 insertions(+), 60 deletions(-) diff --git a/v7/src/microcode/cmpintmd/hppa.h b/v7/src/microcode/cmpintmd/hppa.h index 166c49df1..92c5aff06 100644 --- a/v7/src/microcode/cmpintmd/hppa.h +++ b/v7/src/microcode/cmpintmd/hppa.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: hppa.h,v 1.39 1993/02/06 06:03:53 gjr Exp $ +$Id: hppa.h,v 1.40 1993/06/12 22:31:31 gjr Exp $ Copyright (c) 1989-1993 Massachusetts Institute of Technology @@ -92,19 +92,7 @@ typedef unsigned short format_word; pointers. We don't want that for the assembly language entry points. */ -#ifdef __GNUC__ - /* Under GCC version 1, function pointers are NOT closures. - Under version 2.2.2, they are not closures either. - */ -# if (__GNUC__ >= 3) -# include "Fix cmpint-hppa.h to define C_FUNC_PTR_IS_CLOSURE if necessary" -# endif -#else /* Assume HP C -- Test for HP-UX >= 8.0 */ -# include -# ifdef SHL_MAGIC -# define C_FUNC_PTR_IS_CLOSURE -# endif -#endif +#define C_FUNC_PTR_IS_CLOSURE #ifndef C_FUNC_PTR_IS_CLOSURE # define interface_to_C ep_interface_to_C @@ -781,22 +769,17 @@ DEFUN (transform_procedure_table, (table_length, old_table), for (counter = 0; counter < table_length; counter++) { -#ifdef C_FUNC_PTR_IS_CLOSURE - char * C_closure, * blp; - long offset; - - /* This is correct for HP C for HP-UX >= 8.0. - Is it also correct for GCC 2? - */ - - C_closure = ((char *) (old_table [counter])); - blp = (* ((char **) (C_closure - 2))); - blp = ((char *) (((unsigned long) blp) & ~3)); - offset = (assemble_17 (* ((union ble_inst *) blp))); - new_table[counter] = ((PTR) ((blp + 8) + offset)); -#else - new_table[counter] = ((PTR) (old_table [counter])); -#endif + char * C_closure = ((char *) (old_table [counter])); + if ((((unsigned long) C_closure) & 0x3) == 0x2) + { + long offset; + char * blp = (* ((char **) (C_closure - 2))); + blp = ((char *) (((unsigned long) blp) & ~3)); + offset = (assemble_17 (* ((union ble_inst *) blp))); + new_table[counter] = ((PTR) ((blp + 8) + offset)); + } + else + new_table[counter] = ((PTR) (old_table [counter])); } return (new_table); } diff --git a/v8/src/microcode/cmpintmd/hppa.h b/v8/src/microcode/cmpintmd/hppa.h index 166c49df1..92c5aff06 100644 --- a/v8/src/microcode/cmpintmd/hppa.h +++ b/v8/src/microcode/cmpintmd/hppa.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: hppa.h,v 1.39 1993/02/06 06:03:53 gjr Exp $ +$Id: hppa.h,v 1.40 1993/06/12 22:31:31 gjr Exp $ Copyright (c) 1989-1993 Massachusetts Institute of Technology @@ -92,19 +92,7 @@ typedef unsigned short format_word; pointers. We don't want that for the assembly language entry points. */ -#ifdef __GNUC__ - /* Under GCC version 1, function pointers are NOT closures. - Under version 2.2.2, they are not closures either. - */ -# if (__GNUC__ >= 3) -# include "Fix cmpint-hppa.h to define C_FUNC_PTR_IS_CLOSURE if necessary" -# endif -#else /* Assume HP C -- Test for HP-UX >= 8.0 */ -# include -# ifdef SHL_MAGIC -# define C_FUNC_PTR_IS_CLOSURE -# endif -#endif +#define C_FUNC_PTR_IS_CLOSURE #ifndef C_FUNC_PTR_IS_CLOSURE # define interface_to_C ep_interface_to_C @@ -781,22 +769,17 @@ DEFUN (transform_procedure_table, (table_length, old_table), for (counter = 0; counter < table_length; counter++) { -#ifdef C_FUNC_PTR_IS_CLOSURE - char * C_closure, * blp; - long offset; - - /* This is correct for HP C for HP-UX >= 8.0. - Is it also correct for GCC 2? - */ - - C_closure = ((char *) (old_table [counter])); - blp = (* ((char **) (C_closure - 2))); - blp = ((char *) (((unsigned long) blp) & ~3)); - offset = (assemble_17 (* ((union ble_inst *) blp))); - new_table[counter] = ((PTR) ((blp + 8) + offset)); -#else - new_table[counter] = ((PTR) (old_table [counter])); -#endif + char * C_closure = ((char *) (old_table [counter])); + if ((((unsigned long) C_closure) & 0x3) == 0x2) + { + long offset; + char * blp = (* ((char **) (C_closure - 2))); + blp = ((char *) (((unsigned long) blp) & ~3)); + offset = (assemble_17 (* ((union ble_inst *) blp))); + new_table[counter] = ((PTR) ((blp + 8) + offset)); + } + else + new_table[counter] = ((PTR) (old_table [counter])); } return (new_table); } -- 2.25.1