1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-28 22:30:12 +00:00
cc65/src/ld65/objdata.h
cuz 097a01094e Added a method to write variable sized unsigned values. Use this method for
all sorts of things in the object files. This does not only make the object
files smaller, but does also remove several limits (strings may be longer
than 255 bytes, several counters no longer have 8 or 16 bit limits).


git-svn-id: svn://svn.cc65.org/cc65/trunk@260 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-08-02 13:23:06 +00:00

109 lines
4.5 KiB
C

/*****************************************************************************/
/* */
/* objdata.h */
/* */
/* Handling object file data for the ld65 linker */
/* */
/* */
/* */
/* (C) 1998 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@musoftware.de */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
/* warranty. In no event will the authors be held liable for any damages */
/* arising from the use of this software. */
/* */
/* Permission is granted to anyone to use this software for any purpose, */
/* including commercial applications, and to alter it and redistribute it */
/* freely, subject to the following restrictions: */
/* */
/* 1. The origin of this software must not be misrepresented; you must not */
/* claim that you wrote the original software. If you use this software */
/* in a product, an acknowledgment in the product documentation would be */
/* appreciated but is not required. */
/* 2. Altered source versions must be plainly marked as such, and must not */
/* be misrepresented as being the original software. */
/* 3. This notice may not be removed or altered from any source */
/* distribution. */
/* */
/*****************************************************************************/
#ifndef OBJDATA_H
#define OBJDATA_H
/* common */
#include "objdefs.h"
/*****************************************************************************/
/* Data */
/*****************************************************************************/
/* Values for the Flags field */
#define OBJ_REF 0x0001 /* We have a reference to this file */
#define OBJ_HAVEDATA 0x0002 /* We have this object file already */
#define OBJ_MARKED 0x0004 /* Generic marker bit */
/* Internal structure holding object file data */
typedef struct ObjData_ ObjData;
struct ObjData_ {
ObjData* Next; /* Linked list of all objects */
char* Name; /* Module name */
char* LibName; /* Name of library */
ObjHeader Header; /* Header of file */
unsigned long Start; /* Start offset of data in library */
unsigned Flags;
unsigned FileCount; /* Input file count */
char** Files; /* List of input files */
unsigned SectionCount; /* Count of sections in this object */
struct Section_** Sections; /* List of all sections */
unsigned ExportCount; /* Count of exports */
struct Export_** Exports; /* List of all exports */
unsigned ImportCount; /* Count of imports */
struct Import_** Imports; /* List of all imports */
unsigned DbgSymCount; /* Count of debug symbols */
struct DbgSym_** DbgSyms; /* List of debug symbols */
};
/* Object data list management */
extern unsigned ObjCount; /* Count of files in the list */
extern ObjData* ObjRoot; /* List of object files */
extern ObjData* ObjLast; /* Last entry in list */
/*****************************************************************************/
/* Code */
/*****************************************************************************/
ObjData* NewObjData (void);
/* Allocate a new structure on the heap, insert it into the list, return it */
void FreeObjData (ObjData* O);
/* Free a complete struct */
/* End of objdata.h */
#endif