]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - ld/deffile.h
19990502 sourceware import
[thirdparty/binutils-gdb.git] / ld / deffile.h
1 /* deffile.h - header for .DEF file parser
2 Copyright (C) 1998, 1999 Free Software Foundation, Inc.
3 Written by DJ Delorie dj@cygnus.com
4
5 This file is part of GLD, the Gnu Linker.
6
7 GLD is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GLD is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GLD; see the file COPYING. If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA. */
21
22 #include "ansidecl.h"
23
24 /* DEF storage definitions. Note that any ordinal may be zero, and
25 any pointer may be NULL, if not defined by the DEF file. */
26
27 typedef struct def_file_section
28 {
29 char *name; /* always set */
30 char *class; /* may be NULL */
31 char flag_read, flag_write, flag_execute, flag_shared;
32 }
33 def_file_section;
34
35 typedef struct def_file_export
36 {
37 char *name; /* always set */
38 char *internal_name; /* always set, may == name */
39 int ordinal; /* -1 if not specified */
40 int hint;
41 char flag_private, flag_constant, flag_noname, flag_data;
42 }
43 def_file_export;
44
45 typedef struct def_file_module
46 {
47 struct def_file_module *next;
48 void *user_data;
49 char name[1]; /* extended via malloc */
50 }
51 def_file_module;
52
53 typedef struct def_file_import
54 {
55 char *internal_name; /* always set */
56 def_file_module *module; /* always set */
57 char *name; /* may be NULL; either this or ordinal will be set */
58 int ordinal; /* may be -1 */
59 }
60 def_file_import;
61
62 typedef struct def_file
63 {
64
65 /* from the NAME or LIBRARY command */
66 char *name;
67 int is_dll; /* -1 if NAME/LIBRARY not given */
68 bfd_vma base_address; /* (bfd_vma)(-1) if unspecified */
69
70 /* from the DESCRIPTION command */
71 char *description;
72
73 /* from the STACK/HEAP command, -1 if unspecified */
74 int stack_reserve, stack_commit;
75 int heap_reserve, heap_commit;
76
77 /* from the SECTION/SEGMENT commands */
78 int num_section_defs;
79 def_file_section *section_defs;
80
81 /* from the EXPORTS commands */
82 int num_exports;
83 def_file_export *exports;
84
85 /* used by imports for module names */
86 def_file_module *modules;
87
88 /* from the IMPORTS commands */
89 int num_imports;
90 def_file_import *imports;
91
92 /* from the VERSION command, -1 if not specified */
93 int version_major, version_minor;
94 }
95 def_file;
96
97 extern def_file *def_file_empty PARAMS ((void));
98
99 /* add_to may be NULL. If not, this .def is appended to it */
100 extern def_file *def_file_parse PARAMS ((const char *_filename,
101 def_file * _add_to));
102
103 extern void def_file_free PARAMS ((def_file * _def));
104
105 extern def_file_export *def_file_add_export PARAMS ((def_file * _def,
106 const char *_name,
107 const char *_internal_name,
108 int _ordinal));
109
110 extern def_file_import *def_file_add_import PARAMS ((def_file * _def,
111 const char *_name,
112 const char *_from,
113 int _ordinal,
114 const char *_imported_name));
115
116 extern void def_file_add_directive PARAMS ((def_file * _def,
117 const char *param,
118 int len));
119
120 #ifdef DEF_FILE_PRINT
121 extern void def_file_print PARAMS ((FILE * _file,
122 def_file * _def));
123 #endif