|
|
1.1 ! root 1: /* OSF/rose half-pic support functions. ! 2: Copyright (C) 1992 Free Software Foundation, Inc. ! 3: ! 4: This file is part of GNU CC. ! 5: ! 6: GNU CC is free software; you can redistribute it and/or modify ! 7: it under the terms of the GNU General Public License as published by ! 8: the Free Software Foundation; either version 2, or (at your option) ! 9: any later version. ! 10: ! 11: GNU CC is distributed in the hope that it will be useful, ! 12: but WITHOUT ANY WARRANTY; without even the implied warranty of ! 13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! 14: GNU General Public License for more details. ! 15: ! 16: You should have received a copy of the GNU General Public License ! 17: along with GNU CC; see the file COPYING. If not, write to ! 18: the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ ! 19: ! 20: /* The OSF/rose half-pic model assumes that the non-library code does ! 21: not need to have full PIC (position independent code), but rather, ! 22: that pointers to external references are put into the data section ! 23: and derefenced as normal pointers. References to static data does ! 24: not need to be PIC-ized. ! 25: ! 26: Another optimization is to have the compiler know what symbols are ! 27: in the shared libraries, and to only lay down the pointers to ! 28: things which in the library proper. */ ! 29: ! 30: #include "config.h" ! 31: ! 32: #ifdef HALF_PIC_INIT ! 33: ! 34: #include "tree.h" ! 35: #include "rtl.h" ! 36: #include <stdio.h> ! 37: ! 38: extern rtx eliminate_constant_term (); ! 39: ! 40: int flag_half_pic; /* Global half-pic flag. */ ! 41: ! 42: ! 43: /* Do any half-pic initializations. */ ! 44: ! 45: void ! 46: half_pic_init () ! 47: { ! 48: flag_half_pic = TRUE; ! 49: } ! 50: ! 51: ! 52: /* Encode in a declaration whether or not it is half-pic. */ ! 53: ! 54: void ! 55: half_pic_encode (decl) ! 56: tree decl; ! 57: { ! 58: #if 0 ! 59: fprintf (stderr, "\n========== Half_pic_encode\n"); ! 60: debug_tree (decl); ! 61: #endif ! 62: } ! 63: ! 64: ! 65: /* Return whether an address is half-pic. */ ! 66: ! 67: int ! 68: half_pic_address_p (addr) ! 69: rtx addr; ! 70: { ! 71: int offset; ! 72: char *name; ! 73: ! 74: switch (GET_CODE (addr)) ! 75: { ! 76: case CONST: ! 77: offset = 0; ! 78: addr = eliminate_constant_term (addr, &offset); ! 79: if (GET_CODE (addr) != SYMBOL_REF) ! 80: return FALSE; ! 81: ! 82: /* fall through */ ! 83: ! 84: case SYMBOL_REF: ! 85: name = XSTR (addr, 0); ! 86: ! 87: /* If this is a label, it will have a '*' in front of it. */ ! 88: if (name[0] == '*') ! 89: return FALSE; ! 90: } ! 91: ! 92: return FALSE; ! 93: } ! 94: ! 95: #endif /* HALF_PIC_INIT */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.