1#ifndef _STRUC_SYMBOL_H_
2#define _STRUC_SYMBOL_H_
3/* struct_symbol.h - Internal symbol structure
4   Copyright (C) 1987 Free Software Foundation, Inc.
5
6This file is part of GAS, the GNU Assembler.
7
8GAS is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 1, or (at your option)
11any later version.
12
13GAS is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with GAS; see the file COPYING.  If not, write to
20the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
21
22#ifdef NeXT_MOD
23#include "arch64_32.h"
24#import <mach-o/nlist.h>
25#else /* !defined(NeXT_MOD) */
26#ifndef		VMS
27#include "a.out.h"		/* Needed to define struct nlist. Sigh. */
28#else
29#include "a_out.h"
30#endif
31#endif /* defined(NeXT_MOD) */
32
33struct symbol			/* our version of an nlist node */
34{
35  nlist_t	sy_nlist;	/* what we write in .o file (if permitted) */
36  char		*sy_name;	/* symbol name */
37  uint32_t sy_name_offset;	/* 1-origin position of sy_name in symbols */
38				/* part of object file. */
39				/* 0 for (nameless) .stabd symbols. */
40				/* Not used until write_object() time. */
41  uint32_t	sy_number;	/* 24 bit symbol number. */
42				/* Symbol numbers start at 0 and are */
43				/* unsigned. */
44  struct symbol *sy_prev_by_index;	/* backward chain, or NULL */
45  int		sy_has_been_resolved;	/* if true the next fieid is set */
46  struct symbol *sy_prev_resolved;	/* first non local in backward chain */
47  struct symbol *sy_next;	/* forward chain, or NULL */
48  struct frag   *sy_frag;	/* NULL or -> frag this symbol attaches to. */
49  struct symbol *sy_forward;	/* value is really that of this other symbol */
50  void *expression;
51/* FROM line tc-arm.h 104 */
52#define TC_SYMFIELD_TYPE 	unsigned int
53#ifdef TC_SYMFIELD_TYPE
54  TC_SYMFIELD_TYPE sy_tc;
55#endif
56};
57
58typedef struct symbol symbolS;
59
60/* sy_name - Name field always points to a string. */
61/* 	     0 means .stabd-like anonymous symbol. */
62#define sy_type 	sy_nlist.	n_type
63#ifdef NeXT_MOD
64#define sy_other	sy_nlist.	n_sect
65#else
66#define sy_other	sy_nlist.	n_other
67#endif
68#define sy_desc		sy_nlist.	n_desc
69#define sy_value	sy_nlist.	n_value
70				/* Value of symbol is this value + object */
71				/* file address of sy_frag. */
72typedef signed_target_addr_t valueT;	/* The type of n_value. Helps casting. */
73
74struct indirect_symbol {
75  char			 *isy_name;	/* name of the indirect */
76  struct frag   	 *isy_frag;	/* frag this indirect attaches to */
77  uint32_t		  isy_offset;	/* offset into frag this attaches to */
78  struct symbol		 *isy_symbol;	/* symbol for the indirect */
79  struct indirect_symbol *isy_next;	/* forward chain, or NULL */
80};
81typedef struct indirect_symbol isymbolS;
82#endif /* _STRUC_SYMBOL_H_ */
83