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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? loadsomcofflib.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* loadSomCoffLib.c - HP-PA SOM COFF object module loader *//* Copyright 1984-1994 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------02n,30nov98,dbt  no longer clear seg.flags<xxx> after loadSegmentAllocate()                 call. (SPR #23553).02m,05oct98,pcn  Initialize all the fields in the SEG_INFO structure.02l,16sep98,pcn  Set to SEG_ALIGN the flags field in seg structure                 (SPR #21836).02k,19aug98,cym  Fixed SPR #22030: Target Loader won't load partially linked		 objects.02j,17jul98,pcn  Fixed SPR #21836: alignment mismatch between sections and                 target.02i,01apr97,jmb  propagated an arg_reloc patch from the target server loader.02h,14nov96,mem  rewrote handling of branch stubs in order to fix some		 link problems.  Stubs now have the arg_reloc bits of the		 symbol they represent stored with them, rather than		 the bits of the call they where originally created with.02g,02aug96,jmb  merged in ease patch (mem) for sign_ext.02f,19dec95,mem  fixed fieldValue() function which did not always use the		 roundConst value.		 Modified section placement for GNU.		 Fixed B{1,2,3,4} macros which had multiple uses of		 pThisFixup++ in a single expression, (which is		 undefined behavior).02e,14nov94,kdl  removed conditional for CPU==SIMHPPA.02d,09nov94,ms   made R_UNINIT fixup act just like R_ZEROS fixup.02c,07nov94,kdl  merge cleanup - made conditional for CPU==SIMHPPA.02b,02aug94,ms   cleaned up the code a bit.02a,07jul94,ms   too many bug fixes to count. Major rewrite.                 Added "long branch stub" generation.                 Added "parameter relocation stub" generation                 Added "unwind" segment generation.01g,03may94,ms   fixed the handling of R_PREV_FIXUP requests.01f,02may94,ms   checked in yaos work. Added minor bug fix (bssFlag).01e,18apr94,yao  added fileType paramater to rdSymtab().  changed to add                 DATA_SEGMENT_BASE to symbol of data type for shared                  object files.01d,28mar94,yao  changed to call lst operation routines in relSegments().01c,28feb94,yao  added loadBssSizeGet () for relocatable files.  removed                  macro STORE(), added routine fixBits() to deposit relocation                  bits.  added fieldGetDefault(). added deassemble control                  functions de_assemble_X(). added fixup rounding functions                  X_fixup().01c,02feb94,yao  included dsmLib.h.01b,06dec93,gae  fixed warnings.01a,12sep93,yao  written.*//*DESCRIPTIONThis library provides an object module loading facility for theHP-PA compiler environment.  Relocatable SOM COFF format files may be loaded into memory, relocated, their external references resolved, and their external definitions added to the system symbol table for use by other modules and from the shell.  Modules may be loaded from any I/O streamwhich supports FIOSEEK.EXAMPLE.CS    fdX = open ("/devX/objFile", O_RDONLY);    loadModule (fdX, ALL_SYMBOLS);    close (fdX);.CEThis code fragment would load the HP-PA SOM file "objFile" located ondevice "/devX/" into memory which would be allocated from the systemmemory pool.  All external and static definitions from the file would beadded to the system symbol table.This could also have been accomplished from the shell, by typing:.CS    -> ld (1) </devX/objFile.CEINCLUDE FILE: loadSomCoffLib.hSEE ALSO: loadLib, usrLib, symLib, memLib,.pG "Basic OS"*//*INTERNALThe HP-PA SOM COFF linking loader is complicated as hell.This is due to a combination of the fact that the PA-RISChas a very un-RISC like instruction set, and that thecalling conventions have a strange parameter passing mechanism.The following is an attempt to describesome of the differences between this loader and other VxWorksloaders.Subspace to segment mapping---------------------------The current VxWorks paradigm assumes there are three "segments" -text, data, and bss. The SOM COFF format instead uses the conceptof spaces and subspaces. There are two loadable spaces; text and data.Each of these spaces is divided into many subspaces.For example, each function is put in its own text subspace,and each global variable is put in its own data subspace.To fit the VxWorks paradigm we must map the subspaces into VxWorks segments.The routine subspaceToSegment() performs this function by looping througheach subspace and deciding what segment to put it in. The array pSubInfois initialized with information on each subspace: It's loadType (text,data, or bss), and it's loadAddr (we compute a relative load address foreach subspace - it's final load address won't be know until weallocate memory for the text, data, and bss segments).Uninitailized global (but non-static) variables are treated by thecompiler as "request for storage" (sometimes called "common data" or"weak externals"). All VxWorks loaders simply add these variablesas bss, so we do likewise. The routine commSizeGet() computes the numberof bytes needed for these variables, and this size is added to the bss size.This is more efficient than performing a malloc() for each variable,as is done in other VxWorks loaders.A "stack unwind" segment is also generated for the stack tracer to use.See src/arch/simhppa/trcLib.c for details.Long branch stubs-----------------When code is compiled with optimization, the compiler generatesa PC-relative "BL" (branch and link) instruction for all procedure calls.The problem is that the displacement must fit into 19 bits, so if thecalled procedure is further than 256k bytes away, we have no way tofixup the instruction.The solution is to generate a two instruction "long branch stub",and make that stub the target of the "BL" instruction. It is ourresponsibility to generate this stub, and to make sure that the stubitself is close enough to the caller of "BL".For each text subspace, the procedure subspaceSizeExtra() computesthe amount of space needed by that subspace for possible long branch stubs.Thus when we map the text subspaces to the "text segment", we actually leavea bit of room between each subspace according to the value ofsubspaceSizeExtra() for that subspace.Parameter relocation--------------------The PA-RISC passes the first four words of the parameter list inregisters, and the return value also goes in a register.floating point parameters are passed in floating point registers,and other parameters are passed in general purpose registers.The problem is that the caller and the callee may not agree asto where the parameters are located. For example, printf() expectsits parameters to be in the general purpose registers, whereas a calllike   printf ("%f", myFloat)passes the second parameter in a floating point register.The compiler generates information on how a procedure expectsto be called, and on how it is actually called. It is our job tomake sure they match, and if they don't, to insert a "parameterrelocation stub" between the caller and the callee.Parameter relocation information is encoded in 10 bits - 2 bitseach for the first four arguments words and the return value.Each 2 bit quantity specifies "unused, general register, floatregister, or double persion float register".When a new function is loaded, the 10 bit relocation info generatedby the compiler must be stored away in the VxWorks symbol table forfuture reference, In order to do this I had tocreate a new structure called "MY_SYMBOL", which is just likethe VxWorks "SYMBOL", but has an extra 8 bit field at the end. It turnsout that the size of MY_SYMBOL is the same as the size of SYMBOLbecause of compiler padding, so no harm was done. The functionsexternSymResolve() and externSymAdd() perform VxWorks symboltable manipulation with MY_SYMBOL stuctures.When a function is called, the 10 parameter relocation bitsare encoded in the fixup request associated with the function call.The routines rbits1() and rbits2() get the bits from the fixup request(actually, the 10 bits are encoded in 9 or fewer bits in the fixuprequest, so rbits1() and rbits2() do some work to extract the infoand decode it to 10 bits). We then compare the callers reclocationbits with the callees and if they differ, we may ned to generatea stub (if we hadn't previously generated a stub for that function).Currently, this is only done if the callee expects general registersand the caller passses a double - which takes care of functionslike printf, sprintf, etc. The loader prints an error message ifany other type of parameter reloction is needed. It would be easy to addother parameter relocation stubs at a later time.Fixup requests--------------The linking fixup requests are passed to us as a byte stream.The number of bytes in each fixup request depends on thefixup request, and there are 71 different types of fixup requests!The routine linkSubspaces() performs the linker fixup requests, andit is complicated as hell. The comments in that routine describe it further.just to give you an idea of how complicated our friends at HP have madethings: The linker must keep a queue of the last four multi-bytefixup requests. There is a one byte fixup requests called "repeatprevious fixup" which directs us to repeat one of the previous fixupsfrom the queue, and then move the fixup to the front of the queue!Currently there are many branches in linkSubspaces() that havenot been tested.*/#include "vxWorks.h"#include "stdio.h"#include "som_coff.h"#include "ioLib.h"#include "dsmLib.h"#include "fioLib.h"#include "bootLoadLib.h"#include "loadLib.h"#include "loadSomCoffLib.h"#include "memLib.h"#include "pathLib.h"#include "lstLib.h"#include "string.h"#include "symLib.h"#include "sysSymTbl.h"#include "errnoLib.h"#include "stdlib.h"#include "symbol.h"#include "moduleLib.h"#include "cacheLib.h"#define LOAD_NONE   0#define LOAD_TEXT   1#define LOAD_DATA   2#define LOAD_BSS    3#define SEG_ALIGN  8/* Some PA-RISC opCodes */#define LDIL_CODE       0x08#define ADDIL_CODE      0x0a#define BL_CODE         0x3a#define COMBT_CODE      0x20#define COMBF_CODE      0x22#define ADDB_CODE       0x28#define ADDBF_CODE      0x2a#define BB_CODE         0x31#define LDW_CODE        0x12#define LDH_CODE        0x11#define LDB_CODE        0x10#define STW_CODE        0x1a#define STH_CODE        0x19#define STB_CODE        0x18#define LDWM_CODE       0x13#define STWM_CODE       0x1b#define LDO_CODE        0x0d#define ADDI_CODE       0x2d#define ADDIT_CODE      0x2c#define SUBI_CODE       0x25#define COMICKR_CODE    0x24#define ADDIBT_CODE     0x29#define ADDIBF_CODE     0x2b#define COMIBT_CODE     0x21#define COMIBF_CODE     0x23#define BE_CODE         0x38#define BLE_CODE        0x39/* some handy macros for linkSubspaces() */#define B1 (*(pThisFixup++))#define B2 ((int)(pThisFixup += 2), \    (int) ((pThisFixup[-2] << 8) + pThisFixup[-1]))#define B3 ((int)(pThisFixup += 3), \    (int) ((pThisFixup[-3] << 16) + (pThisFixup[-2] << 8) + pThisFixup[-1]))#define B4 ((int)(pThisFixup += 4), \    (int) ((pThisFixup[-4] << 24) + (pThisFixup[-3] << 16) \           + (pThisFixup[-2] << 8) + pThisFixup[-1]))#define REL_STACK_SIZE  (10000)   /* size of relocation stack pointer */#define POP_EXPR        (*--sp)#define PUSH_EXPR(x)    (*sp ++ = (x))#define CHECK_STACK_OVER  if (sp >= pExpStack + REL_STACK_SIZE) \                              { \                              printErr ("ld error: stack overflow\n");\                              status = ERROR; \                              }#define CHECK_STACK_UNDER if (sp <= pExpStack) \                              { \                              printErr ("ld error: stack underflow\n");\                              status = ERROR; \                              }#define FLAG_RESET(flag)  if (flag) flag = FALSE;/* subspace relocation info */typedef struct    {    char * loadAddr;    int loadType;    } SUB_INFO;/* "previous fixup" queue */typedef struct    {    NODE node;    UCHAR *pFixup;    } PREV_FIXUP;/* stack unwind structures */typedef struct    {    char *startAddr;    char *endAddr;    UINT word3;    UINT word4;    } UNWIND_DESC;typedef struct    {    NODE node;    UNWIND_DESC unwindDesc;    } UNWIND_NODE;/* list of long branch stubs */typedef struct stubListNode    {    NODE node;    int symNum;    int arg_reloc;    } STUB_LIST_NODE;/* list of argument relocation stubs */typedef struct    {    NODE     node;    SYMREC * pSym;    int      arg_reloc;    char *   stubAddr;    } ARG_RELOC_NODE;/* modified symbol table entry */typedef struct                  /* MY_SYMBOL - entry in symbol table */    {    SL_NODE     nameHNode;      /* hash node (must come first) */    char        *name;          /* pointer to symbol name */    char        *value;         /* symbol value */    UINT16      group;          /* symbol group */    SYM_TYPE    type;           /* symbol type */    UCHAR       arg_reloc;      /* relocation bits */    } MY_SYMBOL;/* local variables *//* SPR 22030: changed entry for fixup 62 from 0 to 1 */static int fixupLen [256] =    {    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 00 - 19 */    1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 2, 4, 2, 4, 1, 2, 4, 2, /* 20 - 39 */    4, 1, 2, 3, 5, 8, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, /* 40 - 59 */    5, 5, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 5, 5, 0, 0, /* 60 - 79 */    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 80 - 99 */    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 0, 0, 0, 0, 0, 0, /* 100 - 119 */    2, 4, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 120 - 139 */    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 140 - 159 */    2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 2, 4, 1, 9, /* 160 - 179 */    6, 1, 1, 1, 1, 2, 4, 1, 1, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, /* 180 - 199 */    1, 1, 2, 3, 4, 5, 1,12, 2, 5, 6, 1, 1, 1, 1, 1, 0, 0, 0, 0, /* 200 - 219 */    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 220 - 239 */    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0              /* 240 - 255 */    };static UINT longBranchStub[] =        {        0x20200000,     /* LDIL    0, r1 */        0xe0202002      /* BE,n    0(s4, r1) */        };static stubSize = 8;/* externals */extern low_sign_ext (int x, int len);extern sign_ext     (int x, int len);extern assemble_21  (int x);extern assemble_17  (int x, int y, int z);extern assemble_12  (int x, int y);extern sysMemTop    (void);/* forward static functions */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美大片一区二区三区| 一本一本大道香蕉久在线精品| 亚洲超碰精品一区二区| 国产精品盗摄一区二区三区| 精品少妇一区二区| 在线播放91灌醉迷j高跟美女 | www.欧美.com| 国产99久久久国产精品免费看| 日本伊人午夜精品| 亚洲第四色夜色| 亚洲福利一二三区| 国产精品污www在线观看| 久久色.com| 亚洲精品在线免费播放| 精品99久久久久久| 久久婷婷一区二区三区| 亚洲精品一区在线观看| 精品成人在线观看| 日韩欧美成人一区| 91亚洲午夜精品久久久久久| 综合久久给合久久狠狠狠97色| 国产女主播视频一区二区| 国产精品女同一区二区三区| 亚洲天堂免费看| 一二三区精品福利视频| 日本亚洲天堂网| 国产酒店精品激情| 成人avav在线| 欧美日韩国产影片| 久久午夜免费电影| 亚洲欧美怡红院| 午夜一区二区三区在线观看| 蜜桃视频免费观看一区| 福利一区福利二区| 欧美在线视频你懂得| 欧美刺激脚交jootjob| 国产精品卡一卡二| 亚洲五月六月丁香激情| 激情综合色丁香一区二区| heyzo一本久久综合| 91精品国产综合久久久久久漫画| 精品国产91乱码一区二区三区| 1区2区3区国产精品| 蜜桃视频免费观看一区| 成人不卡免费av| 欧美一区二区三区在线观看视频| 亚洲国产高清在线观看视频| 五月综合激情网| 成人毛片老司机大片| 制服.丝袜.亚洲.另类.中文| 欧美国产精品久久| 视频精品一区二区| 不卡av在线免费观看| 日韩欧美国产综合在线一区二区三区 | 欧美亚洲一区二区三区四区| 精品美女被调教视频大全网站| 国产精品色呦呦| 视频精品一区二区| 91性感美女视频| 久久夜色精品国产噜噜av| 亚洲电影一区二区| 处破女av一区二区| 欧美成人在线直播| 亚洲成人午夜电影| 91原创在线视频| 国产亚洲欧美中文| 日本中文一区二区三区| 日本电影欧美片| 国产日本亚洲高清| 麻豆一区二区99久久久久| 91官网在线免费观看| 中文一区二区在线观看| 久久99久久久欧美国产| 欧美日精品一区视频| 中文字幕综合网| 精品福利二区三区| 五月天视频一区| 日本丶国产丶欧美色综合| 国产精品亲子乱子伦xxxx裸| 精一区二区三区| 欧美一区二区黄色| 五月激情丁香一区二区三区| 91久久精品午夜一区二区| 国产精品成人一区二区三区夜夜夜| 国产在线精品一区二区三区不卡| 777色狠狠一区二区三区| 亚洲永久精品国产| 成人自拍视频在线| 久久人人超碰精品| 激情欧美一区二区| 欧美电影一区二区三区| 丝袜美腿亚洲色图| 欧美高清激情brazzers| 亚洲成人免费看| 欧美剧情电影在线观看完整版免费励志电影 | 国产成人综合在线播放| 精品精品欲导航| 久久精品免费观看| 日韩色在线观看| 另类综合日韩欧美亚洲| 91精品国产综合久久香蕉麻豆| 亚洲一区二区免费视频| 欧美男同性恋视频网站| 亚洲成av人片在线| 欧美放荡的少妇| 免费人成黄页网站在线一区二区| 欧美精品日韩一本| 香蕉成人伊视频在线观看| 欧美揉bbbbb揉bbbbb| 午夜视频在线观看一区| 欧美男人的天堂一二区| 日韩国产欧美在线观看| 在线不卡一区二区| 久热成人在线视频| 久久亚洲影视婷婷| 丁香婷婷综合网| 亚洲欧美在线视频| 91国偷自产一区二区三区成为亚洲经典| 一区二区三区毛片| 欧美日韩一区二区三区高清| 日韩国产欧美在线视频| 精品国产99国产精品| 风间由美一区二区av101| 日韩理论片中文av| 欧美天堂一区二区三区| 日本三级亚洲精品| 欧美大片在线观看| 成人av网在线| 亚洲国产美国国产综合一区二区| 欧美精品自拍偷拍| 黄色成人免费在线| 国产精品久久久久久久蜜臀| 一区二区三区产品免费精品久久75| 欧美日韩在线免费视频| 久久精品国产色蜜蜜麻豆| 国产网红主播福利一区二区| 色综合久久久久久久| 天堂成人国产精品一区| 久久精品欧美一区二区三区不卡 | 国产精品1区2区| 一区二区三区中文免费| 日韩亚洲欧美综合| 国产盗摄一区二区| 一区二区三区欧美| 日韩欧美一级精品久久| eeuss鲁片一区二区三区| 五月天丁香久久| 国产精品麻豆视频| 91精品国产综合久久精品麻豆| 国产在线精品不卡| 亚洲午夜久久久久久久久电影院| 精品美女一区二区| 欧美影院一区二区三区| 久久99精品国产麻豆婷婷| 亚洲欧美日韩一区二区| 欧美本精品男人aⅴ天堂| 91亚洲午夜精品久久久久久| 久久99精品久久久久久久久久久久 | 亚洲色欲色欲www| 日韩一区二区三区电影| 91在线免费播放| 国内欧美视频一区二区 | 粉嫩绯色av一区二区在线观看| 亚洲一区免费在线观看| 国产午夜精品久久久久久久| 欧美日韩久久不卡| 成人av片在线观看| 韩国视频一区二区| 亚洲成人午夜电影| 亚洲同性同志一二三专区| 久久综合国产精品| 欧美三级视频在线观看| 不卡大黄网站免费看| 国产一区二区网址| 日韩高清不卡一区二区三区| 亚洲欧美日韩国产综合在线| 久久中文字幕电影| 91精品久久久久久蜜臀| 欧洲一区二区三区免费视频| 成人免费看视频| 国产麻豆午夜三级精品| 免费成人在线视频观看| 一区二区三区高清不卡| 国产精品福利影院| 久久久久久麻豆| 精品剧情在线观看| 欧美精品国产精品| 欧美日本视频在线| 欧美专区在线观看一区| 91丝袜高跟美女视频| 成人性生交大片免费看在线播放| 激情另类小说区图片区视频区| 欧美aⅴ一区二区三区视频| 图片区日韩欧美亚洲| 欧美日韩精品一二三区| 97精品国产97久久久久久久久久久久 | 亚洲国产综合在线| 亚洲黄色小视频| 亚洲精品第一国产综合野| 亚洲欧洲日韩av|