Home | History | Annotate | Download | only in som
      1 /* SOM lst definitions for BFD.
      2    Copyright (C) 2010-2014 Free Software Foundation, Inc.
      3    Contributed by Tristan Gingold <gingold (at) adacore.com>, AdaCore.
      4 
      5    This file is part of BFD, the Binary File Descriptor library.
      6 
      7    This program is free software; you can redistribute it and/or modify
      8    it under the terms of the GNU General Public License as published by
      9    the Free Software Foundation; either version 3 of the License, or
     10    (at your option) any later version.
     11 
     12    This program is distributed in the hope that it will be useful,
     13    but WITHOUT ANY WARRANTY; without even the implied warranty of
     14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15    GNU General Public License for more details.
     16 
     17    You should have received a copy of the GNU General Public License
     18    along with this program; if not, write to the Free Software Foundation,
     19    Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
     20 
     21 #ifndef _SOM_LST_H
     22 #define _SOM_LST_H
     23 
     24 #include "clock.h"
     25 
     26 /* See 4.2 Libraray Symbol Table Header Record.  */
     27 struct som_external_lst_header
     28 {
     29   unsigned char system_id[2];
     30   unsigned char a_magic[2];
     31   unsigned char version_id[4];
     32   struct som_external_clock file_time;
     33   unsigned char hash_loc[4];
     34   unsigned char hash_size[4];
     35   unsigned char module_count[4];
     36   unsigned char module_limit[4];
     37   unsigned char dir_loc[4];
     38   unsigned char export_loc[4];
     39   unsigned char export_count[4];
     40   unsigned char import_loc[4];
     41   unsigned char aux_loc[4];
     42   unsigned char aux_size[4];
     43   unsigned char string_loc[4];
     44   unsigned char string_size[4];
     45   unsigned char free_list[4];
     46   unsigned char file_end[4];
     47   unsigned char checksum[4];
     48 };
     49 
     50 #define VERSION_ID 85082112
     51 #define LIBMAGIC 0x0619
     52 #define LIBMAGIC_EXEC 0x0104
     53 
     54 struct som_external_lst_symbol_record
     55 {
     56   unsigned char flags[4];
     57   unsigned char name[4];
     58   unsigned char qualifier_name[4];
     59   unsigned char symbol_info[4];
     60   unsigned char symbol_value[4];
     61   unsigned char symbol_descriptor[4];
     62   unsigned char reserved;
     63   unsigned char max_num_args;
     64   unsigned char min_num_args;
     65   unsigned char num_args;
     66   unsigned char som_index[4];
     67   unsigned char symbol_key[4];
     68   unsigned char next_entry[4];
     69 };
     70 
     71 /* Fields of flags.  */
     72 #define LST_SYMBOL_HIDDEN		(1 << 31)
     73 #define LST_SYMBOL_SECONDARY_DEF	(1 << 30)
     74 #define LST_SYMBOL_SYMBOL_TYPE_SH	24
     75 #define LST_SYMBOL_SYMBOL_SCOPE_SH	20
     76 #define LST_SYMBOL_CHECK_LEVEL_SH	17
     77 #define LST_SYMBOL_MUST_QUALIFY		(1 << 16)
     78 #define LST_SYMBOL_INITIALY_FROZEN	(1 << 15)
     79 #define LST_SYMBOL_MEMORY_RESIDENT	(1 << 14)
     80 #define LST_SYMBOL_IS_COMMON		(1 << 13)
     81 #define LST_SYMBOL_DUP_COMMON		(1 << 12)
     82 #define LST_SYMBOL_XLEAST_SH		10
     83 #define LST_SYMBOL_ARG_RELOC_SH		0
     84 
     85 /* According to 4.3.2 SOM Directory.  */
     86 
     87 struct som_external_som_entry
     88 {
     89   unsigned char location[4];
     90   unsigned char length[4];
     91 };
     92 
     93 #endif /* _SOM_LST_H */
     94