Back to index

cell-binutils  2.17cvs20070401
aout64.h
Go to the documentation of this file.
00001 /* `a.out' object-file definitions, including extensions to 64-bit fields
00002 
00003    Copyright 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
00004 
00005    This program is free software; you can redistribute it and/or modify
00006    it under the terms of the GNU General Public License as published by
00007    the Free Software Foundation; either version 2 of the License, or
00008    (at your option) any later version.
00009    
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014    
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software
00017    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00018 
00019 #ifndef __A_OUT_64_H__
00020 #define __A_OUT_64_H__
00021 
00022 #ifndef BYTES_IN_WORD
00023 #define BYTES_IN_WORD 4
00024 #endif
00025 
00026 /* This is the layout on disk of the 32-bit or 64-bit exec header.  */
00027 
00028 #ifndef external_exec
00029 struct external_exec 
00030 {
00031   bfd_byte e_info[4];                  /* Magic number and stuff.  */
00032   bfd_byte e_text[BYTES_IN_WORD];   /* Length of text section in bytes.  */
00033   bfd_byte e_data[BYTES_IN_WORD];   /* Length of data section in bytes.  */
00034   bfd_byte e_bss[BYTES_IN_WORD];    /* Length of bss area in bytes.  */
00035   bfd_byte e_syms[BYTES_IN_WORD];   /* Length of symbol table in bytes.  */
00036   bfd_byte e_entry[BYTES_IN_WORD];  /* Start address.  */
00037   bfd_byte e_trsize[BYTES_IN_WORD]; /* Length of text relocation info.  */
00038   bfd_byte e_drsize[BYTES_IN_WORD]; /* Length of data relocation info.  */
00039 };
00040 
00041 #define       EXEC_BYTES_SIZE      (4 + BYTES_IN_WORD * 7)
00042 
00043 /* Magic numbers for a.out files.  */
00044 
00045 #if ARCH_SIZE==64
00046 #define OMAGIC 0x1001              /* Code indicating object file.  */
00047 #define ZMAGIC 0x1002              /* Code indicating demand-paged executable.  */
00048 #define NMAGIC 0x1003              /* Code indicating pure executable.  */
00049 
00050 /* There is no 64-bit QMAGIC as far as I know.  */
00051 
00052 #define N_BADMAG(x)    (N_MAGIC(x) != OMAGIC            \
00053                      && N_MAGIC(x) != NMAGIC            \
00054                      && N_MAGIC(x) != ZMAGIC)
00055 #else
00056 #define OMAGIC 0407         /* Object file or impure executable.  */
00057 #define NMAGIC 0410         /* Code indicating pure executable.  */
00058 #define ZMAGIC 0413         /* Code indicating demand-paged executable.  */
00059 #define BMAGIC 0415         /* Used by a b.out object.  */
00060 
00061 /* This indicates a demand-paged executable with the header in the text.
00062    It is used by 386BSD (and variants) and Linux, at least.  */
00063 #ifndef QMAGIC
00064 #define QMAGIC 0314
00065 #endif
00066 # ifndef N_BADMAG
00067 #  define N_BADMAG(x)         (N_MAGIC(x) != OMAGIC            \
00068                      && N_MAGIC(x) != NMAGIC            \
00069                      && N_MAGIC(x) != ZMAGIC \
00070                       && N_MAGIC(x) != QMAGIC)
00071 # endif /* N_BADMAG */
00072 #endif
00073 
00074 #endif
00075 
00076 #ifdef QMAGIC
00077 #define N_IS_QMAGIC(x) (N_MAGIC (x) == QMAGIC)
00078 #else
00079 #define N_IS_QMAGIC(x) (0)
00080 #endif
00081 
00082 /* The difference between TARGET_PAGE_SIZE and N_SEGSIZE is that TARGET_PAGE_SIZE is
00083    the finest granularity at which you can page something, thus it
00084    controls the padding (if any) before the text segment of a ZMAGIC
00085    file.  N_SEGSIZE is the resolution at which things can be marked as
00086    read-only versus read/write, so it controls the padding between the
00087    text segment and the data segment (in memory; on disk the padding
00088    between them is TARGET_PAGE_SIZE).  TARGET_PAGE_SIZE and N_SEGSIZE are the same
00089    for most machines, but different for sun3.  */
00090 
00091 /* By default, segment size is constant.  But some machines override this
00092    to be a function of the a.out header (e.g. machine type).  */
00093 
00094 #ifndef       N_SEGSIZE
00095 #define       N_SEGSIZE(x)  SEGMENT_SIZE
00096 #endif
00097 
00098 /* Virtual memory address of the text section.
00099    This is getting very complicated.  A good reason to discard a.out format
00100    for something that specifies these fields explicitly.  But til then...
00101 
00102    * OMAGIC and NMAGIC files:
00103        (object files: text for "relocatable addr 0" right after the header)
00104        start at 0, offset is EXEC_BYTES_SIZE, size as stated.
00105    * The text address, offset, and size of ZMAGIC files depend
00106      on the entry point of the file:
00107      * entry point below TEXT_START_ADDR:
00108        (hack for SunOS shared libraries)
00109        start at 0, offset is 0, size as stated.
00110      * If N_HEADER_IN_TEXT(x) is true (which defaults to being the
00111        case when the entry point is EXEC_BYTES_SIZE or further into a page):
00112        no padding is needed; text can start after exec header.  Sun
00113        considers the text segment of such files to include the exec header;
00114        for BFD's purposes, we don't, which makes more work for us.
00115        start at TEXT_START_ADDR + EXEC_BYTES_SIZE, offset is EXEC_BYTES_SIZE,
00116        size as stated minus EXEC_BYTES_SIZE.
00117      * If N_HEADER_IN_TEXT(x) is false (which defaults to being the case when
00118        the entry point is less than EXEC_BYTES_SIZE into a page (e.g. page
00119        aligned)): (padding is needed so that text can start at a page boundary)
00120        start at TEXT_START_ADDR, offset TARGET_PAGE_SIZE, size as stated.
00121 
00122     Specific configurations may want to hardwire N_HEADER_IN_TEXT,
00123     for efficiency or to allow people to play games with the entry point.
00124     In that case, you would #define N_HEADER_IN_TEXT(x) as 1 for sunos,
00125     and as 0 for most other hosts (Sony News, Vax Ultrix, etc).
00126     (Do this in the appropriate bfd target file.)
00127     (The default is a heuristic that will break if people try changing
00128     the entry point, perhaps with the ld -e flag.)
00129 
00130     * QMAGIC is always like a ZMAGIC for which N_HEADER_IN_TEXT is true,
00131     and for which the starting address is TARGET_PAGE_SIZE (or should this be
00132     SEGMENT_SIZE?) (TEXT_START_ADDR only applies to ZMAGIC, not to QMAGIC).  */
00133 
00134 /* This macro is only relevant for ZMAGIC files; QMAGIC always has the header
00135    in the text.  */
00136 #ifndef N_HEADER_IN_TEXT
00137 #define N_HEADER_IN_TEXT(x) \
00138   (((x).a_entry & (TARGET_PAGE_SIZE-1)) >= EXEC_BYTES_SIZE)
00139 #endif
00140 
00141 /* Sun shared libraries, not linux.  This macro is only relevant for ZMAGIC
00142    files.  */
00143 #ifndef N_SHARED_LIB
00144 #if defined (TEXT_START_ADDR) && TEXT_START_ADDR == 0
00145 #define N_SHARED_LIB(x) (0)
00146 #else
00147 #define N_SHARED_LIB(x) ((x).a_entry < TEXT_START_ADDR)
00148 #endif
00149 #endif
00150 
00151 /* Returning 0 not TEXT_START_ADDR for OMAGIC and NMAGIC is based on
00152    the assumption that we are dealing with a .o file, not an
00153    executable.  This is necessary for OMAGIC (but means we don't work
00154    right on the output from ld -N); more questionable for NMAGIC.  */
00155 
00156 #ifndef N_TXTADDR
00157 #define N_TXTADDR(x) \
00158     (/* The address of a QMAGIC file is always one page in,           \
00159         with the header in the text.  */                       \
00160      N_IS_QMAGIC (x)                                           \
00161      ? (bfd_vma) TARGET_PAGE_SIZE + EXEC_BYTES_SIZE                   \
00162      : (N_MAGIC (x) != ZMAGIC                                         \
00163        ? (bfd_vma) 0 /* Object file or NMAGIC.  */                    \
00164        : (N_SHARED_LIB (x)                                     \
00165           ? (bfd_vma) 0                                        \
00166           : (N_HEADER_IN_TEXT (x)                              \
00167              ? (bfd_vma) TEXT_START_ADDR + EXEC_BYTES_SIZE            \
00168              : (bfd_vma) TEXT_START_ADDR))))
00169 #endif
00170 
00171 /* If N_HEADER_IN_TEXT is not true for ZMAGIC, there is some padding
00172    to make the text segment start at a certain boundary.  For most
00173    systems, this boundary is TARGET_PAGE_SIZE.  But for Linux, in the
00174    time-honored tradition of crazy ZMAGIC hacks, it is 1024 which is
00175    not what TARGET_PAGE_SIZE needs to be for QMAGIC.  */
00176 
00177 #ifndef ZMAGIC_DISK_BLOCK_SIZE
00178 #define ZMAGIC_DISK_BLOCK_SIZE TARGET_PAGE_SIZE
00179 #endif
00180 
00181 #define N_DISK_BLOCK_SIZE(x) \
00182   (N_MAGIC(x) == ZMAGIC ? ZMAGIC_DISK_BLOCK_SIZE : TARGET_PAGE_SIZE)
00183 
00184 /* Offset in an a.out of the start of the text section. */
00185 #ifndef N_TXTOFF
00186 #define N_TXTOFF(x)                                            \
00187     (/* For {O,N,Q}MAGIC, no padding.  */                      \
00188      N_MAGIC (x) != ZMAGIC                                     \
00189      ? EXEC_BYTES_SIZE                                                \
00190      : (N_SHARED_LIB (x)                                       \
00191        ? 0                                                     \
00192        : (N_HEADER_IN_TEXT (x)                                        \
00193           ? EXEC_BYTES_SIZE        /* No padding.  */          \
00194           : ZMAGIC_DISK_BLOCK_SIZE /* A page of padding.  */)))
00195 #endif
00196 /* Size of the text section.  It's always as stated, except that we
00197    offset it to `undo' the adjustment to N_TXTADDR and N_TXTOFF
00198    for ZMAGIC files that nominally include the exec header
00199    as part of the first page of text.  (BFD doesn't consider the
00200    exec header to be part of the text segment.)  */
00201 #ifndef N_TXTSIZE
00202 #define       N_TXTSIZE(x) \
00203   (/* For QMAGIC, we don't consider the header part of the text section.  */\
00204    N_IS_QMAGIC (x)                                             \
00205    ? (x).a_text - EXEC_BYTES_SIZE                              \
00206    : ((N_MAGIC (x) != ZMAGIC || N_SHARED_LIB (x))                     \
00207       ? (x).a_text                                             \
00208       : (N_HEADER_IN_TEXT (x)                                         \
00209         ? (x).a_text - EXEC_BYTES_SIZE    /* No padding.  */          \
00210         : (x).a_text               /* A page of padding.  */ )))
00211 #endif
00212 /* The address of the data segment in virtual memory.
00213    It is the text segment address, plus text segment size, rounded
00214    up to a N_SEGSIZE boundary for pure or pageable files.  */
00215 #ifndef N_DATADDR
00216 #define N_DATADDR(x) \
00217   (N_MAGIC (x) == OMAGIC                                       \
00218    ? (N_TXTADDR (x) + N_TXTSIZE (x))                                  \
00219    : (N_SEGSIZE (x) + ((N_TXTADDR (x) + N_TXTSIZE (x) - 1)            \
00220                      & ~ (bfd_vma) (N_SEGSIZE (x) - 1))))
00221 #endif
00222 /* The address of the BSS segment -- immediately after the data segment.  */
00223 
00224 #define N_BSSADDR(x) (N_DATADDR (x) + (x).a_data)
00225 
00226 /* Offsets of the various portions of the file after the text segment.  */
00227 
00228 /* For {Q,Z}MAGIC, there is padding to make the data segment start on
00229    a page boundary.  Most of the time the a_text field (and thus
00230    N_TXTSIZE) already contains this padding.  It is possible that for
00231    BSDI and/or 386BSD it sometimes doesn't contain the padding, and
00232    perhaps we should be adding it here.  But this seems kind of
00233    questionable and probably should be BSDI/386BSD-specific if we do
00234    do it.
00235 
00236    For NMAGIC (at least for hp300 BSD, probably others), there is
00237    padding in memory only, not on disk, so we must *not* ever pad here
00238    for NMAGIC.  */
00239 
00240 #ifndef N_DATOFF
00241 #define N_DATOFF(x)  (N_TXTOFF (x) + N_TXTSIZE (x))
00242 #endif
00243 #ifndef N_TRELOFF
00244 #define N_TRELOFF(x) (N_DATOFF (x) + (x).a_data)
00245 #endif
00246 #ifndef N_DRELOFF
00247 #define N_DRELOFF(x) (N_TRELOFF (x) + (x).a_trsize)
00248 #endif
00249 #ifndef N_SYMOFF
00250 #define N_SYMOFF(x)  (N_DRELOFF (x) + (x).a_drsize)
00251 #endif
00252 #ifndef N_STROFF
00253 #define N_STROFF(x)  (N_SYMOFF (x) + (x).a_syms)
00254 #endif
00255 
00256 /* Symbols */
00257 #ifndef external_nlist
00258 struct external_nlist
00259 {
00260   bfd_byte e_strx[BYTES_IN_WORD];  /* Index into string table of name.  */
00261   bfd_byte e_type[1];                     /* Type of symbol.  */
00262   bfd_byte e_other[1];                    /* Misc info (usually empty).  */
00263   bfd_byte e_desc[2];                     /* Description field.  */
00264   bfd_byte e_value[BYTES_IN_WORD]; /* Value of symbol.  */
00265 };
00266 #define EXTERNAL_NLIST_SIZE (BYTES_IN_WORD+4+BYTES_IN_WORD)
00267 #endif
00268 
00269 struct internal_nlist
00270 {
00271   unsigned long n_strx;                   /* Index into string table of name.  */
00272   unsigned char n_type;                   /* Type of symbol.  */
00273   unsigned char n_other;           /* Misc info (usually empty).  */
00274   unsigned short n_desc;           /* Description field.  */
00275   bfd_vma n_value;                 /* Value of symbol.  */
00276 };
00277 
00278 /* The n_type field is the symbol type, containing:  */
00279 
00280 #define N_UNDF       0      /* Undefined symbol.  */
00281 #define N_ABS        2      /* Absolute symbol -- defined at particular addr.  */
00282 #define N_TEXT       4      /* Text sym -- defined at offset in text seg.  */
00283 #define N_DATA       6      /* Data sym -- defined at offset in data seg.  */
00284 #define N_BSS        8      /* BSS  sym -- defined at offset in zero'd seg.  */
00285 #define       N_COMM 0x12   /* Common symbol (visible after shared lib dynlink).  */
00286 #define N_FN  0x1f   /* File name of .o file.  */
00287 #define       N_FN_SEQ 0x0C /* N_FN from Sequent compilers (sigh).  */
00288 /* Note: N_EXT can only be usefully OR-ed with N_UNDF, N_ABS, N_TEXT,
00289    N_DATA, or N_BSS.  When the low-order bit of other types is set,
00290    (e.g. N_WARNING versus N_FN), they are two different types.  */
00291 #define N_EXT        1      /* External symbol (as opposed to local-to-this-file).  */
00292 #define N_TYPE  0x1e
00293 #define N_STAB       0xe0   /* If any of these bits are on, it's a debug symbol.  */
00294 
00295 #define N_INDR 0x0a
00296 
00297 /* The following symbols refer to set elements.
00298    All the N_SET[ATDB] symbols with the same name form one set.
00299    Space is allocated for the set in the text section, and each set
00300    elements value is stored into one word of the space.
00301    The first word of the space is the length of the set (number of elements).
00302 
00303    The address of the set is made into an N_SETV symbol
00304    whose name is the same as the name of the set.
00305    This symbol acts like a N_DATA global symbol
00306    in that it can satisfy undefined external references.  */
00307 
00308 /* These appear as input to LD, in a .o file.  */
00309 #define       N_SETA 0x14          /* Absolute set element symbol.  */
00310 #define       N_SETT 0x16          /* Text set element symbol.  */
00311 #define       N_SETD 0x18          /* Data set element symbol.  */
00312 #define       N_SETB 0x1A          /* Bss set element symbol.  */
00313 
00314 /* This is output from LD.  */
00315 #define N_SETV       0x1C          /* Pointer to set vector in data area.  */
00316 
00317 /* Warning symbol. The text gives a warning message, the next symbol
00318    in the table will be undefined. When the symbol is referenced, the
00319    message is printed.  */
00320 
00321 #define       N_WARNING 0x1e
00322 
00323 /* Weak symbols.  These are a GNU extension to the a.out format.  The
00324    semantics are those of ELF weak symbols.  Weak symbols are always
00325    externally visible.  The N_WEAK? values are squeezed into the
00326    available slots.  The value of a N_WEAKU symbol is 0.  The values
00327    of the other types are the definitions.  */
00328 #define N_WEAKU      0x0d          /* Weak undefined symbol.  */
00329 #define N_WEAKA 0x0e        /* Weak absolute symbol.  */
00330 #define N_WEAKT 0x0f        /* Weak text symbol.  */
00331 #define N_WEAKD 0x10        /* Weak data symbol.  */
00332 #define N_WEAKB 0x11        /* Weak bss symbol.  */
00333 
00334 /* Relocations 
00335 
00336   There       are two types of relocation flavours for a.out systems,
00337   standard and extended. The standard form is used on systems where the
00338   instruction has room for all the bits of an offset to the operand, whilst
00339   the extended form is used when an address operand has to be split over n
00340   instructions. Eg, on the 68k, each move instruction can reference
00341   the target with a displacement of 16 or 32 bits. On the sparc, move
00342   instructions use an offset of 14 bits, so the offset is stored in
00343   the reloc field, and the data in the section is ignored.  */
00344 
00345 /* This structure describes a single relocation to be performed.
00346    The text-relocation section of the file is a vector of these structures,
00347    all of which apply to the text section.
00348    Likewise, the data-relocation section applies to the data section.  */
00349 
00350 struct reloc_std_external
00351 {
00352   bfd_byte r_address[BYTES_IN_WORD];      /* Offset of of data to relocate.  */
00353   bfd_byte r_index[3];                    /* Symbol table index of symbol.  */
00354   bfd_byte r_type[1];                     /* Relocation type.  */
00355 };
00356 
00357 #define       RELOC_STD_BITS_PCREL_BIG    ((unsigned int) 0x80)
00358 #define       RELOC_STD_BITS_PCREL_LITTLE ((unsigned int) 0x01)
00359 
00360 #define       RELOC_STD_BITS_LENGTH_BIG   ((unsigned int) 0x60)
00361 #define       RELOC_STD_BITS_LENGTH_SH_BIG       5
00362 #define       RELOC_STD_BITS_LENGTH_LITTLE       ((unsigned int) 0x06)
00363 #define       RELOC_STD_BITS_LENGTH_SH_LITTLE    1
00364 
00365 #define       RELOC_STD_BITS_EXTERN_BIG   ((unsigned int) 0x10)
00366 #define       RELOC_STD_BITS_EXTERN_LITTLE       ((unsigned int) 0x08)
00367 
00368 #define       RELOC_STD_BITS_BASEREL_BIG  ((unsigned int) 0x08)
00369 #define       RELOC_STD_BITS_BASEREL_LITTLE      ((unsigned int) 0x10)
00370 
00371 #define       RELOC_STD_BITS_JMPTABLE_BIG ((unsigned int) 0x04)
00372 #define       RELOC_STD_BITS_JMPTABLE_LITTLE     ((unsigned int) 0x20)
00373 
00374 #define       RELOC_STD_BITS_RELATIVE_BIG ((unsigned int) 0x02)
00375 #define       RELOC_STD_BITS_RELATIVE_LITTLE     ((unsigned int) 0x40)
00376 
00377 #define       RELOC_STD_SIZE       (BYTES_IN_WORD + 3 + 1)            /* Bytes per relocation entry.  */
00378 
00379 struct reloc_std_internal
00380 {
00381   bfd_vma r_address;        /* Address (within segment) to be relocated.  */
00382   /* The meaning of r_symbolnum depends on r_extern.  */
00383   unsigned int r_symbolnum:24;
00384   /* Nonzero means value is a pc-relative offset
00385      and it should be relocated for changes in its own address
00386      as well as for changes in the symbol or section specified.  */
00387   unsigned int r_pcrel:1;
00388   /* Length (as exponent of 2) of the field to be relocated.
00389      Thus, a value of 2 indicates 1<<2 bytes.  */
00390   unsigned int r_length:2;
00391   /* 1 => relocate with value of symbol.
00392      r_symbolnum is the index of the symbol
00393      in files the symbol table.
00394      0 => relocate with the address of a segment.
00395      r_symbolnum is N_TEXT, N_DATA, N_BSS or N_ABS
00396      (the N_EXT bit may be set also, but signifies nothing).  */
00397   unsigned int r_extern:1;
00398   /* The next three bits are for SunOS shared libraries, and seem to
00399      be undocumented.  */
00400   unsigned int r_baserel:1; /* Linkage table relative.  */
00401   unsigned int r_jmptable:1;       /* pc-relative to jump table.  */
00402   unsigned int r_relative:1;       /* "relative relocation".  */
00403   /* unused */
00404   unsigned int r_pad:1;            /* Padding -- set to zero.  */
00405 };
00406 
00407 
00408 /* EXTENDED RELOCS.   */
00409 
00410 struct reloc_ext_external
00411 {
00412   bfd_byte r_address[BYTES_IN_WORD];      /* Offset of of data to relocate.  */
00413   bfd_byte r_index[3];                    /* Symbol table index of symbol.  */
00414   bfd_byte r_type[1];                     /* Relocation type.  */
00415   bfd_byte r_addend[BYTES_IN_WORD];       /* Datum addend.  */
00416 };
00417 
00418 #ifndef RELOC_EXT_BITS_EXTERN_BIG
00419 #define       RELOC_EXT_BITS_EXTERN_BIG   ((unsigned int) 0x80)
00420 #endif
00421 
00422 #ifndef RELOC_EXT_BITS_EXTERN_LITTLE
00423 #define       RELOC_EXT_BITS_EXTERN_LITTLE       ((unsigned int) 0x01)
00424 #endif
00425 
00426 #ifndef RELOC_EXT_BITS_TYPE_BIG
00427 #define       RELOC_EXT_BITS_TYPE_BIG            ((unsigned int) 0x1F)
00428 #endif
00429 
00430 #ifndef RELOC_EXT_BITS_TYPE_SH_BIG
00431 #define       RELOC_EXT_BITS_TYPE_SH_BIG  0
00432 #endif
00433 
00434 #ifndef RELOC_EXT_BITS_TYPE_LITTLE
00435 #define       RELOC_EXT_BITS_TYPE_LITTLE  ((unsigned int) 0xF8)
00436 #endif
00437 
00438 #ifndef RELOC_EXT_BITS_TYPE_SH_LITTLE
00439 #define       RELOC_EXT_BITS_TYPE_SH_LITTLE      3
00440 #endif
00441 
00442 /* Bytes per relocation entry.  */
00443 #define       RELOC_EXT_SIZE       (BYTES_IN_WORD + 3 + 1 + BYTES_IN_WORD)
00444 
00445 enum reloc_type
00446 {
00447   /* Simple relocations.  */
00448   RELOC_8,                  /* data[0:7] = addend + sv         */
00449   RELOC_16,                 /* data[0:15] = addend + sv               */
00450   RELOC_32,                 /* data[0:31] = addend + sv               */
00451   /* PC-rel displacement.  */
00452   RELOC_DISP8,                     /* data[0:7] = addend - pc + sv    */
00453   RELOC_DISP16,                    /* data[0:15] = addend - pc + sv   */
00454   RELOC_DISP32,                    /* data[0:31] = addend - pc + sv   */
00455   /* Special.  */
00456   RELOC_WDISP30,            /* data[0:29] = (addend + sv - pc)>>2     */
00457   RELOC_WDISP22,            /* data[0:21] = (addend + sv - pc)>>2     */
00458   RELOC_HI22,               /* data[0:21] = (addend + sv)>>10  */
00459   RELOC_22,                 /* data[0:21] = (addend + sv)             */
00460   RELOC_13,                 /* data[0:12] = (addend + sv)             */
00461   RELOC_LO10,               /* data[0:9] = (addend + sv)              */
00462   RELOC_SFA_BASE,           
00463   RELOC_SFA_OFF13,
00464   /* P.I.C. (base-relative).  */
00465   RELOC_BASE10,             /* Not sure - maybe we can do this the */
00466   RELOC_BASE13,                    /* right way now */
00467   RELOC_BASE22,
00468   /* For some sort of pc-rel P.I.C. (?)  */
00469   RELOC_PC10,
00470   RELOC_PC22,
00471   /* P.I.C. jump table.  */
00472   RELOC_JMP_TBL,
00473   /* Reputedly for shared libraries somehow.  */
00474   RELOC_SEGOFF16,
00475   RELOC_GLOB_DAT,
00476   RELOC_JMP_SLOT,
00477   RELOC_RELATIVE,
00478 
00479   RELOC_11,   
00480   RELOC_WDISP2_14,
00481   RELOC_WDISP19,
00482   RELOC_HHI22,                     /* data[0:21] = (addend + sv) >> 42     */
00483   RELOC_HLO10,                     /* data[0:9] = (addend + sv) >> 32      */
00484   
00485   /* 29K relocation types.  */
00486   RELOC_JUMPTARG,
00487   RELOC_CONST,
00488   RELOC_CONSTH,
00489   
00490   /* All the new ones I can think of, for sparc v9.  */
00491   RELOC_64,                 /* data[0:63] = addend + sv               */
00492   RELOC_DISP64,                    /* data[0:63] = addend - pc + sv   */
00493   RELOC_WDISP21,            /* data[0:20] = (addend + sv - pc)>>2     */
00494   RELOC_DISP21,                    /* data[0:20] = addend - pc + sv        */
00495   RELOC_DISP14,                    /* data[0:13] = addend - pc + sv   */
00496   /* Q .
00497      What are the other ones,
00498      Since this is a clean slate, can we throw away the ones we dont
00499      understand ? Should we sort the values ? What about using a
00500      microcode format like the 68k ?  */
00501   NO_RELOC
00502   };
00503 
00504 
00505 struct reloc_internal
00506 {
00507   bfd_vma r_address;        /* Offset of of data to relocate.  */
00508   long r_index;             /* Symbol table index of symbol.  */
00509   enum reloc_type r_type;   /* Relocation type.  */
00510   bfd_vma r_addend;         /* Datum addend.  */
00511 };
00512 
00513 /* Q.
00514    Should the length of the string table be 4 bytes or 8 bytes ?
00515 
00516    Q.
00517    What about archive indexes ?  */
00518 
00519 #endif                      /* __A_OUT_64_H__ */