Home | History | Annotate | Download | only in bcc
      1 /*
      2  * Copyright 2010, The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *     http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 #ifndef BCC_MCCACHE_H
     18 #define BCC_MCCACHE_H
     19 
     20 #include <stdint.h>
     21 #include <sys/types.h>
     22 
     23 #include "bcc_cache.h"
     24 
     25 /* BCC Cache File Magic Word */
     26 #define MCO_MAGIC "\0bcc"
     27 
     28 /* BCC Cache File Version, encoded in 4 bytes of ASCII */
     29 #define MCO_VERSION "001\0"
     30 
     31 /* BCC Cache Header Structure */
     32 struct MCO_Header {
     33   /* magic and version */
     34   uint8_t magic[4];
     35   uint8_t version[4];
     36 
     37   /* machine-dependent integer type size */
     38   uint8_t endianness;
     39   uint8_t sizeof_off_t;
     40   uint8_t sizeof_size_t;
     41   uint8_t sizeof_ptr_t;
     42 
     43   /* string pool section */
     44   off_t str_pool_offset;
     45   size_t str_pool_size;
     46 
     47   /* dependancy table */
     48   off_t depend_tab_offset;
     49   size_t depend_tab_size;
     50 
     51   /* relocation table section */
     52   off_t reloc_tab_offset;
     53   size_t reloc_tab_size;
     54 
     55   /* pragma list section */
     56   off_t pragma_list_offset;
     57   size_t pragma_list_size;
     58 
     59   /* function table */
     60   off_t func_table_offset;
     61   size_t func_table_size;
     62 
     63   /* function table */
     64   off_t object_slot_list_offset;
     65   size_t object_slot_list_size;
     66 
     67   /* export variable name list section */
     68   off_t export_var_name_list_offset;
     69   size_t export_var_name_list_size;
     70 
     71   /* export function name list section */
     72   off_t export_func_name_list_offset;
     73   size_t export_func_name_list_size;
     74 
     75   /* dirty hack for libRS */
     76   /* TODO: This should be removed in the future */
     77   uint32_t libRS_threadable;
     78 };
     79 
     80 
     81 #endif /* BCC_MCCACHE_H */
     82