home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / gnu / utils / bug / 1390 < prev    next >
Encoding:
Text File  |  1992-08-20  |  5.4 KB  |  164 lines

  1. Newsgroups: gnu.utils.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!martigny.ai.mit.edu!cph
  3. From: cph@martigny.ai.mit.edu (Chris Hanson)
  4. Subject: gas compile bug? under hp-ux
  5. Message-ID: <9208201710.AA15527@life.ai.mit.edu>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. References: <"12433_Thu_Aug_13_16: 24:03_1992"@bnr.ca>
  9. Distribution: gnu
  10. Date: Thu, 20 Aug 1992 09:14:33 GMT
  11. Approved: bug-gnu-utils@prep.ai.mit.edu
  12. Lines: 150
  13.  
  14.    Date: Thu, 13 Aug 1992 16:00:00 +0000 
  15.    From: "Jeff (J.) Hayes" <jjhayes@x400gate.bnr.ca>
  16.  
  17.    I have sent this to Chris Hanson as he appeared to be the author
  18.    of the hpux mods, and twice as he is given 2 diff addr's in the
  19.    ChangeLog file.
  20.  
  21.    hope you don't mind chris.
  22.  
  23.    on to the bug report:
  24.    A description of exactly what went wrong.
  25.  
  26.    [...]
  27.  
  28.    /*  the issue here is that EXEC_MACHINE_TYPE exposes   the_exec.a_machtype
  29.    to the compiler which is also undefined.
  30.    I was able to follow the "struct exec" typedef in a.out.gnu.h but got lost
  31.    in the macros.  is there a macro resolving .a_machtyp to one of the 
  32.    defined fields?
  33.  
  34.    i also noted that EXEC_VERSION on the lines following is only def'd in the
  35.    Makefile for Sequent machines - this leads my to believe there should have
  36.    been some kind of -DHP9000S200_ID=??? switch to define its value.
  37.    */
  38.  
  39.    so can you help me out?
  40.  
  41.    jeff hayes                (416) 452-3894         ESN 333-3894
  42.                  Northern Telecom, Public Switching Division 
  43.    jjhayes@400gate.bnr.ca    Product Technology, Bramalea Ont Can
  44.  
  45. Fortunately, this bug has occurred before.  Here's what's wrong: HP-UX
  46. needs a special a.out.h file, called "a.out.hpux.h", and
  47. "struc-symbol.h" needs to be modified to use it.  This code was
  48. mistakenly removed from GAS for the 1.38 release.  Here it is:
  49.  
  50.  
  51. *** struc-symbol.h.~1~    Fri Jul  6 14:43:12 1990
  52. --- struc-symbol.h    Thu Sep  5 19:29:55 1991
  53. ***************
  54. *** 17,26 ****
  55.   along with GAS; see the file COPYING.  If not, write to
  56.   the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  57.   
  58. ! #ifndef        VMS
  59. ! #include "a.out.gnu.h"        /* Needed to define struct nlist. Sigh. */
  60.   #else
  61.   #include "a_out.h"
  62.   #endif
  63.   
  64.   struct symbol            /* our version of an nlist node */
  65. --- 17,31 ----
  66.   along with GAS; see the file COPYING.  If not, write to
  67.   the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  68.   
  69. ! /* Needed to define struct nlist. Sigh. */
  70. ! #ifdef hpux
  71. ! #include "a.out.hpux.h"
  72.   #else
  73. + #ifndef VMS
  74. + #include "a.out.gnu.h"
  75. + #else
  76.   #include "a_out.h"
  77. + #endif
  78.   #endif
  79.   
  80.   struct symbol            /* our version of an nlist node */
  81.  
  82.  
  83. ----------------------- a.out.hpux.h ---------------------------
  84. /* Special version of <a.out.h> for use under hp-ux.
  85.    Copyright (C) 1988 Free Software Foundation, Inc.
  86.  
  87.    This file is free software; you can redistribute it and/or modify
  88.    it under the terms of the GNU General Public License as published by
  89.    the Free Software Foundation; either version 1, or (at your option)
  90.    any later version.
  91.  
  92.    This file is distributed in the hope that it will be useful,
  93.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  94.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  95.    GNU General Public License for more details.
  96.  
  97.    You should have received a copy of the GNU General Public License
  98.    along with this file; if not, write to the Free Software
  99.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  100.  
  101. /* The `exec' structure and overall layout must be close to HP's when
  102.    we are running on an HP system, otherwise we will not be able to
  103.    execute the resulting file. */
  104.  
  105. /* Allow this file to be included twice. */
  106. #ifndef __GNU_EXEC_MACROS__
  107.  
  108. struct exec
  109. {
  110.   unsigned short a_machtype;    /* machine type */
  111.   unsigned short a_info;    /* magic number */
  112.   unsigned long a_spare1;
  113.   unsigned long a_spare2;
  114.   unsigned long a_text;        /* length of text, in bytes */
  115.   unsigned long a_data;        /* length of data, in bytes */
  116.   unsigned long a_bss;        /* length of uninitialized data area for file, in bytes */
  117.   unsigned long a_trsize;    /* length of relocation info for text, in bytes */
  118.   unsigned long a_drsize;    /* length of relocation info for data, in bytes */
  119.   unsigned long a_spare3;    /* HP = pascal interface size */
  120.   unsigned long a_spare4;    /* HP = symbol table size */
  121.   unsigned long a_spare5;    /* HP = debug name table size */
  122.   unsigned long a_entry;    /* start address */
  123.   unsigned long a_spare6;    /* HP = source line table size */
  124.   unsigned long a_spare7;    /* HP = value table size */
  125.   unsigned long a_syms;        /* length of symbol table data in file, in bytes */
  126.   unsigned long a_spare8;
  127. };
  128.  
  129. /* Tell a.out.gnu.h not to define `struct exec'.  */
  130. #define __STRUCT_EXEC_OVERRIDE__
  131.  
  132. #include "a.out.gnu.h"
  133.  
  134. #undef N_MAGIC
  135. #undef N_MACHTYPE
  136. #undef N_FLAGS
  137. #undef N_SET_INFO
  138. #undef N_SET_MAGIC
  139. #undef N_SET_MACHTYPE
  140. #undef N_SET_FLAGS
  141.  
  142. #define N_MAGIC(exec) ((exec) . a_magic)
  143. #define N_MACHTYPE(exec) ((exec) . a_machtype)
  144. #define N_SET_MAGIC(exec, magic) (((exec) . a_magic) = (magic))
  145. #define N_SET_MACHTYPE(exec, machtype) (((exec) . a_machtype) = (machtype))
  146.  
  147. #undef N_BADMAG
  148. #define N_BADMAG(x) ((_N_BADMAG (x)) || (_N_BADMACH (x)))
  149.  
  150. #define _N_BADMACH(x)                            \
  151. (((N_MACHTYPE (x)) != HP9000S200_ID) &&                    \
  152.  ((N_MACHTYPE (x)) != HP98x6_ID))
  153.  
  154. #define HP98x6_ID 0x20A
  155. #define HP9000S200_ID 0x20C
  156.  
  157. #undef _N_HDROFF
  158. #define _N_HDROFF(x) (SEGMENT_SIZE - (sizeof (struct exec)))
  159.  
  160. #define SEGMENT_SIZE 0x1000
  161.  
  162. #endif /* __GNU_EXEC_MACROS__ */
  163.  
  164.