/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* This file is derived from the GAS 2.1.4 assembler control file. TheGASproductisundertheGNUGeneralPublicLicense,version2orlater. Assuch,thisfileisalsounderthatlicense.
#define E_SYMNMLEN 8/* Number of characters in a symbol name */ #define E_FILNMLEN 14/* Number of characters in a file name */ #define E_DIMNUM 4/* Number of array dimensions in auxiliary entry */
/* Load a short int from the following tables with little-endian formats */ #define COFF_SHORT_L(ps) ((short)(((unsignedshort)((unsignedchar)ps[1])<<8)|\
((unsignedshort)((unsignedchar)ps[0]))))
/* Load a long int from the following tables with little-endian formats */ #define COFF_LONG_L(ps) (((long)(((unsignedlong)((unsignedchar)ps[3])<<24) |\
((unsignedlong)((unsignedchar)ps[2])<<16) |\
((unsignedlong)((unsignedchar)ps[1])<<8) |\
((unsignedlong)((unsignedchar)ps[0])))))
/* Load a short int from the following tables with big-endian formats */ #define COFF_SHORT_H(ps) ((short)(((unsignedshort)((unsignedchar)ps[0])<<8)|\
((unsignedshort)((unsignedchar)ps[1]))))
/* Load a long int from the following tables with big-endian formats */ #define COFF_LONG_H(ps) (((long)(((unsignedlong)((unsignedchar)ps[0])<<24) |\
((unsignedlong)((unsignedchar)ps[1])<<16) |\
((unsignedlong)((unsignedchar)ps[2])<<8) |\
((unsignedlong)((unsignedchar)ps[3])))))
/* These may be overridden later by brain dead implementations which generate abig-endianheaderwithlittle-endiandata.Inthatcase,generatea replacementmacrowhichtestsaflaganduseseitherofthetwoabove
as appropriate. */
/* Linux COFF must have this "optional" header. Standard COFF has no entry locationforthe"entry"point.Theynormallywouldstartwiththefirst locationofthe.textsection.Thisisnotagoodideaforlinux.So, theuseofthis"optional"headerisnotoptional.Itisrequired.
typedefstruct
{ char magic[2]; /* type of file */ char vstamp[2]; /* version stamp */ char tsize[4]; /* text size in bytes, padded to FW bdry */ char dsize[4]; /* initialized data " " */ char bsize[4]; /* uninitialized data " " */ char entry[4]; /* entry pt. */ char text_start[4]; /* base of text used for this file */ char data_start[4]; /* base of data used for this file */
}
COFF_AOUTHDR;
#define COFF_AOUTSZ (sizeof(COFF_AOUTHDR))
#define COFF_STMAGIC 0401 #define COFF_OMAGIC 0404 #define COFF_JMAGIC 0407/* dirty text and data image, can't share */ #define COFF_DMAGIC 0410/* dirty text segment, data aligned */ #define COFF_ZMAGIC 0413/* The proper magic number for executables */ #define COFF_SHMAGIC 0443/* shared library header */
#define COFF_SECT_TEXT 0/* Section for instruction code */ #define COFF_SECT_DATA 1/* Section for initialized globals */ #define COFF_SECT_BSS 2/* Section for un-initialized globals */ #define COFF_SECT_REQD 3/* Minimum number of sections for good file */
/********************** LINE NUMBERS **********************/
/* 1 line number entry for every "breakpointable" source line in a section. *Linenumbersaregroupedonaperfunctionbasis;firstentryinafunction *groupingwillhavel_lnno=0andinplaceofphysicaladdresswillbethe *symboltableindexofthefunctionname.
*/
struct COFF_lineno { union { char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/ char l_paddr[4]; /* (physical) address of line number */
} l_addr; char l_lnno[2]; /* line number */
};
#define COFF_E_SYMNMLEN 8/* # characters in a short symbol name */ #define COFF_E_FILNMLEN 14/* # characters in a file name */ #define COFF_E_DIMNUM 4/* # array dimensions in auxiliary entry */
struct COFF_syment
{ union { char e_name[E_SYMNMLEN]; /* Symbol name (first 8 characters) */ struct { char e_zeroes[4]; /* Leading zeros */ char e_offset[4]; /* Offset if this is a header section */
} e;
} e;
char e_value[4]; /* Value (address) of the segment */ char e_scnum[2]; /* Section number */ char e_type[2]; /* Type of section */ char e_sclass[1]; /* Loader class */ char e_numaux[1]; /* Number of auxiliary entries which follow */
};
#define COFF_N_BTMASK (0xf) /* Mask for important class bits */ #define COFF_N_TMASK (0x30) /* Mask for important type bits */ #define COFF_N_BTSHFT (4) /* # bits to shift class field */ #define COFF_N_TSHIFT (2) /* # bits to shift type field */
struct { char x_tagndx[4]; /* str, un, or enum tag indx */ union { struct { char x_lnno[2]; /* declaration line number */ char x_size[2]; /* str/union/array size */
} x_lnsz; char x_fsize[4]; /* size of function */
} x_misc;
union { struct { /* if ISFCN, tag, or .bb */ char x_lnnoptr[4]; /* ptr to fcn line # */ char x_endndx[4]; /* entry ndx past block end */
} x_fcn;
struct { /* if ISARY, up to 4 dimen. */ char x_dimen[E_DIMNUM][2];
} x_ary;
} x_fcnary;
struct { char x_tvfill[4]; /* tv fill value */ char x_tvlen[2]; /* length of .tv */ char x_tvran[2][2]; /* tv range */
} x_tv; /* info about .tv section (in auxent of symbol .tv)) */
};
struct COFF_reloc { char r_vaddr[4]; /* Virtual address of item */ char r_symndx[4]; /* Symbol index in the symtab */ char r_type[2]; /* Relocation type */
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.