diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/aout/aout64.h | 2 | ||||
-rw-r--r-- | include/binary-io.h | 2 | ||||
-rw-r--r-- | include/coff/external.h | 174 | ||||
-rw-r--r-- | include/coff/internal.h | 268 | ||||
-rw-r--r-- | include/ctf.h | 3 | ||||
-rw-r--r-- | include/elf/common.h | 16 | ||||
-rw-r--r-- | include/opcode/aarch64.h | 130 | ||||
-rw-r--r-- | include/same-inode.h | 47 | ||||
-rw-r--r-- | include/vms/eihd.h | 2 |
9 files changed, 308 insertions, 336 deletions
diff --git a/include/aout/aout64.h b/include/aout/aout64.h index a85a801..dbe25ef 100644 --- a/include/aout/aout64.h +++ b/include/aout/aout64.h @@ -43,7 +43,7 @@ struct external_exec /* Magic numbers for a.out files. */ -#if ARCH_SIZE==64 +#if defined(ARCH_SIZE) && ARCH_SIZE == 64 #define OMAGIC 0x1001 /* Code indicating object file. */ #define ZMAGIC 0x1002 /* Code indicating demand-paged executable. */ #define NMAGIC 0x1003 /* Code indicating pure executable. */ diff --git a/include/binary-io.h b/include/binary-io.h index 2f4be43..beeb0f7 100644 --- a/include/binary-io.h +++ b/include/binary-io.h @@ -35,7 +35,7 @@ # undef O_BINARY # undef O_TEXT #endif -#if O_BINARY +#if defined(O_BINARY) && O_BINARY # if defined __EMX__ || defined __DJGPP__ || defined __CYGWIN__ # include <io.h> /* declares setmode() */ # else diff --git a/include/coff/external.h b/include/coff/external.h index 772b866..1b3c06d 100644 --- a/include/coff/external.h +++ b/include/coff/external.h @@ -1,17 +1,17 @@ /* external.h -- External COFF structures - + Copyright (C) 2001-2025 Free Software Foundation, Inc. This program 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 3 of the License, or (at your option) any later version. - + This program 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 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, @@ -21,41 +21,41 @@ #define COFF_EXTERNAL_H #ifndef DO_NOT_DEFINE_FILHDR -/********************** FILE HEADER **********************/ + +#define FILHDR struct external_filehdr +#define FILHSZ 20 struct external_filehdr - { - char f_magic[2]; /* magic number */ - char f_nscns[2]; /* number of sections */ - char f_timdat[4]; /* time & date stamp */ - char f_symptr[4]; /* file pointer to symtab */ - char f_nsyms[4]; /* number of symtab entries */ - char f_opthdr[2]; /* sizeof(optional hdr) */ - char f_flags[2]; /* flags */ - }; - -#define FILHDR struct external_filehdr -#define FILHSZ 20 +{ + char f_magic[2]; /* magic number */ + char f_nscns[2]; /* number of sections */ + char f_timdat[4]; /* time & date stamp */ + char f_symptr[4]; /* file pointer to symtab */ + char f_nsyms[4]; /* number of symtab entries */ + char f_opthdr[2]; /* sizeof(optional hdr) */ + char f_flags[2]; /* flags */ +}; #endif #ifndef DO_NOT_DEFINE_AOUTHDR -/********************** AOUT "OPTIONAL HEADER" **********************/ + +#define AOUTHDRSZ 28 +#define AOUTSZ 28 typedef struct external_aouthdr - { - 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 */ - } ATTRIBUTE_PACKED +{ + 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 */ +} ATTRIBUTE_PACKED AOUTHDR; -#define AOUTHDRSZ 28 -#define AOUTSZ 28 +#define AOUTHDRSZ64 24 typedef struct external_aouthdr64 { @@ -65,32 +65,30 @@ typedef struct external_aouthdr64 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 text_start[4]; /* Base of text used for this file. */ } AOUTHDR64; -#define AOUTHDRSZ64 24 #endif /* not DO_NOT_DEFINE_AOUTHDR */ #ifndef DO_NOT_DEFINE_SCNHDR -/********************** SECTION HEADER **********************/ + +#define SCNHDR struct external_scnhdr +#define SCNHSZ 40 struct external_scnhdr - { - char s_name[8]; /* section name */ - char s_paddr[4]; /* physical address, aliased s_nlib */ - char s_vaddr[4]; /* virtual address */ - char s_size[4]; /* section size */ - char s_scnptr[4]; /* file ptr to raw data for section */ - char s_relptr[4]; /* file ptr to relocation */ - char s_lnnoptr[4]; /* file ptr to line numbers */ - char s_nreloc[2]; /* number of relocation entries */ - char s_nlnno[2]; /* number of line number entries */ - char s_flags[4]; /* flags */ - }; - -#define SCNHDR struct external_scnhdr -#define SCNHSZ 40 +{ + char s_name[8]; /* section name */ + char s_paddr[4]; /* physical address, aliased s_nlib */ + char s_vaddr[4]; /* virtual address */ + char s_size[4]; /* section size */ + char s_scnptr[4]; /* file ptr to raw data for section */ + char s_relptr[4]; /* file ptr to relocation */ + char s_lnnoptr[4]; /* file ptr to line numbers */ + char s_nreloc[2]; /* number of relocation entries */ + char s_nlnno[2]; /* number of line number entries */ + char s_flags[4]; /* flags */ +}; /* Names of "special" sections. */ @@ -103,12 +101,13 @@ struct external_scnhdr #ifndef DO_NOT_DEFINE_LINENO -/********************** LINE NUMBERS **********************/ - #ifndef L_LNNO_SIZE #error L_LNNO_SIZE needs to be defined #endif +#define LINENO struct external_lineno +#define LINESZ (4 + L_LNNO_SIZE) + /* 1 line number entry for every "breakpointable" source line in a section. Line numbers are grouped on a per function basis; first entry in a function grouping will have l_lnno = 0 and in place of physical address will be the @@ -124,9 +123,6 @@ struct external_lineno char l_lnno[L_LNNO_SIZE]; /* line number */ }; -#define LINENO struct external_lineno -#define LINESZ (4 + L_LNNO_SIZE) - #if L_LNNO_SIZE == 4 #define GET_LINENO_LNNO(abfd, ext) H_GET_32 (abfd, (ext->l_lnno)) #define PUT_LINENO_LNNO(abfd, val, ext) H_PUT_32 (abfd, val, (ext->l_lnno)) @@ -139,15 +135,11 @@ struct external_lineno #endif /* not DO_NOT_DEFINE_LINENO */ #ifndef DO_NOT_DEFINE_SYMENT -/********************** SYMBOLS **********************/ #define E_SYMNMLEN 8 /* # characters in a symbol name */ -#ifndef E_FILNMLEN -#define E_FILNMLEN 14 -#endif -#define E_DIMNUM 4 /* # array dimensions in auxiliary entry */ +#define SYMESZ 18 -struct external_syment +typedef struct external_syment { union { @@ -165,10 +157,8 @@ struct external_syment char e_type[2]; char e_sclass[1]; char e_numaux[1]; -} ATTRIBUTE_PACKED ; - -#define SYMENT struct external_syment -#define SYMESZ 18 +} ATTRIBUTE_PACKED +SYMENT; #ifndef N_BTMASK #define N_BTMASK 0xf @@ -190,12 +180,16 @@ struct external_syment #ifndef DO_NOT_DEFINE_AUXENT -union external_auxent +#define E_FILNMLEN 14 /* # characters in a file name */ +#define E_DIMNUM 4 /* # array dimensions in auxiliary entry */ +#define AUXESZ 18 + +typedef union external_auxent { struct { char x_tagndx[4]; /* str, un, or enum tag indx */ - + union { struct @@ -203,66 +197,66 @@ union external_auxent 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 */ + 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. */ + + struct /* if ISARY, up to 4 dimen. */ { char x_dimen[E_DIMNUM][2]; } x_ary; - + } x_fcnary; - + char x_tvndx[2]; /* tv index */ - + } x_sym; - + union { - char x_fname[E_FILNMLEN]; - + /* Make x_fname the full auxent size, so that if coff/pe.h + redefines E_FILNMLEN from 14 to 18 we don't trigger sanitisers + accessing x_fname. Beware use of sizeof (x_file.x_fname). */ + char x_fname[AUXESZ]; + struct { char x_zeroes[4]; char x_offset[4]; } x_n; - + } x_file; - + struct { char x_scnlen[4]; /* section length */ char x_nreloc[2]; /* # relocation entries */ char x_nlinno[2]; /* # line numbers */ #ifdef INCLUDE_COMDAT_FIELDS_IN_AUXENT - char x_checksum[4]; /* section COMDAT checksum */ - char x_associated[2]; /* COMDAT associated section index */ - char x_comdat[1]; /* COMDAT selection number */ -#endif + char x_checksum[4]; /* section COMDAT checksum */ + char x_associated[2]; /* COMDAT associated section index */ + char x_comdat[1]; /* COMDAT selection number */ +#endif } x_scn; - + + /* info about .tv section (in auxent of symbol .tv). */ 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)) */ -} ATTRIBUTE_PACKED ; - -#define AUXENT union external_auxent -#define AUXESZ 18 - -#define _ETEXT "etext" + } x_tv; +} ATTRIBUTE_PACKED +AUXENT; #endif /* not DO_NOT_DEFINE_AUXENT */ diff --git a/include/coff/internal.h b/include/coff/internal.h index 9532b0b..9da5e4b 100644 --- a/include/coff/internal.h +++ b/include/coff/internal.h @@ -21,15 +21,6 @@ #ifndef GNU_COFF_INTERNAL_H #define GNU_COFF_INTERNAL_H 1 -/* First, make "signed char" work, even on old compilers. */ -#ifndef signed -#ifndef __STDC__ -#define signed /**/ -#endif -#endif - -/********************** FILE HEADER **********************/ - /* extra stuff in a PE header. */ struct internal_extra_pe_filehdr @@ -55,7 +46,7 @@ struct internal_extra_pe_filehdr unsigned short e_res2[10]; /* Reserved words, all 0x0 */ bfd_vma e_lfanew; /* File address of new exe header, 0x80 */ char dos_message[64]; /* Text which always follows DOS header. */ - bfd_vma nt_signature; /* required NT signature, 0x4550 */ + bfd_vma nt_signature; /* required NT signature, 0x4550 */ }; struct internal_filehdr @@ -75,27 +66,27 @@ struct internal_filehdr /* Bits for f_flags: - F_RELFLG relocation info stripped from file - F_EXEC file is executable (no unresolved external references) - F_LNNO line numbers stripped from file - F_LSYMS local symbols stripped from file - F_AR16WR file is 16-bit little-endian - F_AR32WR file is 32-bit little-endian - F_AR32W file is 32-bit big-endian - F_DYNLOAD rs/6000 aix: dynamically loadable w/imports & exports - F_SHROBJ rs/6000 aix: file is a shared object + F_RELFLG relocation info stripped from file + F_EXEC file is executable (no unresolved external references) + F_LNNO line numbers stripped from file + F_LSYMS local symbols stripped from file + F_AR16WR file is 16-bit little-endian + F_AR32WR file is 32-bit little-endian + F_AR32W file is 32-bit big-endian + F_DYNLOAD rs/6000 aix: dynamically loadable w/imports & exports + F_SHROBJ rs/6000 aix: file is a shared object F_DLL PE format DLL */ -#define F_RELFLG (0x0001) -#define F_EXEC (0x0002) -#define F_LNNO (0x0004) -#define F_LSYMS (0x0008) -#define F_AR16WR (0x0080) -#define F_AR32WR (0x0100) -#define F_AR32W (0x0200) -#define F_DYNLOAD (0x1000) -#define F_SHROBJ (0x2000) -#define F_DLL (0x2000) +#define F_RELFLG (0x0001) +#define F_EXEC (0x0002) +#define F_LNNO (0x0004) +#define F_LSYMS (0x0008) +#define F_AR16WR (0x0080) +#define F_AR32WR (0x0100) +#define F_AR32W (0x0200) +#define F_DYNLOAD (0x1000) +#define F_SHROBJ (0x2000) +#define F_DLL (0x2000) /* Extra structure which is used in the optional header. */ typedef struct _IMAGE_DATA_DIRECTORY @@ -189,7 +180,7 @@ struct internal_extra_pe_aouthdr /* Linker major version number. */ char MajorLinkerVersion; /* Linker minor version number. */ - char MinorLinkerVersion; + char MinorLinkerVersion; /* Total size of all code sections. */ bfd_vma SizeOfCode; /* Total size of all initialized data sections. */ @@ -239,7 +230,6 @@ struct internal_extra_pe_aouthdr IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; }; -/********************** AOUT "OPTIONAL HEADER" **********************/ struct internal_aouthdr { short magic; /* type of file */ @@ -286,7 +276,7 @@ struct internal_aouthdr struct internal_extra_pe_aouthdr pe; }; -/********************** STORAGE CLASSES **********************/ +/* Storage classes. */ /* This used to be defined as -1, but now n_sclass is unsigned. */ #define C_EFCN 0xff /* physical end of function */ @@ -316,7 +306,7 @@ struct internal_aouthdr #define C_EOS 102 /* end of structure */ #define C_FILE 103 /* file name */ #define C_LINE 104 /* line # reformatted as symbol table entry */ -#define C_ALIAS 105 /* duplicate tag */ +#define C_ALIAS 105 /* duplicate tag */ #define C_HIDDEN 106 /* ext symbol in dmert public lib */ #define C_WEAKEXT 127 /* weak symbol -- GNU extension. */ @@ -327,68 +317,66 @@ struct internal_aouthdr #define C_SYSTEM 23 /* System Wide variable */ /* New storage classes for WINDOWS_NT */ -#define C_SECTION 104 /* section name */ +#define C_SECTION 104 /* section name */ #define C_NT_WEAK 105 /* weak external */ - /* New storage classes for 80960 */ +/* New storage classes for 80960 */ /* C_LEAFPROC is obsolete. Use C_LEAFEXT or C_LEAFSTAT */ #define C_LEAFPROC 108 /* Leaf procedure, "call" via BAL */ #define C_SCALL 107 /* Procedure reachable via system call */ -#define C_LEAFEXT 108 /* External leaf */ -#define C_LEAFSTAT 113 /* Static leaf */ +#define C_LEAFEXT 108 /* External leaf */ +#define C_LEAFSTAT 113 /* Static leaf */ #define C_OPTVAR 109 /* Optimized variable */ #define C_DEFINE 110 /* Preprocessor #define */ #define C_PRAGMA 111 /* Advice to compiler or linker */ #define C_SEGMENT 112 /* 80960 segment name */ - /* New storage classes for RS/6000 */ -#define C_HIDEXT 107 /* Un-named external symbol */ -#define C_BINCL 108 /* Marks beginning of include file */ -#define C_EINCL 109 /* Marks ending of include file */ -#define C_AIX_WEAKEXT 111 /* AIX definition of C_WEAKEXT. */ -#define C_DWARF 112 /* DWARF symbol */ +/* New storage classes for RS/6000 */ +#define C_HIDEXT 107 /* Un-named external symbol */ +#define C_BINCL 108 /* Marks beginning of include file */ +#define C_EINCL 109 /* Marks ending of include file */ +#define C_AIX_WEAKEXT 111 /* AIX definition of C_WEAKEXT. */ +#define C_DWARF 112 /* DWARF symbol */ #define C_NULL_VALUE 0x00de1e00 /* Value for a C_NULL deleted entry. */ #ifdef AIX_WEAK_SUPPORT #undef C_WEAKEXT -#define C_WEAKEXT C_AIX_WEAKEXT +#define C_WEAKEXT C_AIX_WEAKEXT #endif - /* storage classes for stab symbols for RS/6000 */ -#define C_GSYM (0x80) -#define C_LSYM (0x81) -#define C_PSYM (0x82) -#define C_RSYM (0x83) -#define C_RPSYM (0x84) -#define C_STSYM (0x85) -#define C_TCSYM (0x86) -#define C_BCOMM (0x87) -#define C_ECOML (0x88) -#define C_ECOMM (0x89) -#define C_DECL (0x8c) -#define C_ENTRY (0x8d) -#define C_FUN (0x8e) -#define C_BSTAT (0x8f) -#define C_ESTAT (0x90) -#define C_GTLS (0x97) -#define C_STTLS (0x98) +/* storage classes for stab symbols for RS/6000 */ +#define C_GSYM (0x80) +#define C_LSYM (0x81) +#define C_PSYM (0x82) +#define C_RSYM (0x83) +#define C_RPSYM (0x84) +#define C_STSYM (0x85) +#define C_TCSYM (0x86) +#define C_BCOMM (0x87) +#define C_ECOML (0x88) +#define C_ECOMM (0x89) +#define C_DECL (0x8c) +#define C_ENTRY (0x8d) +#define C_FUN (0x8e) +#define C_BSTAT (0x8f) +#define C_ESTAT (0x90) +#define C_GTLS (0x97) +#define C_STTLS (0x98) /* Storage classes for Thumb symbols */ -#define C_THUMBEXT (128 + C_EXT) /* 130 */ -#define C_THUMBSTAT (128 + C_STAT) /* 131 */ -#define C_THUMBLABEL (128 + C_LABEL) /* 134 */ -#define C_THUMBEXTFUNC (C_THUMBEXT + 20) /* 150 */ +#define C_THUMBEXT (128 + C_EXT) /* 130 */ +#define C_THUMBSTAT (128 + C_STAT) /* 131 */ +#define C_THUMBLABEL (128 + C_LABEL) /* 134 */ +#define C_THUMBEXTFUNC (C_THUMBEXT + 20) /* 150 */ #define C_THUMBSTATFUNC (C_THUMBSTAT + 20) /* 151 */ /* True if XCOFF symbols of class CLASS have auxiliary csect information. */ #define CSECT_SYM_P(CLASS) \ ((CLASS) == C_EXT || (CLASS) == C_AIX_WEAKEXT || (CLASS) == C_HIDEXT) -/********************** SECTION HEADER **********************/ - #define SCNNMLEN (8) struct internal_scnhdr @@ -413,33 +401,43 @@ struct internal_scnhdr }; /* s_flags "type". */ -#define STYP_REG (0x0000) /* "regular": allocated, relocated, loaded */ -#define STYP_DSECT (0x0001) /* "dummy": relocated only*/ -#define STYP_NOLOAD (0x0002) /* "noload": allocated, relocated, not loaded */ -#define STYP_GROUP (0x0004) /* "grouped": formed of input sections */ -#define STYP_PAD (0x0008) /* "padding": not allocated, not relocated, loaded */ -#define STYP_COPY (0x0010) /* "copy": for decision function used by field update; not allocated, not relocated, - loaded; reloc & lineno entries processed normally */ -#define STYP_TEXT (0x0020) /* section contains text only */ -#define S_SHRSEG (0x0020) /* In 3b Update files (output of ogen), sections which appear in SHARED segments of the Pfile - will have the S_SHRSEG flag set by ogen, to inform dufr that updating 1 copy of the proc. will - update all process invocations. */ -#define STYP_DATA (0x0040) /* section contains data only */ -#define STYP_BSS (0x0080) /* section contains bss only */ -#define S_NEWFCN (0x0100) /* In a minimal file or an update file, a new function (as compared with a replaced function) */ -#define STYP_INFO (0x0200) /* comment: not allocated not relocated, not loaded */ -#define STYP_OVER (0x0400) /* overlay: relocated not allocated or loaded */ -#define STYP_LIB (0x0800) /* for .lib: same as INFO */ -#define STYP_MERGE (0x2000) /* merge section -- combines with text, data or bss sections only */ -#define STYP_REVERSE_PAD (0x4000) /* section will be padded with no-op instructions - wherever padding is necessary and there is a - word of contiguous bytes beginning on a word - boundary. */ - -#define STYP_LIT 0x8020 /* Literal data (like STYP_TEXT) */ - - -/********************** LINE NUMBERS **********************/ +#define STYP_REG (0x0000) /* "regular": allocated, relocated, loaded */ +#define STYP_DSECT (0x0001) /* "dummy": relocated only*/ +#define STYP_NOLOAD (0x0002) /* "noload": allocated, relocated, + not loaded */ +#define STYP_GROUP (0x0004) /* "grouped": formed of input sections */ +#define STYP_PAD (0x0008) /* "padding": not allocated, not relocated, + loaded */ +#define STYP_COPY (0x0010) /* "copy": for decision function used by field + update; not allocated, not relocated, + loaded; + reloc & lineno entries processed normally */ +#define STYP_TEXT (0x0020) /* section contains text only */ +#define S_SHRSEG (0x0020) /* In 3b Update files (output of ogen), + sections which appear in SHARED segments + of the Pfile will have the S_SHRSEG flag + set by ogen, to inform dufr that updating + 1 copy of the proc. will update all + process invocations. */ +#define STYP_DATA (0x0040) /* section contains data only */ +#define STYP_BSS (0x0080) /* section contains bss only */ +#define S_NEWFCN (0x0100) /* In a minimal file or an update file, + a new function (as compared with a + replaced function) */ +#define STYP_INFO (0x0200) /* comment: not allocated not relocated, + not loaded */ +#define STYP_OVER (0x0400) /* overlay: relocated not allocated or + loaded */ +#define STYP_LIB (0x0800) /* for .lib: same as INFO */ +#define STYP_MERGE (0x2000) /* merge section -- combines with text, + data or bss sections only */ +#define STYP_REVERSE_PAD (0x4000) /* section will be padded with no-op + instructions wherever padding is necessary + and there is a word of contiguous bytes + beginning on a word boundary. */ + +#define STYP_LIT (0x8020) /* Literal data (like STYP_TEXT) */ + /* 1 line number entry for every "breakpointable" source line in a section. Line numbers are grouped on a per function basis; first entry in a function @@ -450,17 +448,13 @@ struct internal_lineno { union { - bfd_signed_vma l_symndx; /* function name symbol index, iff l_lnno == 0*/ - bfd_signed_vma l_paddr; /* (physical) address of line number */ + bfd_signed_vma l_symndx; /* function name symbol index, iff l_lnno == 0 */ + bfd_signed_vma l_paddr; /* (physical) address of line number */ } l_addr; unsigned long l_lnno; /* line number */ }; -/********************** SYMBOLS **********************/ - #define SYMNMLEN 8 /* # characters in a symbol name */ -#define FILNMLEN 14 /* # characters in a file name */ -#define DIMNUM 4 /* # array dimensions in auxiliary entry */ struct internal_syment { @@ -492,8 +486,10 @@ struct internal_syment #define N_UNDEF ((int)0) /* undefined symbol */ #define N_ABS ((int)-1) /* value of symbol is absolute */ #define N_DEBUG ((int)-2) /* debugging symbol -- value is meaningless */ -#define N_TV ((int)-3) /* indicates symbol needs preload transfer vector */ -#define P_TV ((int)-4) /* indicates symbol needs postload transfer vector*/ +#define N_TV ((int)-3) /* indicates symbol needs preload transfer + vector */ +#define P_TV ((int)-4) /* indicates symbol needs postload transfer + vector */ /* Type of a symbol, in low N bits of the word. */ @@ -505,9 +501,9 @@ struct internal_syment #define T_LONG 5 /* long integer */ #define T_FLOAT 6 /* floating point */ #define T_DOUBLE 7 /* double word */ -#define T_STRUCT 8 /* structure */ -#define T_UNION 9 /* union */ -#define T_ENUM 10 /* enumeration */ +#define T_STRUCT 8 /* structure */ +#define T_UNION 9 /* union */ +#define T_ENUM 10 /* enumeration */ #define T_MOE 11 /* member of enumeration*/ #define T_UCHAR 12 /* unsigned character */ #define T_USHORT 13 /* unsigned short */ @@ -539,10 +535,13 @@ struct internal_syment /* Visibility flag, in XCOFF n_type. */ #define SYM_V_INTERNAL 0x1000 #define SYM_V_HIDDEN 0x2000 -#define SYM_V_PROTECTED 0x3000 +#define SYM_V_PROTECTED 0x3000 #define SYM_V_EXPORTED 0x4000 #define SYM_V_MASK 0xF000 +#define FILNMLEN 14 /* # characters in a file name */ +#define DIMNUM 4 /* # array dimensions in auxiliary entry */ + union internal_auxent { struct @@ -616,16 +615,15 @@ union internal_auxent uint8_t x_comdat; /* COMDAT selection number for PE */ } x_scn; + /* info about .tv section (in auxent of symbol .tv). */ struct { uint32_t x_tvfill; /* tv fill value */ uint16_t x_tvlen; /* length of .tv */ uint16_t x_tvran[2]; /* tv range */ - } x_tv; /* info about .tv section (in auxent of symbol .tv)) */ + } x_tv; - /****************************************** - * RS/6000-specific auxent - last auxent for every external symbol - ******************************************/ + /* RS/6000-specific auxent - last auxent for every external symbol. */ struct { union @@ -645,34 +643,34 @@ union internal_auxent /* x_smtyp values: */ -#define SMTYP_ALIGN(x) ((x) >> 3) /* log2 of alignment */ -#define SMTYP_SMTYP(x) ((x) & 0x7) /* symbol type */ +#define SMTYP_ALIGN(x) ((x) >> 3) /* log2 of alignment */ +#define SMTYP_SMTYP(x) ((x) & 0x7) /* symbol type */ /* Symbol type values: */ -#define XTY_ER 0 /* External reference */ -#define XTY_SD 1 /* Csect definition */ -#define XTY_LD 2 /* Label definition */ +#define XTY_ER 0 /* External reference */ +#define XTY_SD 1 /* Csect definition */ +#define XTY_LD 2 /* Label definition */ #define XTY_CM 3 /* .BSS */ -#define XTY_EM 4 /* Error message */ -#define XTY_US 5 /* "Reserved for internal use" */ +#define XTY_EM 4 /* Error message */ +#define XTY_US 5 /* "Reserved for internal use" */ /* x_smclas values: */ -#define XMC_PR 0 /* Read-only program code */ -#define XMC_RO 1 /* Read-only constant */ -#define XMC_DB 2 /* Read-only debug dictionary table */ -#define XMC_TC 3 /* Read-write general TOC entry */ -#define XMC_UA 4 /* Read-write unclassified */ -#define XMC_RW 5 /* Read-write data */ -#define XMC_GL 6 /* Read-only global linkage */ -#define XMC_XO 7 /* Read-only extended operation */ -#define XMC_SV 8 /* Read-only supervisor call */ -#define XMC_BS 9 /* Read-write BSS */ -#define XMC_DS 10 /* Read-write descriptor csect */ -#define XMC_UC 11 /* Read-write unnamed Fortran common */ -#define XMC_TI 12 /* Read-only traceback index csect */ -#define XMC_TB 13 /* Read-only traceback table csect */ -/* 14 ??? */ -#define XMC_TC0 15 /* Read-write TOC anchor */ +#define XMC_PR 0 /* Read-only program code */ +#define XMC_RO 1 /* Read-only constant */ +#define XMC_DB 2 /* Read-only debug dictionary table */ +#define XMC_TC 3 /* Read-write general TOC entry */ +#define XMC_UA 4 /* Read-write unclassified */ +#define XMC_RW 5 /* Read-write data */ +#define XMC_GL 6 /* Read-only global linkage */ +#define XMC_XO 7 /* Read-only extended operation */ +#define XMC_SV 8 /* Read-only supervisor call */ +#define XMC_BS 9 /* Read-write BSS */ +#define XMC_DS 10 /* Read-write descriptor csect */ +#define XMC_UC 11 /* Read-write unnamed Fortran common */ +#define XMC_TI 12 /* Read-only traceback index csect */ +#define XMC_TB 13 /* Read-only traceback table csect */ +/* 14 ??? */ +#define XMC_TC0 15 /* Read-write TOC anchor */ #define XMC_TD 16 /* Read-write data in TOC */ struct @@ -682,8 +680,6 @@ union internal_auxent } x_sect; }; -/********************** RELOCATION DIRECTIVES **********************/ - struct internal_reloc { bfd_vma r_vaddr; /* Virtual address of reference */ diff --git a/include/ctf.h b/include/ctf.h index 72a639a..819003e 100644 --- a/include/ctf.h +++ b/include/ctf.h @@ -213,8 +213,9 @@ typedef struct ctf_header #define CTF_F_NEWFUNCINFO 0x2 /* New v3 func info section format. */ #define CTF_F_IDXSORTED 0x4 /* Index sections already sorted. */ #define CTF_F_DYNSTR 0x8 /* Strings come from .dynstr. */ +#define CTF_F_ARRNELEMS 0x10 /* Array elems no longer reversed. */ #define CTF_F_MAX (CTF_F_COMPRESS | CTF_F_NEWFUNCINFO | CTF_F_IDXSORTED \ - | CTF_F_DYNSTR) + | CTF_F_DYNSTR | CTF_F_ARRNELEMS) typedef struct ctf_lblent { diff --git a/include/elf/common.h b/include/elf/common.h index 0d9a7b7..5d0f93e 100644 --- a/include/elf/common.h +++ b/include/elf/common.h @@ -575,7 +575,21 @@ #define SHT_CHECKSUM 0x6ffffff8 /* Checksum for DSO content. */ #define SHT_GNU_OBJECT_ONLY 0x6ffffff9 /* Object only */ -#define SHT_SUNW_move 0x6ffffffa +#define SHT_SUNW_symtabnsort 0x6fffffec +#define SHT_SUNW_ancillary 0x6fffffee +#define SHT_SUNW_phname 0x6fffffed +#define SHT_SUNW_capchain 0x6fffffef +#define SHT_SUNW_capinfo 0x6ffffff0 +#define SHT_SUNW_symsort 0x6ffffff1 +#define SHT_SUNW_tlssort 0x6ffffff2 +#define SHT_SUNW_LDYNSYM 0x6ffffff3 +#define SHT_SUNW_dof 0x6ffffff4 +#define SHT_SUNW_cap 0x6ffffff5 +#define SHT_SUNW_SIGNATURE 0x6ffffff6 +#define SHT_SUNW_ANNOTATE 0x6ffffff7 +#define SHT_SUNW_DEBUGSTR 0x6ffffff8 +#define SHT_SUNW_DEBUG 0x6ffffff9 +#define SHT_SUNW_move 0x6ffffffa #define SHT_SUNW_COMDAT 0x6ffffffb #define SHT_SUNW_syminfo 0x6ffffffc /* The next three section types are defined by Solaris, and are named diff --git a/include/opcode/aarch64.h b/include/opcode/aarch64.h index 4425dd4..bc5ac36 100644 --- a/include/opcode/aarch64.h +++ b/include/opcode/aarch64.h @@ -41,30 +41,39 @@ typedef uint32_t aarch64_insn; /* An enum containing all known CPU features. The values act as bit positions into aarch64_feature_set. */ enum aarch64_feature_bit { - /* All processors. */ + /* Architecture versions. */ AARCH64_FEATURE_V8, - /* ARMv8.6 processors. */ + AARCH64_FEATURE_V8_1A, + AARCH64_FEATURE_V8_2A, + AARCH64_FEATURE_V8_3A, + AARCH64_FEATURE_V8_4A, + AARCH64_FEATURE_V8_5A, AARCH64_FEATURE_V8_6A, + AARCH64_FEATURE_V8_7A, + AARCH64_FEATURE_V8_8A, + AARCH64_FEATURE_V8_9A, + + AARCH64_FEATURE_V9A, + AARCH64_FEATURE_V9_1A, + AARCH64_FEATURE_V9_2A, + AARCH64_FEATURE_V9_3A, + AARCH64_FEATURE_V9_4A, + AARCH64_FEATURE_V9_5A, + AARCH64_FEATURE_V9_6A, + + /* Armv8-A processors only - this is unset for Armv8-R. */ + AARCH64_FEATURE_V8A, + /* Armv8-R processors. */ + AARCH64_FEATURE_V8R, + /* Bfloat16 insns. */ AARCH64_FEATURE_BFLOAT16, - /* Armv8-A processors. */ - AARCH64_FEATURE_V8A, /* SVE2 instructions. */ AARCH64_FEATURE_SVE2, - /* ARMv8.2 processors. */ - AARCH64_FEATURE_V8_2A, - /* ARMv8.3 processors. */ - AARCH64_FEATURE_V8_3A, AARCH64_FEATURE_SVE2_AES, AARCH64_FEATURE_SVE2_BITPERM, AARCH64_FEATURE_SVE2_SM4, AARCH64_FEATURE_SVE2_SHA3, - /* ARMv8.4 processors. */ - AARCH64_FEATURE_V8_4A, - /* Armv8-R processors. */ - AARCH64_FEATURE_V8R, - /* Armv8.7 processors. */ - AARCH64_FEATURE_V8_7A, /* Scalable Matrix Extension. */ AARCH64_FEATURE_SME, /* Atomic 64-byte load/store. */ @@ -87,8 +96,6 @@ enum aarch64_feature_bit { AARCH64_FEATURE_LOR, /* v8.1 SIMD instructions. */ AARCH64_FEATURE_RDMA, - /* v8.1 features. */ - AARCH64_FEATURE_V8_1A, /* v8.2 FP16 instructions. */ AARCH64_FEATURE_F16, /* RAS Extensions. */ @@ -117,8 +124,6 @@ enum aarch64_feature_bit { AARCH64_FEATURE_AES, /* v8.2 FP16FML ins. */ AARCH64_FEATURE_F16_FML, - /* ARMv8.5 processors. */ - AARCH64_FEATURE_V8_5A, /* v8.5 Flag Manipulation version 2. */ AARCH64_FEATURE_FLAGMANIP, /* FRINT[32,64][Z,X] insns. */ @@ -131,10 +136,6 @@ enum aarch64_feature_bit { AARCH64_FEATURE_CVADP, /* Random Number instructions. */ AARCH64_FEATURE_RNG, - /* SCXTNUM_ELx. */ - AARCH64_FEATURE_SCXTNUM, - /* ID_PFR2 instructions. */ - AARCH64_FEATURE_ID_PFR2, /* SSBS mechanism enabled. */ AARCH64_FEATURE_SSBS, /* Compare and branch instructions. */ @@ -159,28 +160,16 @@ enum aarch64_feature_bit { AARCH64_FEATURE_F64MM, /* v8.4 Flag Manipulation. */ AARCH64_FEATURE_FLAGM, - /* Armv9.0-A processors. */ - AARCH64_FEATURE_V9A, /* SME F64F64. */ AARCH64_FEATURE_SME_F64F64, /* SME I16I64. */ AARCH64_FEATURE_SME_I16I64, - /* Armv8.8 processors. */ - AARCH64_FEATURE_V8_8A, /* Common Short Sequence Compression instructions. */ AARCH64_FEATURE_CSSC, - /* Armv8.9-A processors. */ - AARCH64_FEATURE_V8_9A, /* Check Feature Status Extension. */ AARCH64_FEATURE_CHK, /* Guarded Control Stack. */ AARCH64_FEATURE_GCS, - /* SPE Call Return branch records. */ - AARCH64_FEATURE_SPE_CRR, - /* SPE Filter by data source. */ - AARCH64_FEATURE_SPE_FDS, - /* Additional SPE events. */ - AARCH64_FEATURE_SPEv1p4, /* SME2. */ AARCH64_FEATURE_SME2, /* Translation Hardening Extension. */ @@ -191,28 +180,8 @@ enum aarch64_feature_bit { AARCH64_FEATURE_LSUI, /* ARMv8.9-A RAS Extensions. */ AARCH64_FEATURE_RASv2, - /* Delegated SError exceptions for EL3. */ - AARCH64_FEATURE_E3DSE, - /* System Control Register2. */ - AARCH64_FEATURE_SCTLR2, - /* Fine Grained Traps. */ - AARCH64_FEATURE_FGT2, - /* Physical Fault Address. */ - AARCH64_FEATURE_PFAR, /* Address Translate Stage 1. */ AARCH64_FEATURE_ATS1A, - /* Memory Attribute Index Enhancement. */ - AARCH64_FEATURE_AIE, - /* Stage 1 Permission Indirection Extension. */ - AARCH64_FEATURE_S1PIE, - /* Stage 2 Permission Indirection Extension. */ - AARCH64_FEATURE_S2PIE, - /* Stage 1 Permission Overlay Extension. */ - AARCH64_FEATURE_S1POE, - /* Stage 2 Permission Overlay Extension. */ - AARCH64_FEATURE_S2POE, - /* Extension to Translation Control Registers. */ - AARCH64_FEATURE_TCR2, /* Speculation Prediction Restriction instructions. */ AARCH64_FEATURE_PREDRES2, /* Instrumentation Extension. */ @@ -220,20 +189,6 @@ enum aarch64_feature_bit { /* 128-bit page table descriptor, system registers and instructions. */ AARCH64_FEATURE_D128, - /* Armv8.9-A/Armv9.4-A architecture Debug extension. */ - AARCH64_FEATURE_DEBUGv8p9, - /* Performance Monitors Extension. */ - AARCH64_FEATURE_PMUv3p9, - /* Performance Monitors Snapshots Extension. */ - AARCH64_FEATURE_PMUv3_SS, - /* Performance Monitors Instruction Counter Extension. */ - AARCH64_FEATURE_PMUv3_ICNTR, - /* System Performance Monitors Extension */ - AARCH64_FEATURE_SPMU, - /* System Performance Monitors Extension version 2 */ - AARCH64_FEATURE_SPMU2, - /* Performance Monitors Synchronous-Exception-Based Event Extension. */ - AARCH64_FEATURE_SEBEP, /* SME2.1 instructions. */ AARCH64_FEATURE_SME2p1, /* SVE2.1 instructions. */ @@ -252,8 +207,6 @@ enum aarch64_feature_bit { AARCH64_FEATURE_SSVE_AES, /* RCPC3 instructions. */ AARCH64_FEATURE_RCPC3, - /* Enhanced Software Step Extension. */ - AARCH64_FEATURE_STEP2, /* Checked Pointer Arithmetic instructions. */ AARCH64_FEATURE_CPA, /* FAMINMAX instructions. */ @@ -294,18 +247,6 @@ enum aarch64_feature_bit { AARCH64_FEATURE_SVE2p2, /* SME2.2. */ AARCH64_FEATURE_SME2p2, - /* Armv9.1-A processors. */ - AARCH64_FEATURE_V9_1A, - /* Armv9.2-A processors. */ - AARCH64_FEATURE_V9_2A, - /* Armv9.3-A processors. */ - AARCH64_FEATURE_V9_3A, - /* Armv9.4-A processors. */ - AARCH64_FEATURE_V9_4A, - /* Armv9.5-A processors. */ - AARCH64_FEATURE_V9_5A, - /* Armv9.6-A processors. */ - AARCH64_FEATURE_V9_6A, /* FPRCVT instructions. */ AARCH64_FEATURE_FPRCVT, /* Point of Physical Storage. */ @@ -416,8 +357,6 @@ static_assert ((AA64_REPLICATE (REP_PLUS, AA64_REPVAL, | AARCH64_FEATBIT (X, SB) \ | AARCH64_FEATBIT (X, PREDRES) \ | AARCH64_FEATBIT (X, CVADP) \ - | AARCH64_FEATBIT (X, SCXTNUM) \ - | AARCH64_FEATBIT (X, ID_PFR2) \ | AARCH64_FEATBIT (X, SSBS)) #define AARCH64_ARCH_V8_6A_FEATURES(X) (AARCH64_FEATBIT (X, V8_6A) \ | AARCH64_FEATBIT (X, BFLOAT16) \ @@ -431,26 +370,8 @@ static_assert ((AA64_REPLICATE (REP_PLUS, AA64_REPVAL, | AARCH64_FEATBIT (X, HBC)) #define AARCH64_ARCH_V8_9A_FEATURES(X) (AARCH64_FEATBIT (X, V8_9A) \ | AARCH64_FEATBIT (X, CSSC) \ - | AARCH64_FEATBIT (X, SPEv1p4) \ - | AARCH64_FEATBIT (X, SPE_CRR) \ - | AARCH64_FEATBIT (X, SPE_FDS) \ | AARCH64_FEATBIT (X, RASv2) \ - | AARCH64_FEATBIT (X, SCTLR2) \ - | AARCH64_FEATBIT (X, FGT2) \ - | AARCH64_FEATBIT (X, PFAR) \ | AARCH64_FEATBIT (X, ATS1A) \ - | AARCH64_FEATBIT (X, AIE) \ - | AARCH64_FEATBIT (X, S1PIE) \ - | AARCH64_FEATBIT (X, S2PIE) \ - | AARCH64_FEATBIT (X, S1POE) \ - | AARCH64_FEATBIT (X, S2POE) \ - | AARCH64_FEATBIT (X, TCR2) \ - | AARCH64_FEATBIT (X, DEBUGv8p9) \ - | AARCH64_FEATBIT (X, PMUv3p9) \ - | AARCH64_FEATBIT (X, PMUv3_SS) \ - | AARCH64_FEATBIT (X, PMUv3_ICNTR) \ - | AARCH64_FEATBIT (X, SPMU) \ - | AARCH64_FEATBIT (X, SEBEP) \ | AARCH64_FEATBIT (X, PREDRES2) \ ) @@ -471,9 +392,6 @@ static_assert ((AA64_REPLICATE (REP_PLUS, AA64_REPVAL, | AARCH64_FEATBIT (X, CPA) \ | AARCH64_FEATBIT (X, LUT) \ | AARCH64_FEATBIT (X, FAMINMAX)\ - | AARCH64_FEATBIT (X, E3DSE) \ - | AARCH64_FEATBIT (X, SPMU2) \ - | AARCH64_FEATBIT (X, STEP2) \ ) #define AARCH64_ARCH_V9_6A_FEATURES(X) (AARCH64_FEATBIT (X, V9_6A) \ | AARCH64_FEATBIT (X, CMPBR) \ @@ -1703,7 +1621,7 @@ extern bool aarch64_sys_ins_reg_has_xt (const aarch64_sys_ins_reg *); extern bool aarch64_sys_ins_reg_supported_p (const aarch64_feature_set, const char *reg_name, - uint32_t, const aarch64_feature_set *); + const aarch64_feature_set *); extern const aarch64_sys_ins_reg aarch64_sys_regs_ic []; extern const aarch64_sys_ins_reg aarch64_sys_regs_dc []; diff --git a/include/same-inode.h b/include/same-inode.h new file mode 100644 index 0000000..f65f3d0 --- /dev/null +++ b/include/same-inode.h @@ -0,0 +1,47 @@ +/* Determine whether two stat buffers are known to refer to the same file. + + Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc. + + This file is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. + + This file 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 Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +#ifndef SAME_INODE_H +# define SAME_INODE_H 1 + +# include <sys/types.h> + +# if defined __VMS && __CRTL_VER < 80200000 +# define SAME_INODE(a, b) \ + ((a).st_ino[0] == (b).st_ino[0] \ + && (a).st_ino[1] == (b).st_ino[1] \ + && (a).st_ino[2] == (b).st_ino[2] \ + && (a).st_dev == (b).st_dev) +# elif defined _WIN32 && ! defined __CYGWIN__ + /* Native Windows. */ +# if _GL_WINDOWS_STAT_INODES + /* stat() and fstat() set st_dev and st_ino to 0 if information about + the inode is not available. */ +# define SAME_INODE(a, b) \ + (!((a).st_ino == 0 && (a).st_dev == 0) \ + && (a).st_ino == (b).st_ino && (a).st_dev == (b).st_dev) +# else + /* stat() and fstat() set st_ino to 0 always. */ +# define SAME_INODE(a, b) 0 +# endif +# else +# define SAME_INODE(a, b) \ + ((a).st_ino == (b).st_ino \ + && (a).st_dev == (b).st_dev) +# endif + +#endif diff --git a/include/vms/eihd.h b/include/vms/eihd.h index e655cd6..2b8e1b1 100644 --- a/include/vms/eihd.h +++ b/include/vms/eihd.h @@ -140,6 +140,8 @@ struct vms_eihd #define EIHD__Q_SYMVVA 40 #define EIHD__L_IMGTYPE 52 +/* ext_fixup_off field offset. Some headers may be missing this and + following fields. */ #define EIHD__C_LENGTH 104 #endif /* _VMS_EIHD_H */ |