亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? symbol.c.svn-base

?? 模擬多核狀態下龍芯處理器的功能
?? SVN-BASE
?? 第 1 頁 / 共 2 頁
字號:
/*
 * symbol.c - program symbol and line data routines
 *
 * This file is a part of the SimpleScalar tool suite written by
 * Todd M. Austin as a part of the Multiscalar Research Project.
 *  
 * The tool suite is currently maintained by Doug Burger and Todd M. Austin.
 * 
 * Copyright (C) 1994, 1995, 1996, 1997, 1998 by Todd M. Austin
 *
 * This source file is distributed "as is" in the hope that it will be
 * useful.  The tool set comes with no warranty, and no author or
 * distributor accepts any responsibility for the consequences of its
 * use. 
 * 
 * Everyone is granted permission to copy, modify and redistribute
 * this tool set under the following conditions:
 * 
 *    This source code is distributed for non-commercial use only. 
 *    Please contact the maintainer for restrictions applying to 
 *    commercial use.
 *
 *    Permission is granted to anyone to make or distribute copies
 *    of this source code, either as received or modified, in any
 *    medium, provided that all copyright notices, permission and
 *    nonwarranty notices are preserved, and that the distributor
 *    grants the recipient permission for further redistribution as
 *    permitted by this document.
 *
 *    Permission is granted to distribute this file in compiled
 *    or executable form under the same conditions that apply for
 *    source code, provided that either:
 *
 *    A. it is accompanied by the corresponding machine-readable
 *       source code,
 *    B. it is accompanied by a written offer, with no time limit,
 *       to give anyone a machine-readable copy of the corresponding
 *       source code in return for reimbursement of the cost of
 *       distribution.  This written offer must permit verbatim
 *       duplication by anyone, or
 *    C. it is distributed by someone who received only the
 *       executable form, and is accompanied by a copy of the
 *       written offer of source code that they received concurrently.
 *
 * In other words, you are welcome to use, share and improve this
 * source file.  You are forbidden to forbid anyone else to use, share
 * and improve what you give them.
 *
 * INTERNET: dburger@cs.wisc.edu
 * US Mail:  1210 W. Dayton Street, Madison, WI 53706
 *
 * $Id: symbol.c,v 1.1.1.1 2006/09/08 09:21:43 cvsuser Exp $
 *
 * $Log: symbol.c,v $
 * Revision 1.1.1.1  2006/09/08 09:21:43  cvsuser
 * Godson-3 simulator
 *
 * Revision 1.1  2005/01/27 03:18:24  fxzhang
 * create godson2 cvs
 *
 * Revision 1.1.1.1  2004/12/05 14:36:32  fxzhang
 * initial import of ss-mips
 *
 * Revision 1.2  2004/08/03 09:50:06  fxzhang
 * merge back changes on AMD64
 *
 * Revision 1.2  2004/07/30 02:48:22  fxzhang
 * fix stat64/lstat64
 *
 * Revision 1.2  2004/07/15 07:31:03  fxzhang
 * fix syscall on x86-64
 *
 * Revision 1.1.1.1  2004/07/15 01:26:34  fxzhang
 * import
 *
 * Revision 1.1.1.1  2004/07/10 16:46:50  fxzhang
 * initial
 *
 * Revision 1.1.1.1  2000/05/26 15:21:54  taustin
 * SimpleScalar Tool Set
 *
 *
 * Revision 1.3  1998/08/27 17:06:45  taustin
 * implemented host interface description in host.h
 * added target interface support
 * added support for MS VC++ and CYGWIN32 hosts
 *
 * Revision 1.2  1997/04/16  22:11:50  taustin
 * added standalone loader support
 *
 * Revision 1.1  1997/03/11  01:34:45  taustin
 * Initial revision
 *
 *
 */

#include <stdio.h>
#include <stdlib.h>

#include "host.h"
#include "misc.h"
#ifdef BFD_LOADER
#include <bfd.h>
#else /* !BFD_LOADER */
#include "target-mips/ecoff.h"
#endif /* BFD_LOADER */
#include "loader.h"
#include "symbol.h"

/* #define PRINT_SYMS */

/* symbol database in no particular order */
struct sym_sym_t *sym_db = NULL;

/* all symbol sorted by address */
int sym_nsyms = 0;
struct sym_sym_t **sym_syms = NULL;

/* all symbols sorted by name */
struct sym_sym_t **sym_syms_by_name = NULL;

/* text symbols sorted by address */
int sym_ntextsyms = 0;
struct sym_sym_t **sym_textsyms = NULL;

/* text symbols sorted by name */
struct sym_sym_t **sym_textsyms_by_name = NULL;

/* data symbols sorted by address */
int sym_ndatasyms = 0;
struct sym_sym_t **sym_datasyms = NULL;

/* data symbols sorted by name */
struct sym_sym_t **sym_datasyms_by_name = NULL;

/* symbols loaded? */
static int syms_loaded = FALSE;

#ifdef PRINT_SYMS
/* convert BFD symbols flags to a printable string */
static char *			/* symbol flags string */
flags2str(unsigned int flags)	/* bfd symbol flags */
{
  static char buf[256];
  char *p;

  if (!flags)
    return "";

  p = buf;
  *p = '\0';

  if (flags & BSF_LOCAL)
    {
      *p++ = 'L';
      *p++ = '|';
    }
  if (flags & BSF_GLOBAL)
    {
      *p++ = 'G';
      *p++ = '|';
    }
  if (flags & BSF_DEBUGGING)
    {
      *p++ = 'D';
      *p++ = '|';
    }
  if (flags & BSF_FUNCTION)
    {
      *p++ = 'F';
      *p++ = '|';
    }
  if (flags & BSF_KEEP)
    {
      *p++ = 'K';
      *p++ = '|';
    }
  if (flags & BSF_KEEP_G)
    {
      *p++ = 'k'; *p++ = '|';
    }
  if (flags & BSF_WEAK)
    {
      *p++ = 'W';
      *p++ = '|';
    }
  if (flags & BSF_SECTION_SYM)
    {
      *p++ = 'S'; *p++ = '|';
    }
  if (flags & BSF_OLD_COMMON)
    {
      *p++ = 'O';
      *p++ = '|';
    }
  if (flags & BSF_NOT_AT_END)
    {
      *p++ = 'N';
      *p++ = '|';
    }
  if (flags & BSF_CONSTRUCTOR)
    {
      *p++ = 'C';
      *p++ = '|';
    }
  if (flags & BSF_WARNING)
    {
      *p++ = 'w';
      *p++ = '|';
    }
  if (flags & BSF_INDIRECT)
    {
      *p++ = 'I';
      *p++ = '|';
    }
  if (flags & BSF_FILE)
    {
      *p++ = 'f';
      *p++ = '|';
    }

  if (p == buf)
    panic("no flags detected");

  *--p = '\0';
  return buf;
}
#endif /* PRINT_SYMS */

/* qsort helper function */
static int
acmp(struct sym_sym_t **sym1, struct sym_sym_t **sym2)
{
  return (int)((*sym1)->addr - (*sym2)->addr);
}

/* qsort helper function */
static int
ncmp(struct sym_sym_t **sym1, struct sym_sym_t **sym2)
{
  return strcmp((*sym1)->name, (*sym2)->name);
}

#define RELEVANT_SCOPE(SYM)						\
(/* global symbol */							\
 ((SYM)->flags & BSF_GLOBAL)						\
 || (/* local symbol */							\
     (((SYM)->flags & (BSF_LOCAL|BSF_DEBUGGING)) == BSF_LOCAL)		\
     && (SYM)->name[0] != '$')						\
 || (/* compiler local */						\
     load_locals							\
     && ((/* basic block idents */					\
	  ((SYM)->flags&(BSF_LOCAL|BSF_DEBUGGING))==(BSF_LOCAL|BSF_DEBUGGING)\
	  && (SYM)->name[0] == '$')					\
	 || (/* local constant idents */				\
	     ((SYM)->flags & (BSF_LOCAL|BSF_DEBUGGING)) == (BSF_LOCAL)	\
	     && (SYM)->name[0] == '$'))))
     

/* load symbols out of FNAME */
void
sym_loadsyms(char *fname,	/* file name containing symbols */
	     int load_locals)	/* load local symbols */
{
#if 0
  int i, debug_cnt;
#ifdef BFD_LOADER
  bfd *abfd;
  asymbol **syms;
  int storage, i, nsyms, debug_cnt;
#else /* !BFD_LOADER */
  int len;
  FILE *fobj;
  struct ecoff_filehdr fhdr;
  struct ecoff_aouthdr ahdr;
  struct ecoff_symhdr_t symhdr;
  char *strtab = NULL;
  struct ecoff_EXTR *extr;
#endif /* BFD_LOADER */

  if (syms_loaded)
    {
      /* symbols are already loaded */
      /* FIXME: can't handle symbols from multiple files */
      return;
    }

#ifdef BFD_LOADER

  /* load the program into memory, try both endians */
  if (!(abfd = bfd_openr(fname, "ss-coff-big")))
    if (!(abfd = bfd_openr(fname, "ss-coff-little")))
      fatal("cannot open executable `%s'", fname);

  /* this call is mainly for its side effect of reading in the sections.
     we follow the traditional behavior of `strings' in that we don't
     complain if we don't recognize a file to be an object file.  */
  if (!bfd_check_format(abfd, bfd_object))
    {
      bfd_close(abfd);
      fatal("cannot open executable `%s'", fname);
    }

  /* sanity check, endian should be the same as loader.c encountered */
  if (abfd->xvec->byteorder_big_p != (unsigned)ld_target_big_endian)
    panic("binary endian changed");

  if ((bfd_get_file_flags(abfd) & (HAS_SYMS|HAS_LOCALS)))
    {
      /* file has locals, read them in */
      storage = bfd_get_symtab_upper_bound(abfd);
      if (storage <= 0)
	fatal("HAS_SYMS is set, but `%s' still lacks symbols", fname);

      syms = (asymbol **)calloc(storage, 1);
      if (!syms)
	fatal("out of virtual memory");

      nsyms = bfd_canonicalize_symtab (abfd, syms);
      if (nsyms <= 0)
	fatal("HAS_SYMS is set, but `%s' still lacks symbols", fname);

      /*
       * convert symbols to local format
       */

      /* first count symbols */
      sym_ndatasyms = 0; sym_ntextsyms = 0;
      for (i=0; i < nsyms; i++)
	{
	  asymbol *sym = syms[i];

	  /* decode symbol type */
	  if (/* from the data section */
	      (!strcmp(sym->section->name, ".rdata")
	       || !strcmp(sym->section->name, ".data")
	       || !strcmp(sym->section->name, ".sdata")
	       || !strcmp(sym->section->name, ".bss")
	       || !strcmp(sym->section->name, ".sbss"))
	      /* from a scope we are interested in */
	      && RELEVANT_SCOPE(sym))
	    {
	      /* data segment symbol */
	      sym_ndatasyms++;
#ifdef PRINT_SYMS
	      fprintf(stderr,
		      "+sym: %s  sect: %s  flags: %s  value: 0x%08lx\n",
		      sym->name, sym->section->name, flags2str(sym->flags),
		      sym->value + sym->section->vma);
#endif /* PRINT_SYMS */
	    }
	  else if (/* from the text section */
		   !strcmp(sym->section->name, ".text")
		   /* from a scope we are interested in */
		   && RELEVANT_SCOPE(sym))
	    {
	      /* text segment symbol */
	      sym_ntextsyms++;
#ifdef PRINT_SYMS
	      fprintf(stderr,
		      "+sym: %s  sect: %s  flags: %s  value: 0x%08lx\n",
		      sym->name, sym->section->name, flags2str(sym->flags),
		      sym->value + sym->section->vma);
#endif /* PRINT_SYMS */
	    }
	  else
	    {
	      /* non-segment sections */
#ifdef PRINT_SYMS
	      fprintf(stderr,
		      "-sym: %s  sect: %s  flags: %s  value: 0x%08lx\n",
		      sym->name, sym->section->name, flags2str(sym->flags),
		      sym->value + sym->section->vma);
#endif /* PRINT_SYMS */
	    }
	}
      sym_nsyms = sym_ntextsyms + sym_ndatasyms;
      if (sym_nsyms <= 0)
	fatal("`%s' has no text or data symbols", fname);

      /* allocate symbol space */
      sym_db = (struct sym_sym_t *)calloc(sym_nsyms, sizeof(struct sym_sym_t));
      if (!sym_db)
	fatal("out of virtual memory");

      /* convert symbols to internal format */
      for (debug_cnt=0, i=0; i < nsyms; i++)
	{
	  asymbol *sym = syms[i];

	  /* decode symbol type */
	  if (/* from the data section */
	      (!strcmp(sym->section->name, ".rdata")
	       || !strcmp(sym->section->name, ".data")
	       || !strcmp(sym->section->name, ".sdata")
	       || !strcmp(sym->section->name, ".bss")
	       || !strcmp(sym->section->name, ".sbss"))
	      /* from a scope we are interested in */
	      && RELEVANT_SCOPE(sym))
	    {
	      /* data segment symbol, insert into symbol database */
	      sym_db[debug_cnt].name = mystrdup((char *)sym->name);
	      sym_db[debug_cnt].seg = ss_data;
	      sym_db[debug_cnt].initialized =
		(!strcmp(sym->section->name, ".rdata")
		 || !strcmp(sym->section->name, ".data")
		 || !strcmp(sym->section->name, ".sdata"));
	      sym_db[debug_cnt].pub = (sym->flags & BSF_GLOBAL);
	      sym_db[debug_cnt].local = (sym->name[0] == '$');
	      sym_db[debug_cnt].addr = sym->value + sym->section->vma;

	      debug_cnt++;
	    }
	  else if (/* from the text section */
		   !strcmp(sym->section->name, ".text")
		   /* from a scope we are interested in */
		   && RELEVANT_SCOPE(sym))
	    {
	      /* text segment symbol, insert into symbol database */
	      sym_db[debug_cnt].name = mystrdup((char *)sym->name);
	      sym_db[debug_cnt].seg = ss_text;
	      sym_db[debug_cnt].initialized = /* seems reasonable */TRUE;
	      sym_db[debug_cnt].pub = (sym->flags & BSF_GLOBAL);
	      sym_db[debug_cnt].local = (sym->name[0] == '$');
	      sym_db[debug_cnt].addr = sym->value + sym->section->vma;

	      debug_cnt++;
	    }
	  else
	    {
	      /* non-segment sections */
	    }
	}
      /* sanity check */
      if (debug_cnt != sym_nsyms)
	panic("could not locate all counted symbols");

      /* release bfd symbol storage */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av网站在线| 韩国成人福利片在线播放| 日日夜夜精品免费视频| 麻豆精品视频在线| 成人丝袜高跟foot| 欧美精品在线观看一区二区| 色综合色狠狠天天综合色| 欧美裸体一区二区三区| 国产人成一区二区三区影院| 亚洲最新在线观看| 豆国产96在线|亚洲| 色婷婷av一区二区三区之一色屋| 欧美不卡123| 精品国产91九色蝌蚪| 丰满白嫩尤物一区二区| 欧美无人高清视频在线观看| 久久看人人爽人人| 婷婷亚洲久悠悠色悠在线播放| 视频一区二区三区中文字幕| 成人开心网精品视频| 欧美一个色资源| 亚洲自拍欧美精品| 韩国精品在线观看| 欧美日韩国产免费| 一区二区三区在线视频观看| 九九精品一区二区| 在线播放欧美女士性生活| 国产精品全国免费观看高清| 另类小说图片综合网| 91黄色小视频| 中文字幕在线不卡视频| 久久电影网站中文字幕| 欧美疯狂做受xxxx富婆| 亚洲黄色av一区| 91尤物视频在线观看| 欧美一级片在线观看| 亚洲精品伦理在线| 91丨九色丨蝌蚪富婆spa| 欧美精品一区二区三区视频| 欧美男人的天堂一二区| 亚洲乱码国产乱码精品精98午夜 | 精品久久国产97色综合| 中文字幕第一区二区| 国产精品 欧美精品| 精品美女一区二区| 久久不见久久见中文字幕免费| 91黄色激情网站| 亚洲柠檬福利资源导航| 日本精品视频一区二区三区| 国产精品乱码一区二三区小蝌蚪| 国产精品系列在线播放| 久久理论电影网| 成人激情开心网| 自拍偷拍国产精品| 91在线视频观看| 亚洲美女视频在线| 欧洲精品一区二区| 欧美人妇做爰xxxⅹ性高电影| 国产精品久久久久久久裸模 | 精品一区二区三区视频在线观看| 欧美精品乱码久久久久久| 天天综合天天做天天综合| 欧美一级在线观看| 国内外精品视频| 国产精品无人区| 91成人在线观看喷潮| 亚洲福中文字幕伊人影院| 3d动漫精品啪啪| 国产在线观看免费一区| 日韩欧美综合在线| 国产成都精品91一区二区三 | 在线播放一区二区三区| 日韩和欧美一区二区三区| 日韩一区二区三| 一区二区三区免费网站| 精品视频一区三区九区| 91精品福利在线一区二区三区 | 欧美国产精品一区二区三区| 色网站国产精品| 国产伦精品一区二区三区视频青涩| 最新热久久免费视频| 日韩精品影音先锋| 色综合久久综合网欧美综合网| 老司机精品视频线观看86| 亚洲摸摸操操av| 久久久久国产精品麻豆| 欧美疯狂做受xxxx富婆| 色视频成人在线观看免| 国产精品18久久久久久久久久久久 | 精品国产乱码91久久久久久网站| 91美女蜜桃在线| 国产不卡视频一区二区三区| 日本aⅴ免费视频一区二区三区| 亚洲男人的天堂一区二区| 久久久亚洲精品石原莉奈| 91精选在线观看| 欧美日韩中文字幕一区| av电影天堂一区二区在线| 激情另类小说区图片区视频区| 亚洲一区二区三区视频在线| 国产精品不卡视频| 国产蜜臀av在线一区二区三区| 欧美成人一区二区三区片免费 | 国产精品免费视频网站| 久久久噜噜噜久噜久久综合| 欧美成人bangbros| 日韩你懂的在线观看| 久久精品人人爽人人爽| 久久精品久久综合| 天天综合网天天综合色| 天天色图综合网| 日韩专区欧美专区| 午夜视频在线观看一区二区三区| 亚洲在线免费播放| 亚洲午夜视频在线观看| 一区av在线播放| 亚洲chinese男男1069| 亚洲国产精品久久人人爱 | 欧美在线观看禁18| 91成人网在线| 91麻豆精品国产自产在线| 欧美日韩不卡在线| 欧美一区二区三区四区高清| 91精品国产一区二区| 日韩精品一区二区三区在线| 精品欧美久久久| 国产亚洲精品超碰| 成人免费视频在线观看| 亚洲最快最全在线视频| 国产suv精品一区二区三区| 日本一区二区免费在线观看视频 | 精品久久国产字幕高潮| 久久久99精品久久| 亚洲欧洲性图库| 午夜精品aaa| 国产乱一区二区| 99这里都是精品| 欧美午夜不卡视频| 欧美mv和日韩mv国产网站| 国产亚洲婷婷免费| 一区二区三区四区视频精品免费| 亚洲第一会所有码转帖| 裸体健美xxxx欧美裸体表演| 国产宾馆实践打屁股91| 色天使色偷偷av一区二区| 91精品久久久久久久99蜜桃| 欧美成人精品3d动漫h| 国产精品久久久久桃色tv| 亚洲国产日韩在线一区模特| 极品美女销魂一区二区三区免费| 99久久精品免费看国产| 天天综合日日夜夜精品| 国产精品一卡二卡| 欧美无砖专区一中文字| 国产网站一区二区三区| 洋洋av久久久久久久一区| 免费的成人av| 色综合咪咪久久| 久久人人97超碰com| 一区二区不卡在线播放| 国产乱人伦偷精品视频免下载| 91福利在线导航| 日本一区二区视频在线| 污片在线观看一区二区| 成人国产电影网| 欧美一区二区网站| 日韩理论片一区二区| 国产乱码精品1区2区3区| 欧美乱妇15p| 亚洲欧洲综合另类| 国产乱国产乱300精品| 欧美一区二区精品| 亚洲无线码一区二区三区| 成人国产电影网| 日本一区二区三区国色天香| 久久97超碰色| 538prom精品视频线放| 亚洲国产一区视频| 日本aⅴ亚洲精品中文乱码| 在线看一区二区| 综合av第一页| 成人国产精品视频| 日本一区二区三区四区| 激情综合网最新| 日韩欧美精品三级| 丝袜美腿亚洲综合| 欧美日韩免费一区二区三区| 亚洲男人的天堂在线观看| 成人黄动漫网站免费app| 精品奇米国产一区二区三区| 婷婷开心激情综合| 色嗨嗨av一区二区三区| 成人免费一区二区三区视频| 国产乱人伦偷精品视频免下载| 欧美日韩国产三级| 亚洲第一福利一区| 99视频精品在线| 久久久不卡网国产精品二区| 国产又黄又大久久| 欧美一级搡bbbb搡bbbb|