fixup.c

来自「T-kernel 的extension源代码」· C语言 代码 · 共 46 行

C
46
字号
/* *---------------------------------------------------------------------- *    T-Kernel / Standard Extension * *    Copyright (C) 2006 by Ken Sakamura. All rights reserved. *    T-Kernel / Standard Extension is distributed  *      under the T-License for T-Kernel / Standard Extension. *---------------------------------------------------------------------- * *    Version:   1.00.00 *    Released by T-Engine Forum(http://www.t-engine.org) at 2006/8/11. * *---------------------------------------------------------------------- *//* *	@(#)fixup.c (solib)  * *	Shared object(SO)support library *	Search/link of symbol */#include "../../so.h"/* * Runtime symbol link */#define OFFSET_GP_GOT 0x7ff0UEXPORT UW __so_fixup( UW sym_exidx, UW old_gp){	VP *got = (VP*)(old_gp - OFFSET_GP_GOT);	DLInfo *dlp = (DLInfo *) got[1];	Elf32_Sym 	*sym;	UW		gotsym;	UB		*name;	UW		new_value;	gotsym = dlp->mips_gotsym;	sym = dlp->symtab + sym_exidx;	name = dlp->strtab + sym->st_name;	new_value = __so_resolve(dlp, name, 0, &sym);	got[dlp->mips_local_gotno + (sym_exidx - gotsym)] = ( VP)new_value;	return new_value;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?