1999-05-03 07:29:11 +00:00
|
|
|
/* deffile.h - header for .DEF file parser
|
2003-01-28 11:39:43 +00:00
|
|
|
Copyright 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
|
1999-05-03 07:29:11 +00:00
|
|
|
Written by DJ Delorie dj@cygnus.com
|
|
|
|
|
|
|
|
This file is part of GLD, the Gnu Linker.
|
|
|
|
|
|
|
|
GLD is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
GLD is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with GLD; see the file COPYING. If not, write to the Free
|
2005-05-12 07:32:09 +00:00
|
|
|
Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
|
|
|
|
02110-1301, USA. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
1999-09-12 15:27:48 +00:00
|
|
|
#ifndef DEFFILE_H
|
|
|
|
#define DEFFILE_H
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
/* DEF storage definitions. Note that any ordinal may be zero, and
|
2000-09-29 13:21:41 +00:00
|
|
|
any pointer may be NULL, if not defined by the DEF file. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
2000-10-11 00:16:07 +00:00
|
|
|
typedef struct def_file_section {
|
|
|
|
char *name; /* always set */
|
|
|
|
char *class; /* may be NULL */
|
|
|
|
char flag_read, flag_write, flag_execute, flag_shared;
|
|
|
|
} def_file_section;
|
|
|
|
|
|
|
|
typedef struct def_file_export {
|
|
|
|
char *name; /* always set */
|
|
|
|
char *internal_name; /* always set, may == name */
|
|
|
|
int ordinal; /* -1 if not specified */
|
|
|
|
int hint;
|
2006-01-31 22:08:14 +00:00
|
|
|
char flag_private, flag_constant, flag_noname, flag_data, flag_forward;
|
2000-10-11 00:16:07 +00:00
|
|
|
} def_file_export;
|
|
|
|
|
|
|
|
typedef struct def_file_module {
|
|
|
|
struct def_file_module *next;
|
|
|
|
void *user_data;
|
|
|
|
char name[1]; /* extended via malloc */
|
|
|
|
} def_file_module;
|
|
|
|
|
|
|
|
typedef struct def_file_import {
|
|
|
|
char *internal_name; /* always set */
|
|
|
|
def_file_module *module; /* always set */
|
|
|
|
char *name; /* may be NULL; either this or ordinal will be set */
|
|
|
|
int ordinal; /* may be -1 */
|
2002-12-16 18:02:16 +00:00
|
|
|
int data; /* = 1 if data */
|
2000-10-11 00:16:07 +00:00
|
|
|
} def_file_import;
|
|
|
|
|
|
|
|
typedef struct def_file {
|
2002-12-16 18:02:16 +00:00
|
|
|
/* From the NAME or LIBRARY command. */
|
2000-10-11 00:16:07 +00:00
|
|
|
char *name;
|
|
|
|
int is_dll; /* -1 if NAME/LIBRARY not given */
|
|
|
|
bfd_vma base_address; /* (bfd_vma)(-1) if unspecified */
|
|
|
|
|
2002-12-16 18:02:16 +00:00
|
|
|
/* From the DESCRIPTION command. */
|
2000-10-11 00:16:07 +00:00
|
|
|
char *description;
|
|
|
|
|
2002-12-16 18:02:16 +00:00
|
|
|
/* From the STACK/HEAP command, -1 if unspecified. */
|
2000-10-11 00:16:07 +00:00
|
|
|
int stack_reserve, stack_commit;
|
|
|
|
int heap_reserve, heap_commit;
|
|
|
|
|
2002-12-16 18:02:16 +00:00
|
|
|
/* From the SECTION/SEGMENT commands. */
|
2000-10-11 00:16:07 +00:00
|
|
|
int num_section_defs;
|
|
|
|
def_file_section *section_defs;
|
|
|
|
|
2002-12-16 18:02:16 +00:00
|
|
|
/* From the EXPORTS commands. */
|
2000-10-11 00:16:07 +00:00
|
|
|
int num_exports;
|
|
|
|
def_file_export *exports;
|
|
|
|
|
2002-12-16 18:02:16 +00:00
|
|
|
/* Used by imports for module names. */
|
2000-10-11 00:16:07 +00:00
|
|
|
def_file_module *modules;
|
|
|
|
|
2002-12-16 18:02:16 +00:00
|
|
|
/* From the IMPORTS commands. */
|
2000-10-11 00:16:07 +00:00
|
|
|
int num_imports;
|
|
|
|
def_file_import *imports;
|
|
|
|
|
2002-12-16 18:02:16 +00:00
|
|
|
/* From the VERSION command, -1 if not specified. */
|
2000-10-11 00:16:07 +00:00
|
|
|
int version_major, version_minor;
|
|
|
|
} def_file;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
2003-06-28 05:28:54 +00:00
|
|
|
extern def_file *def_file_empty (void);
|
1999-05-03 07:29:11 +00:00
|
|
|
|
2002-12-16 18:02:16 +00:00
|
|
|
/* The second arg may be NULL. If not, this .def is appended to it. */
|
2003-06-28 05:28:54 +00:00
|
|
|
extern def_file *def_file_parse (const char *, def_file *);
|
|
|
|
extern void def_file_free (def_file *);
|
|
|
|
extern def_file_export *def_file_add_export (def_file *, const char *,
|
|
|
|
const char *, int);
|
|
|
|
extern def_file_import *def_file_add_import (def_file *, const char *,
|
|
|
|
const char *, int, const char *);
|
|
|
|
extern void def_file_add_directive (def_file *, const char *, int);
|
|
|
|
extern def_file_module *def_get_module (def_file *, const char *);
|
1999-05-03 07:29:11 +00:00
|
|
|
#ifdef DEF_FILE_PRINT
|
2003-06-28 05:28:54 +00:00
|
|
|
extern void def_file_print (FILE *, def_file *);
|
1999-05-03 07:29:11 +00:00
|
|
|
#endif
|
1999-09-12 15:27:48 +00:00
|
|
|
|
|
|
|
#endif /* DEFFILE_H */
|