~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to h/ext_sym.h

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
 
 
3
#ifdef HAVE_AOUT 
 
4
#undef BSD
 
5
#undef ATT
 
6
#define BSD  
 
7
#include HAVE_AOUT 
 
8
#endif
 
9
 
 
10
#ifdef _WIN32
 
11
#define TEXT_NSCN 1
 
12
#define DATA_NSCN 2
 
13
#define BSS_NSCN 3
 
14
#endif
 
15
 
 
16
#ifdef AIX3
 
17
#include <a.out.h>
 
18
#endif
 
19
 
 
20
#ifdef COFF_ENCAPSULATE
 
21
#undef BSD
 
22
#undef ATT
 
23
#define BSD
 
24
#include "a.out.encap.h"
 
25
#endif
 
26
 
 
27
#include "ptable.h"
 
28
 
 
29
#ifdef ATT
 
30
#define COFF
 
31
#ifndef TEXT_NSCN
 
32
#define TEXT_NSCN 1
 
33
#define DATA_NSCN 2
 
34
#define BSS_NSCN 3
 
35
#endif
 
36
#endif
 
37
 
 
38
 
 
39
#ifdef ATT
 
40
#include <filehdr.h>
 
41
#include <scnhdr.h>
 
42
#include <syms.h>
 
43
/* is aouthdr.h one always here on sysv
 
44
   Interactive systems needs it now at least.   I am not sure if
 
45
   the others used to include this...
 
46
 */
 
47
#include <aouthdr.h>
 
48
#define MAXPATHLEN 200
 
49
#define N_BADMAG(x)  !(ISCOFF(x.f_magic))
 
50
#define N_SYMOFF(x) (x).f_symptr
 
51
#define NSYMS(x) (x).f_nsyms  
 
52
#include <reloc.h>
 
53
#endif
 
54
 
 
55
 
 
56
 
 
57
 
 
58
#define RDONLY "r"
 
59
 
 
60
#ifdef BSD
 
61
#define filehdr exec
 
62
#ifndef AIX
 
63
#ifndef reloc  
 
64
#define reloc relocation_info
 
65
#endif
 
66
#endif
 
67
#define NSYMS(f) ((unsigned int )((f).a_syms/(sizeof(struct nlist))))
 
68
 
 
69
#ifndef AIX
 
70
#define syment nlist
 
71
#endif
 
72
 
 
73
#ifndef SYMESZ  
 
74
#define SYMESZ (sizeof(struct nlist))
 
75
#endif
 
76
 
 
77
#ifndef  SYMNMLEN
 
78
  /* no symbols are directly in the table */
 
79
#define SYMNMLEN 0  
 
80
#endif
 
81
 
 
82
#ifndef  EXT_and_TEXT_BSS_DAT
 
83
#define EXT_and_TEXT_BSS_DAT(p) (((p)->n_type & N_EXT) && \
 
84
  ((p)->n_type & (N_TEXT | N_DATA | N_BSS)))
 
85
#endif
 
86
 
 
87
#ifndef SYM_NAME
 
88
#define SYM_NAME(x) (my_string_table+(x)->n_un.n_strx)
 
89
#endif
 
90
 
 
91
#ifndef NUM_AUX  
 
92
#define NUM_AUX(p) 0
 
93
#endif  
 
94
 
 
95
#ifndef N_RELOFF  
 
96
#define N_RELOFF(p) (N_TXTOFF(p) +(p).a_text+(p).a_data )
 
97
#endif
 
98
 
 
99
#define NTYPE(sym) ((sym)->n_type & N_TYPE)
 
100
 
 
101
#ifndef N_SECTION
 
102
#define N_SECTION(sym) (sym->n_type & N_TYPE & ~N_EXT)
 
103
#endif 
 
104
 
 
105
#define N_UNDEF N_UNDF
 
106
#endif /*end bsd */
 
107
 
 
108
#ifdef HPUX
 
109
#define nlist nlist_
 
110
#undef syment
 
111
struct syment {
 
112
        long    n_value;
 
113
        unsigned char   n_type;
 
114
        unsigned char   n_length;
 
115
        short   n_almod;
 
116
        short   n_unused;
 
117
        union { long n_strx;} n_un;
 
118
};
 
119
 
 
120
#endif /* Hp */
 
121
 
 
122
#ifdef COFF /* sys v */
 
123
#ifndef EXT_and_TEXT_BSS_DAT
 
124
#define EXT_and_TEXT_BSS_DAT(p) \
 
125
 ((1 <= (p)->n_scnum) && ((p)->n_scnum <= 3 ) && (p)->n_sclass == C_EXT)
 
126
#endif
 
127
#define NUM_AUX(p) (p)->n_numaux
 
128
#define N_TXTOFF(p)  section[1].s_scnptr
 
129
#define SYM_NAME(p) \
 
130
  (((p)->n_zeroes == 0) ? \
 
131
            &my_string_table[(p)->n_offset] : \
 
132
               ((p)->n_name[SYMNMLEN -1] ? \
 
133
                                 (strncpy(tem,(p)->n_name,  \
 
134
                                           SYMNMLEN), \
 
135
                                  (char *)tem) : \
 
136
                                  (p)->n_name ))
 
137
             
 
138
#define NTYPE(sym) (sym)->n_scnum
 
139
 
 
140
#endif /* COFF */
 
141
 
 
142
 
 
143