Commit 26f8db7d authored by Omar Ramirez Luna's avatar Omar Ramirez Luna Committed by Greg Kroah-Hartman
Browse files

staging: ti dspbridge: add DOFF binaries loader

parent 6a88a4fe
Loading
Loading
Loading
Loading
+1960 −0

File added.

Preview size limit exceeded, changes collapsed.

+351 −0
Original line number Diff line number Diff line
/*
 * dload_internal.h
 *
 * DSP-BIOS Bridge driver support functions for TI OMAP processors.
 *
 * Copyright (C) 2005-2006 Texas Instruments, Inc.
 *
 * This package is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#ifndef _DLOAD_INTERNAL_
#define _DLOAD_INTERNAL_

#include <linux/types.h>

/*
 * Internal state definitions for the dynamic loader
 */

#define TRUE 1
#define FALSE 0

/* type used for relocation intermediate results */
typedef s32 rvalue;

/* unsigned version of same; must have at least as many bits */
typedef u32 urvalue;

/*
 * Dynamic loader configuration constants
 */
/* error issued if input has more sections than this limit */
#define REASONABLE_SECTION_LIMIT 100

/* (Addressable unit) value used to clear BSS section */
#define DLOAD_FILL_BSS 0

/*
 * Reorder maps explained (?)
 *
 * The doff file format defines a 32-bit pattern used to determine the
 * byte order of an image being read.  That value is
 * BYTE_RESHUFFLE_VALUE == 0x00010203
 * For purposes of the reorder routine, we would rather have the all-is-OK
 * for 32-bits pattern be 0x03020100.  This first macro makes the
 * translation from doff file header value to MAP value: */
#define REORDER_MAP(rawmap) ((rawmap) ^ 0x3030303)
/* This translation is made in dload_headers.  Thereafter, the all-is-OK
 * value for the maps stored in dlthis is REORDER_MAP(BYTE_RESHUFFLE_VALUE).
 * But sadly, not all bits of the doff file are 32-bit integers.
 * The notable exceptions are strings and image bits.
 * Strings obey host byte order: */
#if defined(_BIG_ENDIAN)
#define HOST_BYTE_ORDER(cookedmap) ((cookedmap) ^ 0x3030303)
#else
#define HOST_BYTE_ORDER(cookedmap) (cookedmap)
#endif
/* Target bits consist of target AUs (could be bytes, or 16-bits,
 * or 32-bits) stored as an array in host order.  A target order
 * map is defined by: */
#if !defined(_BIG_ENDIAN) || TARGET_AU_BITS > 16
#define TARGET_ORDER(cookedmap) (cookedmap)
#elif TARGET_AU_BITS > 8
#define TARGET_ORDER(cookedmap) ((cookedmap) ^ 0x2020202)
#else
#define TARGET_ORDER(cookedmap) ((cookedmap) ^ 0x3030303)
#endif

/* forward declaration for handle returned by dynamic loader */
struct my_handle;

/*
 * a list of module handles, which mirrors the debug list on the target
 */
struct dbg_mirror_root {
	/* must be same as dbg_mirror_list; __DLModules address on target */
	u32 dbthis;
	struct my_handle *hnext;	/* must be same as dbg_mirror_list */
	u16 changes;		/* change counter */
	u16 refcount;		/* number of modules referencing this root */
};

struct dbg_mirror_list {
	u32 dbthis;
	struct my_handle *hnext, *hprev;
	struct dbg_mirror_root *hroot;
	u16 dbsiz;
	u32 context;	/* Save context for .dllview memory allocation */
};

#define VARIABLE_SIZE 1
/*
 * the structure we actually return as an opaque module handle
 */
struct my_handle {
	struct dbg_mirror_list dm;	/* !!! must be first !!! */
	/* sections following << 1, LSB is set for big-endian target */
	u16 secn_count;
	struct ldr_section_info secns[VARIABLE_SIZE];
};
#define MY_HANDLE_SIZE (sizeof(struct my_handle) -\
			sizeof(struct ldr_section_info))
/* real size of my_handle */

/*
 * reduced symbol structure used for symbols during relocation
 */
struct local_symbol {
	s32 value;		/* Relocated symbol value */
	s32 delta;		/* Original value in input file */
	s16 secnn;		/* section number */
	s16 sclass;		/* symbol class */
};

/*
 * Trampoline data structures
 */
#define TRAMP_NO_GEN_AVAIL              65535
#define TRAMP_SYM_PREFIX                "__$dbTR__"
#define TRAMP_SECT_NAME                 ".dbTR"
/* MUST MATCH THE LENGTH ABOVE!! */
#define TRAMP_SYM_PREFIX_LEN            9
/* Includes NULL termination */
#define TRAMP_SYM_HEX_ASCII_LEN         9

#define GET_CONTAINER(ptr, type, field) ((type *)((unsigned long)ptr -\
				(unsigned long)(&((type *)0)->field)))
#ifndef FIELD_OFFSET
#define FIELD_OFFSET(type, field)       ((unsigned long)(&((type *)0)->field))
#endif

/*
    The trampoline code for the target is located in a table called
    "tramp_gen_info" with is indexed by looking up the index in the table
    "tramp_map".  The tramp_map index is acquired using the target
    HASH_FUNC on the relocation type that caused the trampoline.  Each
    trampoline code table entry MUST follow this format:

    |----------------------------------------------|
    |  tramp_gen_code_hdr                          |
    |----------------------------------------------|
    |  Trampoline image code                       |
    |  (the raw instruction code for the target)   |
    |----------------------------------------------|
    |  Relocation entries for the image code       |
    |----------------------------------------------|

    This is very similar to how image data is laid out in the DOFF file
    itself.
 */
struct tramp_gen_code_hdr {
	u32 tramp_code_size;	/*  in BYTES */
	u32 num_relos;
	u32 relo_offset;	/*  in BYTES */
};

struct tramp_img_pkt {
	struct tramp_img_pkt *next;	/*  MUST BE FIRST */
	u32 base;
	struct tramp_gen_code_hdr hdr;
	u8 payload[VARIABLE_SIZE];
};

struct tramp_img_dup_relo {
	struct tramp_img_dup_relo *next;
	struct reloc_record_t relo;
};

struct tramp_img_dup_pkt {
	struct tramp_img_dup_pkt *next;	/*  MUST BE FIRST */
	s16 secnn;
	u32 offset;
	struct image_packet_t img_pkt;
	struct tramp_img_dup_relo *relo_chain;

	/*  PAYLOAD OF IMG PKT FOLLOWS */
};

struct tramp_sym {
	struct tramp_sym *next;	/*  MUST BE FIRST */
	u32 index;
	u32 str_index;
	struct local_symbol sym_info;
};

struct tramp_string {
	struct tramp_string *next;	/*  MUST BE FIRST */
	u32 index;
	char str[VARIABLE_SIZE];	/*  NULL terminated */
};

struct tramp_info {
	u32 tramp_sect_next_addr;
	struct ldr_section_info sect_info;

	struct tramp_sym *symbol_head;
	struct tramp_sym *symbol_tail;
	u32 tramp_sym_next_index;
	struct local_symbol *final_sym_table;

	struct tramp_string *string_head;
	struct tramp_string *string_tail;
	u32 tramp_string_next_index;
	u32 tramp_string_size;
	char *final_string_table;

	struct tramp_img_pkt *tramp_pkts;
	struct tramp_img_dup_pkt *dup_pkts;
};

/*
 * States of the .cinit state machine
 */
enum cinit_mode {
	CI_COUNT = 0,		/* expecting a count */
	CI_ADDRESS,		/* expecting an address */
#if CINIT_ALIGN < CINIT_ADDRESS	/* handle case of partial address field */
	CI_PARTADDRESS,		/* have only part of the address */
#endif
	CI_COPY,		/* in the middle of copying data */
	CI_DONE			/* end of .cinit table */
};

/*
 * The internal state of the dynamic loader, which is passed around as
 * an object
 */
struct dload_state {
	struct dynamic_loader_stream *strm;	/* The module input stream */
	struct dynamic_loader_sym *mysym;	/* Symbols for this session */
	/* target memory allocator */
	struct dynamic_loader_allocate *myalloc;
	struct dynamic_loader_initialize *myio;	/* target memory initializer */
	unsigned myoptions;	/* Options parameter dynamic_load_module */

	char *str_head;		/* Pointer to string table */
#if BITS_PER_AU > BITS_PER_BYTE
	char *str_temp;		/* Pointer to temporary buffer for strings */
	/* big enough to hold longest string */
	unsigned temp_len;	/* length of last temporary string */
	char *xstrings;		/* Pointer to buffer for expanded */
	/* strings for sec names */
#endif
	/* Total size of strings for DLLView section names */
	unsigned debug_string_size;
	/* Pointer to parallel section info for allocated sections only */
	struct doff_scnhdr_t *sect_hdrs;	/* Pointer to section table */
	struct ldr_section_info *ldr_sections;
#if TMS32060
	/* The address of the start of the .bss section */
	ldr_addr bss_run_base;
#endif
	struct local_symbol *local_symtab;	/* Relocation symbol table */

	/* pointer to DL section info for the section being relocated */
	struct ldr_section_info *image_secn;
	/* change in run address for current section during relocation */
	ldr_addr delta_runaddr;
	ldr_addr image_offset;	/* offset of current packet in section */
	enum cinit_mode cinit_state;	/* current state of cload_cinit() */
	int cinit_count;	/* the current count */
	ldr_addr cinit_addr;	/* the current address */
	s16 cinit_page;		/* the current page */
	/* Handle to be returned by dynamic_load_module */
	struct my_handle *myhandle;
	unsigned dload_errcount;	/* Total # of errors reported so far */
	/* Number of target sections that require allocation and relocation */
	unsigned allocated_secn_count;
#ifndef TARGET_ENDIANNESS
	int big_e_target;	/* Target data in big-endian format */
#endif
	/* map for reordering bytes, 0 if not needed */
	u32 reorder_map;
	struct doff_filehdr_t dfile_hdr;	/* DOFF file header structure */
	struct doff_verify_rec_t verify;	/* Verify record */

	struct tramp_info tramp;	/* Trampoline data, if needed */

	int relstkidx;		/* index into relocation value stack */
	/* relocation value stack used in relexp.c */
	rvalue relstk[STATIC_EXPR_STK_SIZE];

};

#ifdef TARGET_ENDIANNESS
#define TARGET_BIG_ENDIAN TARGET_ENDIANNESS
#else
#define TARGET_BIG_ENDIAN (dlthis->big_e_target)
#endif

/*
 * Exports from cload.c to rest of the world
 */
extern void dload_error(struct dload_state *dlthis, const char *errtxt, ...);
extern void dload_syms_error(struct dynamic_loader_sym *syms,
			     const char *errtxt, ...);
extern void dload_headers(struct dload_state *dlthis);
extern void dload_strings(struct dload_state *dlthis, bool sec_names_only);
extern void dload_sections(struct dload_state *dlthis);
extern void dload_reorder(void *data, int dsiz, u32 map);
extern u32 dload_checksum(void *data, unsigned siz);

#if HOST_ENDIANNESS
extern uint32_t dload_reverse_checksum(void *data, unsigned siz);
#if (TARGET_AU_BITS > 8) && (TARGET_AU_BITS < 32)
extern uint32_t dload_reverse_checksum16(void *data, unsigned siz);
#endif
#endif

#define IS_DATA_SCN(zzz) (DLOAD_SECTION_TYPE((zzz)->type) != DLOAD_TEXT)
#define IS_DATA_SCN_NUM(zzz) \
		(DLOAD_SECT_TYPE(&dlthis->sect_hdrs[(zzz)-1]) != DLOAD_TEXT)

/*
 * exported by reloc.c
 */
extern void dload_relocate(struct dload_state *dlthis, tgt_au_t * data,
			   struct reloc_record_t *rp, bool * tramps_generated,
			   bool second_pass);

extern rvalue dload_unpack(struct dload_state *dlthis, tgt_au_t * data,
			   int fieldsz, int offset, unsigned sgn);

extern int dload_repack(struct dload_state *dlthis, rvalue val, tgt_au_t * data,
			int fieldsz, int offset, unsigned sgn);

/*
 * exported by tramp.c
 */
extern bool dload_tramp_avail(struct dload_state *dlthis,
			      struct reloc_record_t *rp);

int dload_tramp_generate(struct dload_state *dlthis, s16 secnn,
			 u32 image_offset, struct image_packet_t *ipacket,
			 struct reloc_record_t *rp);

extern int dload_tramp_pkt_udpate(struct dload_state *dlthis,
				  s16 secnn, u32 image_offset,
				  struct image_packet_t *ipacket);

extern int dload_tramp_finalize(struct dload_state *dlthis);

extern void dload_tramp_cleanup(struct dload_state *dlthis);

#endif /* _DLOAD_INTERNAL_ */
+344 −0
Original line number Diff line number Diff line
/*
 * doff.h
 *
 * DSP-BIOS Bridge driver support functions for TI OMAP processors.
 *
 * Structures & definitions used for dynamically loaded modules file format.
 * This format is a reformatted version of COFF. It optimizes the layout for
 * the dynamic loader.
 *
 * .dof files, when viewed as a sequence of 32-bit integers, look the same
 * on big-endian and little-endian machines.
 *
 * Copyright (C) 2005-2006 Texas Instruments, Inc.
 *
 * This package is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#ifndef _DOFF_H
#define _DOFF_H

#ifndef UINT32_C
#define UINT32_C(zzz) ((u32)zzz)
#endif

#define BYTE_RESHUFFLE_VALUE UINT32_C(0x00010203)

/* DOFF file header containing fields categorizing the remainder of the file */
struct doff_filehdr_t {

	/* string table size, including filename, in bytes */
	u32 df_strtab_size;

	/* entry point if one exists */
	u32 df_entrypt;

	/* identifies byte ordering of file;
	 * always set to BYTE_RESHUFFLE_VALUE */
	u32 df_byte_reshuffle;

	/* Size of the string table up to and including the last section name */
	/* Size includes the name of the COFF file also */
	u32 df_scn_name_size;

#ifndef _BIG_ENDIAN
	/* number of symbols */
	u16 df_no_syms;

	/* length in bytes of the longest string, including terminating NULL */
	/* excludes the name of the file */
	u16 df_max_str_len;

	/* total number of sections including no-load ones */
	u16 df_no_scns;

	/* number of sections containing target code allocated or downloaded */
	u16 df_target_scns;

	/* unique id for dll file format & version */
	u16 df_doff_version;

	/* identifies ISA */
	u16 df_target_id;

	/* useful file flags */
	u16 df_flags;

	/* section reference for entry point, N_UNDEF for none, */
	/* N_ABS for absolute address */
	s16 df_entry_secn;
#else
	/* length of the longest string, including terminating NULL */
	u16 df_max_str_len;

	/* number of symbols */
	u16 df_no_syms;

	/* number of sections containing target code allocated or downloaded */
	u16 df_target_scns;

	/* total number of sections including no-load ones */
	u16 df_no_scns;

	/* identifies ISA */
	u16 df_target_id;

	/* unique id for dll file format & version */
	u16 df_doff_version;

	/* section reference for entry point, N_UNDEF for none, */
	/* N_ABS for absolute address */
	s16 df_entry_secn;

	/* useful file flags */
	u16 df_flags;
#endif
	/* checksum for file header record */
	u32 df_checksum;

};

/* flags in the df_flags field */
#define  DF_LITTLE   0x100
#define  DF_BIG      0x200
#define  DF_BYTE_ORDER (DF_LITTLE | DF_BIG)

/* Supported processors */
#define TMS470_ID   0x97
#define LEAD_ID     0x98
#define TMS32060_ID 0x99
#define LEAD3_ID    0x9c

/* Primary processor for loading */
#if TMS32060
#define TARGET_ID   TMS32060_ID
#endif

/* Verification record containing values used to test integrity of the bits */
struct doff_verify_rec_t {

	/* time and date stamp */
	u32 dv_timdat;

	/* checksum for all section records */
	u32 dv_scn_rec_checksum;

	/* checksum for string table */
	u32 dv_str_tab_checksum;

	/* checksum for symbol table */
	u32 dv_sym_tab_checksum;

	/* checksum for verification record */
	u32 dv_verify_rec_checksum;

};

/* String table is an array of null-terminated strings.  The first entry is
 * the filename, which is added by DLLcreate.  No new structure definitions
 * are required.
 */

/* Section Records including information on the corresponding image packets */
/*
 *      !!WARNING!!
 *
 * This structure is expected to match in form ldr_section_info in
 * dynamic_loader.h
 */

struct doff_scnhdr_t {

	s32 ds_offset;		/* offset into string table of name */
	s32 ds_paddr;		/* RUN address, in target AU */
	s32 ds_vaddr;		/* LOAD address, in target AU */
	s32 ds_size;		/* section size, in target AU */
#ifndef _BIG_ENDIAN
	u16 ds_page;		/* memory page id */
	u16 ds_flags;		/* section flags */
#else
	u16 ds_flags;		/* section flags */
	u16 ds_page;		/* memory page id */
#endif
	u32 ds_first_pkt_offset;
	/* Absolute byte offset into the file */
	/* where the first image record resides */

	s32 ds_nipacks;		/* number of image packets */

};

/* Symbol table entry */
struct doff_syment_t {

	s32 dn_offset;		/* offset into string table of name */
	s32 dn_value;		/* value of symbol */
#ifndef _BIG_ENDIAN
	s16 dn_scnum;		/* section number */
	s16 dn_sclass;		/* storage class */
#else
	s16 dn_sclass;		/* storage class */
	s16 dn_scnum;		/* section number, 1-based */
#endif

};

/* special values for dn_scnum */
#define  DN_UNDEF  0		/* undefined symbol */
#define  DN_ABS    (-1)		/* value of symbol is absolute */
/* special values for dn_sclass */
#define DN_EXT     2
#define DN_STATLAB 20
#define DN_EXTLAB  21

/* Default value of image bits in packet */
/* Configurable by user on the command line */
#define IMAGE_PACKET_SIZE 1024

/* An image packet contains a chunk of data from a section along with */
/* information necessary for its processing. */
struct image_packet_t {

	s32 num_relocs;		/* number of relocations for */
	/* this packet */

	s32 packet_size;	/* number of bytes in array */
	/* "bits" occupied  by */
	/* valid data.  Could be */
	/* < IMAGE_PACKET_SIZE to */
	/* prevent splitting a */
	/* relocation across packets. */
	/* Last packet of a section */
	/* will most likely contain */
	/* < IMAGE_PACKET_SIZE bytes */
	/* of valid data */

	s32 img_chksum;		/* Checksum for image packet */
	/* and the corresponding */
	/* relocation records */

	u8 *img_data;		/* Actual data in section */

};

/* The relocation structure definition matches the COFF version.  Offsets */
/* however are relative to the image packet base not the section base. */
struct reloc_record_t {

	s32 vaddr;

	/* expressed in target AUs */

	union {
		struct {
#ifndef _BIG_ENDIAN
			u8 _offset;	/* bit offset of rel fld */
			u8 _fieldsz;	/* size of rel fld */
			u8 _wordsz;	/* # bytes containing rel fld */
			u8 _dum1;
			u16 _dum2;
			u16 _type;
#else
			unsigned _dum1:8;
			unsigned _wordsz:8;	/* # bytes containing rel fld */
			unsigned _fieldsz:8;	/* size of rel fld */
			unsigned _offset:8;	/* bit offset of rel fld */
			u16 _type;
			u16 _dum2;
#endif
		} _r_field;

		struct {
			u32 _spc;	/* image packet relative PC */
#ifndef _BIG_ENDIAN
			u16 _dum;
			u16 _type;	/* relocation type */
#else
			u16 _type;	/* relocation type */
			u16 _dum;
#endif
		} _r_spc;

		struct {
			u32 _uval;	/* constant value */
#ifndef _BIG_ENDIAN
			u16 _dum;
			u16 _type;	/* relocation type */
#else
			u16 _type;	/* relocation type */
			u16 _dum;
#endif
		} _r_uval;

		struct {
			s32 _symndx;	/* 32-bit sym tbl index */
#ifndef _BIG_ENDIAN
			u16 _disp;	/* extra addr encode data */
			u16 _type;	/* relocation type */
#else
			u16 _type;	/* relocation type */
			u16 _disp;	/* extra addr encode data */
#endif
		} _r_sym;
	} _u_reloc;

};

/* abbreviations for convenience */
#ifndef TYPE
#define TYPE      _u_reloc._r_sym._type
#define UVAL      _u_reloc._r_uval._uval
#define SYMNDX    _u_reloc._r_sym._symndx
#define OFFSET    _u_reloc._r_field._offset
#define FIELDSZ   _u_reloc._r_field._fieldsz
#define WORDSZ    _u_reloc._r_field._wordsz
#define R_DISP      _u_reloc._r_sym._disp
#endif

/**************************************************************************** */
/* */
/* Important DOFF macros used for file processing */
/* */
/**************************************************************************** */

/* DOFF Versions */
#define         DOFF0                       0

/* Return the address/size >= to addr that is at a 32-bit boundary */
/* This assumes that a byte is 8 bits */
#define         DOFF_ALIGN(addr)            (((addr) + 3) & ~UINT32_C(3))

/**************************************************************************** */
/* */
/* The DOFF section header flags field is laid out as follows: */
/* */
/*  Bits 0-3 : Section Type */
/*  Bit    4 : Set when section requires target memory to be allocated by DL */
/*  Bit    5 : Set when section requires downloading */
/*  Bits 8-11: Alignment, same as COFF */
/* */
/**************************************************************************** */

/* Enum for DOFF section types (bits 0-3 of flag): See dynamic_loader.h */

/* Macros to help processing of sections */
#define DLOAD_SECT_TYPE(s_hdr)      ((s_hdr)->ds_flags & 0xF)

/* DS_ALLOCATE indicates whether a section needs space on the target */
#define DS_ALLOCATE_MASK            0x10
#define DS_NEEDS_ALLOCATION(s_hdr)  ((s_hdr)->ds_flags & DS_ALLOCATE_MASK)

/* DS_DOWNLOAD indicates that the loader needs to copy bits */
#define DS_DOWNLOAD_MASK            0x20
#define DS_NEEDS_DOWNLOAD(s_hdr)    ((s_hdr)->ds_flags & DS_DOWNLOAD_MASK)

/* Section alignment requirement in AUs */
#define DS_ALIGNMENT(ds_flags) (1 << (((ds_flags) >> 8) & 0xF))

#endif /* _DOFF_H */
+416 −0

File added.

Preview size limit exceeded, changes collapsed.

+55 −0
Original line number Diff line number Diff line
/*
 * header.h
 *
 * DSP-BIOS Bridge driver support functions for TI OMAP processors.
 *
 * Copyright (C) 2005-2006 Texas Instruments, Inc.
 *
 * This package is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#define TRUE 1
#define FALSE 0
#ifndef NULL
#define NULL 0
#endif

#include <linux/string.h>
#define DL_STRCMP  strcmp

/* maximum parenthesis nesting in relocation stack expressions */
#define STATIC_EXPR_STK_SIZE 10

#include <linux/types.h>

#include "doff.h"
#include <dspbridge/dynamic_loader.h>
#include "params.h"
#include "dload_internal.h"
#include "reloc_table.h"

/*
 * Plausibility limits
 *
 * These limits are imposed upon the input DOFF file as a check for validity.
 * They are hard limits, in that the load will fail if they are exceeded.
 * The numbers selected are arbitrary, in that the loader implementation does
 * not require these limits.
 */

/* maximum number of bytes in string table */
#define MAX_REASONABLE_STRINGTAB (0x100000)
/* maximum number of code,data,etc. sections */
#define MAX_REASONABLE_SECTIONS (200)
/* maximum number of linker symbols */
#define MAX_REASONABLE_SYMBOLS (100000)

/* shift count to align F_BIG with DLOAD_LITTLE */
#define ALIGN_COFF_ENDIANNESS 7
#define ENDIANNESS_MASK (DF_BYTE_ORDER >> ALIGN_COFF_ENDIANNESS)
Loading