View of xos/usr/lib/ld-so/object_info.h


XOS | Parent Directory | View | Download

/* Copyright (C) 2008  Emmanuel Varoquaux
 
   This file is part of XOS.
 
   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, see <http://www.gnu.org/licenses/>. */
 
#ifndef OBJECT_INFO_H
#define OBJECT_INFO_H
 
#include "segment_info.h"
#include "elf.h"
 
/* types d'objets */
enum {OI_EXEC, OI_FILE, OI_VDSO, OI_DYNAMIC_LINKER, OI_NOT_FOUND};
 
struct object_info_struct {
  char *name;           /* nom */
  int type;             /* type */
  char *filename;       /* nom de fichier */
  dev_t dev;            /* peripherique */
  ino_t ino;            /* numero d'i-noeud */
 
  /* chargement */
  void *base_address;   /* adresse de base */
  void *load_address;   /* adresse de chargement */
  struct segment_info_struct *segment_table;
  int segment_count;
 
  /* donnees dynamiques */
  struct dynamic_data_struct dynamic_data;
 
  /* dependences */
  union {
    const struct object_reference_struct *object_reference;
    struct object_info_struct *object_info;
  } *dependency_list;   /* dependences */
  int dependency_list_size;
  int reference_count;  /* compteur de references sur cet objet */
 
  /* donnees temporaires */
  struct {
    int reference_count;
  } initfini_ordering;
 
  /* liens */
  struct object_info_struct *previous;
  struct object_info_struct *next;
  struct object_info_struct *initfini_previous;
  struct object_info_struct *initfini_next;
};
 
struct object_info_list_struct {
  struct object_info_struct *first;
  struct object_info_struct *last;
};
 
void object_info_init(struct object_info_struct *object_info, const char *name, int type, ...);
void object_info_destroy(struct object_info_struct *object_info);
int object_info_equals(struct object_info_struct *object_info1, struct object_info_struct *object_info2);
void object_info_print(struct object_info_struct *object_info);
 
void object_info_list_init(struct object_info_list_struct *object_info_list);
void object_info_list_destroy(struct object_info_list_struct *object_info_list);
struct object_info_struct *object_info_list_insert(struct object_info_list_struct *object_info_list, const char *name, int type, ...);
 
#endif