fixup.c
来自「T-kernel 的extension源代码」· C语言 代码 · 共 53 行
C
53 行
/* *---------------------------------------------------------------------- * 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"/* * Run time symbol link */EXPORT UW __so_fixup( DLInfo *dlp, UW relofs){ Elf32_Rela *rela; Elf32_Sym *sym; UB *name; UW val; UW *uwp; rela = (VP)((UW)dlp->jreltab + relofs); sym = &dlp->symtab[ELF32_R_SYM(rela->r_info)]; /* Symbol search(link) */ name = dlp->strtab + sym->st_name; val = __so_resolve(dlp, name, R_SH_JMP_SLOT, &sym); if ( sym == NULL ) { SYSLOG((LOG_ERR, "solib: %s is not defined", name)); } /* Store the symbol value */ uwp = (UW*)((UB *)(rela->r_offset) + dlp->ldofs); *uwp = val; return val;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?