L<P0     @@P@.dynamic   .liblist@ @  @.rel.dyn` `  `.dynstr  `.dynsym  @.hash  .textp p pp .init  @.fini    @ .got`d@`d@`.data@@ @.xdatac@c@p@.pdata    P  .rdata@@`c .rconst  p .sbss@e@@e@`.comment@p pp& pp= pp    \ `d@p>p ` p p@     p8ü libc.soosf.1.rconst.pdata.text.init.fini.data.rdata.xdata.lit8.lit4.sdata.sbss.bss__start_mcounteprol__eprol__INIT_00_add_pc_range_table__FINI_00_remove_pc_range_table__INIT_00_add_gp_range__FINI_00_remove_gp_rangeetext__ldr_data__main_routine_edataedata_fbssSVbtidxTTbtidxTAbtidxVVbtidxTSbtidxkey_valuePARSE_endend_ebss__environerrno_fpdata_size_fpdata_ftext__istart_etext_fdata_gpinfo__Argc__Argv_auxv_ldr_present_gp__exc_remove_pc_range_table__exc_remove_gp_rangefopenfprintffcloseexitprintf__exc_add_pc_range_table__exc_add_gp_rangemain    $ *  0@6@=c@D`d@J`d@P`d@W@e@]e@b j r "x   @   ` @@@e@@e@@e@!`e@)he@1pe@9xe@Ae@Ie@Se@Ye@^e@be@hrx   p  ` @0d@@e@He@Pe@Xe@P@ $+DW @>7&'/43 0.1 6 #  <(*)!-% "5$+;,92:8=@(#)$RCSfile: crt0.s,v $ $Revision: 1.1.26.2 $ (DEC) $Date: 1997/04/03 22:25:40 $ۺ R R R R R R }4#'{k}5#'{k}6#'{k}7#'{k}8#'{k}9#'{k}:#'{k};#'{k}<#'{k# >" 'RBABDҽ#RF3aB?pP}x<(\|`@[k 'ѽ#0}'}x=p(]{s1R@[k 'ѽ#=! }D[[k#kG/kG/GG/G/ '`ѽ##^G&"=&1"}y[k '0ѽ#D// &!"Ȁ}FT[k 'ѽ#G}}[[k 'н#&>"Ȁ};T[k 'н#&\"=&1"}y[k 'н#D// &b"Ȁ})T[k 'н#G}`[[k 'н#&"Ȁ}T[k 'hн#=$! =&1"A}\C[k '@н#=$! =&1"A}RC[k 'н#=$! =&1"A}HC[k 'Ͻ#}|[k 'Ͻ#}|[k 'Ͻ#E^ #kG/G '/Ͻ#/8Ѐ}@# ^C[[k '^pϽ##k/// '/PϽ#/}@#^Z[k '^,Ͻ##k// '/Ͻ#/h=HXݤa؀}ߝ'#,"^ >dD^1@~`G"T[k 'ν#/H}`}!!@ C! @/؀}) @)!@T[k  'dν# ?^>^~ #k// '/0ν#/h=H}ߝ'a,#"^dD>^`\[k>^ '^ͽ# #kH}!!@ C! @/} @)!\[k  'ͽ# ?^>^ #k#~^~{'`{#@[k~{'{#@[k^#k#~^~{'{#@[k~{'{#@[k^#k @@@@@@ @e8@$Id: gen_lut.c,v 1.2.4.1 1999/05/04 16:59:46 jkarner Exp $TSVVTATTSV /*----------------------------------------------------------- * * Source File : lut.h * *----------------------------------------------------------- */ #define bool unsigned char #ifndef ERROR #define ERROR -1 #endif #ifndef TRUE #define TRUE (bool) 1 #define FALSE (bool) 0 #endif #define ABBR_SIZE_BIG 4 /* num char in abbr name */ #define VER_SIZE 3 /* num char in version name */ #define ABBR_SIZE_SMALL 2 /* num char in abbr name */ #define ARR_SIZE ABBR_SIZE_BIG #ifdef MAXTABLES #define LUT_NUM_ELEMENTS MAXTABLES #else #define LUT_NUM_ELEMENTS 256 /* max num elements in lut */ #endif #define MAX_VER_ELEMENTS 100 /* max allowed elements in version lut */ #define MAX_VER_NUMBER 999 /* Highest version number allowed... */ typedef struct btree_node_st btree_node_st; /*****************************************************************/ /* the following structure is used as a binary tree node element */ /*****************************************************************/ struct btree_node_st { char name[ARR_SIZE+1]; unsigned char num; int weight; btree_node_st *p_right; /* ptr to right child */ btree_node_st *p_left; /* ptr to left child */ btree_node_st *p_parent; /* ptr to parent */ }; /***********************************/ /* the following structure is used */ /* as a look up table structure */ /***********************************/ typedef char C_TABLE[ARR_SIZE + 1]; typedef enum { ABBR_TBL_TYPE = 777, /* abbreviation table type */ VER_TBL_TYPE /* version number type */ } lut_type; typedef struct { int num_elements; /* num elements currently in lut. */ lut_type type; btree_node_st *p_btree_root; /* ptr to root of btree */ C_TABLE names[LUT_NUM_ELEMENTS]; /* look up table */ }lut_st; /*----------------------------------------------------------- * * Source File : lut.c * * This file contains code for look up table * and binary tree mainipulations used by chgen and gen * developed for spring 1993 project... *----------------------------------------------------------- */ #ifndef HCG_KEY_SIZE /* used to determine context of lut */ /* code use so that includes are not*/ /* multiply defined */ #include #include #include #include "lut.h" #endif char *lut_get_name(); /* ************************************************************ * Function : is_string_null * * Abstract : function to determine if string is NULL... * * Created by : T. Cunningham * * Creation Date : 4/14/93 * * Modified : * ************************************************************ */ bool is_string_null(p_string) char *p_string; { /* local variables */ /**************************************/ if(*p_string == '\0') { return(TRUE); } return(FALSE); } /* end is_string_null */ /* ************************************************************ * Function : lut_display * * Abstract : Function to display look up table... * * Created by : T. Cunningham * * Creation Date : 4/14/93 * * Modified : * ************************************************************ */ int lut_display(p_lut, max_num) lut_st *p_lut; int max_num; { /* local variables */ int idx; char *p_str; /**************************************/ printf("\nLook Up Table Output \n"); printf( "---- -- ----- ------\n\n"); for(idx=0; idxtype = type; p_lut->p_btree_root = NULL; p_lut->num_elements = 0; for(idx=0; idxnames[idx]; *p_ch = '\0'; } return(0); } /* end lut_init */ /* ************************************************************ * Function : lut_insert_element * * Abstract : Function to insert an element into a look up table. * * Created by : T. Cunnigham * * Creation Date : 4/13/92 * * Modified : * ************************************************************ */ int lut_insert_element(lut_st *p_lut, char *name) { /* local variables */ int test, idx, loop, len; /**************************************/ len = strlen(name); switch(p_lut->type) { case ABBR_TBL_TYPE : if( (len != ABBR_SIZE_BIG) && (len != ABBR_SIZE_SMALL)) { printf("%s : Input character string != required abbreviation size...\n", name); return(ERROR); } else { /*************************************/ /* check if abbrv is AAA thru ZZZ */ /*************************************/ for(idx=0; idx < len; idx++) { if((name[idx] > 'Z') || (name[idx] < 'A') ) { printf("%s : Invalid abbreviation passed to insert funct...\n", name); return(ERROR); } } } break; case VER_TBL_TYPE : if(len != VER_SIZE) { printf("Input character string != required version size...\n"); return(ERROR); } else { /****************************************************/ /* check if version is between 0 and MAX_VER_NUMBER */ /****************************************************/ test = atoi(name); if((test < 0) || (test > MAX_VER_NUMBER)) { printf("%s : Invalid version number passed to insert funct. \n", name); return(ERROR); } /*************************************/ /* check to see if there are already */ /* MAX_VER_ELEMENTS in the table... */ /*************************************/ if(p_lut->num_elements >= MAX_VER_ELEMENTS) { printf("Version look up table already full...\n"); printf("Only allowed to have %d indexes...\n", MAX_VER_ELEMENTS); return(ERROR); } } break; default : printf("%s : Unknown table type input to lut_insert_element routine...\n",name); return(ERROR); break; } /**************************************/ /* check btree to see if abbrv exists */ /* if exists do not add to table */ /**************************************/ if((test = btree_does_node_exist(p_lut->p_btree_root, name)) != ERROR) { return(test); } /*************************************/ /* find next available slot in table */ /*************************************/ idx = 0; loop = TRUE; while(idx < LUT_NUM_ELEMENTS) { if(is_string_null(p_lut->names[idx])) { strcpy((char *) p_lut->names[idx], name); p_lut->num_elements++; btree_insert_node(&p_lut->p_btree_root, name, idx); return(idx); } idx++; } /* end while */ printf("No slots available for element insertion...\n"); return(ERROR); } /* end lut_insert_element */ /* ************************************************************ * Function : lut_delete_element * * Abstract : Function to delete an entry in the look up table. * * Created by : T. Cunningham * * Creation Date : 4/13/93 * * Modified : * ************************************************************ */ int lut_delete_element(p_lut, index) lut_st *p_lut; int index; { /* local variables */ char *p_ch; /**************************************/ if(index > LUT_NUM_ELEMENTS) { printf("ERROR - Requested index > look up table size...\n"); return(ERROR); } if(is_string_null(p_lut->names[index])) { printf("ERROR - Requested index to delete does not exist...\n"); return(ERROR); } printf("Deleting lut element # %d\n", index); p_ch = (char *) p_lut->names[index]; *p_ch = '\0'; p_lut->num_elements--; /* decrement number of elements in lut */ printf("Destroying binary tree\n"); btree_destroy(p_lut->p_btree_root, (btree_node_st *)NULL); printf("Recreating binary tree\n"); p_lut->p_btree_root = NULL; btree_create(p_lut); return(0); } /* end lut_delete_element */ /* ************************************************************ * Function : lut_does_node_exist * * Abstract : Function to accept a character string * and return the index of that array in the * look up table. * Return a ERROR if the string does not exist * in the table... * * Created by : T. Cunningham * * Creation Date : 5/6/93 * * Modified : * ********************************************************** int lut_does_node_exist(p_lut, name) lut_st *p_lut; char name[]; { int ret_stat; if(p_lut == NULL) { printf("Null ptr passed as lut address...\n"); return(ERROR); } ret_stat = btree_does_node_exist(p_lut->p_btree_root, name); return(ret_stat); } /* end lut_does_node_exist */ /* ************************************************************ * Function : lut_get_name * * Abstract : Function to accept an index number and return * the abbreviation name corresponding to the * index number... * * returns a character pointer. * * Created by : T. Cunningham * * Creation Date : 4/13/92 * * Modified : * ************************************************************ */ char *lut_get_name(p_lut, index) lut_st *p_lut; int index; { /* local variables */ /**************************************/ if(index <= LUT_NUM_ELEMENTS) { if(is_string_null(p_lut->names[index])) { return(NULL); } else { return((char *)p_lut->names[index]); } } else { printf("Invalid index input to lut_get_name...\n"); return(NULL); } } /* end lut_get_name */ /* ************************************************************ * Function : abbr_lut_create * * Abstract : Function to create a lut from an array of * strings... * Returns ERROR if failure occurred or * returns (0) if successful.... * * Created by : T. Cunningham * * Creation Date : 5/2/93 * * Modified : * ************************************************************ */ int abbr_lut_create(p_lut, p_abbr, num_strings) lut_st *p_lut; char *p_abbr[]; int num_strings; { int ret_stat, idx; lut_init(p_lut, ABBR_TBL_TYPE); /* build the lut table and btree */ for(idx=0; idxname, p_node->num, p_node->weight); btree_print_node(p_node->p_left); btree_print_node(p_node->p_right); return(0); } /* end btree_print_node */ /* *********************************************************** * Function : btree_display_nodes * * Abstract : Function to traverse the btree and print out * each node in a depth first fashion. * * Created by : T. Cunningham * * Creation Date : 4/14/93 * * Modified : * ************************************************************ */ int btree_display_nodes(p_root) btree_node_st *p_root; { /* local variables */ /**************************************/ printf("\n\nAbbreviation Index Weight - Binary Tree Output\n"); printf( "------------ ----- ------\n\n"); btree_print_node(p_root); return(0); } /* end btree_display_nodes */ /* *********************************************************** * Function : btree_does_node_exist * * Abstract : Function to determine if abbreviation exists * in the lut binary tree. * * returns : index number of abbreviation * or ERROR if it does not exist. * * Created by : T. Cunningham * * Creation Date : 4/14/93 * * Modified : * ************************************************************ */ int btree_does_node_exist(p_node, name) btree_node_st *p_node; char name[]; { /* local variables */ int test, ret_stat; /**************************************/ if(p_node == NULL) { return(ERROR); } if( (test = strcmp(p_node->name, name)) == 0) { return(p_node->num); } ret_stat = btree_does_node_exist(p_node->p_left, name); if(ret_stat >= 0) { return(ret_stat); } ret_stat = btree_does_node_exist(p_node->p_right, name); if(ret_stat >= 0) { return(ret_stat); } else { return(ERROR); } } /* end btree_does_node_exist */ /* ************************************************************ * Function : btree_insert_node * * Abstract : Function to insert a node into an existing btree, * or if btree does not exist create a new one and * insert the node as the root. * * Created by : T. Cunningham * * Creation Date : 4/14/93 * * Modified : * ************************************************************ */ int btree_insert_node(p_new, abbr, index) btree_node_st **p_new; char abbr[]; int index; { /* local variables */ int test; /**************************************/ btree_node_st *p_temp, *p_node; /**************************************************/ /* first check if btree exists - if not create it */ /**************************************************/ if(*p_new == NULL) { p_node = (btree_node_st *) calloc(sizeof(btree_node_st), 1); strcpy(p_node->name, abbr); p_node->num = index; p_node->weight = 2; p_node->p_right = NULL; p_node->p_left = NULL; *p_new = p_node; return(0); } /* insert into existing binary tree */ p_temp = *p_new; /*******************************************/ /* check out if abbreviation already exists */ /* if so return the index of the abbrev */ /********************************************/ test = strcmp(p_temp->name, abbr); if(test == 0) { /* node exists */ printf("Node : %s Already exists...\n", p_temp->name); return(0); } else if (test < 0) /* insert into right child */ { btree_insert_node(&p_temp->p_right, abbr, index); } else if (test > 0) /* insert into left child */ { btree_insert_node(&p_temp->p_left, abbr, index); } p_temp->weight = btree_wt(p_temp->p_left) + btree_wt(p_temp->p_right); return(0); } /* end btree_insert_node */ /* ************************************************************ * Function : btree_create * * Abstract : Function to create the btree from the look up table. * * Created by : T. Cunningham * * Creation Date : 4/14/93 * * Modified : * ************************************************************ */ int btree_create(p_lut) lut_st *p_lut; { /* local variables */ int idx; char *p_abbr; /* ptr to abbreviation */ /**************************************/ /* traverse the lut */ for(idx=0; idx < LUT_NUM_ELEMENTS; idx++) { /* get next element in the lut */ p_abbr = lut_get_name(p_lut, idx); if(p_abbr != NULL) { /* add to btree */ btree_insert_node(&p_lut->p_btree_root, p_abbr, idx); } } /* end for */ return(0); } /* end btree_create */ /* ************************************************************ * Function : btree_destroy * * Abstract : Function to delete the binary tree and * free up the memory allocated to the tree. * * Created by : T. Cunningham * * Creation Date : 4/15/93 * * Modified : * *********************************************************** */ int btree_destroy(p_node, p_back) btree_node_st *p_node; btree_node_st *p_back; { /* local variables */ char child_dir; /**************************************/ if(p_back == NULL) { /* this is a root node */ child_dir = 'N'; } else if(p_back->p_right == p_node) { /* this is a right child of the parent */ child_dir = 'R'; } else if(p_back->p_left == p_node) { /* this is a left child of the parent */ child_dir = 'L'; } /* if leaf node */ if( (p_node->p_left == NULL) && (p_node->p_right == NULL)) { /***********************/ /* this is a leaf node */ /***********************/ /* set parent ptr to this node to NULL */ if(child_dir == 'R') { p_back->p_right = NULL; } else if(child_dir == 'L') { p_back->p_left = NULL; } else { /* node is root */ } free(p_node); return(0); } /* not a leaf node */ if(p_node->p_left == NULL) { /*****************************/ /* node has right child only */ /*****************************/ btree_destroy(p_node->p_right, p_node); } else /* left node exists */ { if(p_node->p_right == NULL) { /****************************/ /* node has left child only */ /****************************/ btree_destroy(p_node->p_left, p_node); } else { /***********************************/ /* node has two children */ /***********************************/ btree_destroy(p_node->p_left, p_node); btree_destroy(p_node->p_right, p_node); } } /*******************************************/ /* If you get here you are now a leaf node */ /* All of your subtrees have been deleted */ /*******************************************/ /* set parent ptr to this node to NULL */ if(child_dir == 'R') { p_back->p_right = NULL; } else if(child_dir == 'L') { p_back->p_left = NULL; } else { /* node is root */ } free(p_node); return(0); } /* end btree_destroy */ /* **************************************************************** * Function : btree_wt * * Abstract : Function to give a weight to each node in the tree * The weight is based on number of nodes below it. * This is used for balencing btrees - however the * the balence code was not included in this gen * version due to a lack of time to debug it... * * Created by : D. Pinkney * * Creation Date :?????? * * Modified : * ********************************************************** */ int btree_wt(t) /* returns weight of tree or 1 otherwise */ btree_node_st *t; { if (t == (btree_node_st *) NULL) { return(1); } else { return(t->weight); } } /* end btree_wt */ lut.cwError opening lut.c file... lut.c opened successfully... lut.hError opening lut.h file... lut.h opened successfully... %s   ۺ pP@ * n   p  ` @0d@@e@He@Pe@Xe@P@@}  ` !  P `d  h   p @P= 0p  Y     PT VZ@  \q   sK  F  H@8@@@%H@-P@7Hhgen_lut.cmainhcg_tbl_abbrp_lut_hp_lut_cp_btree_crcsid.3.text.init.fini.data.sdata.rdata.sbss.bss.lit8.lit4.rconst__environ__Argc__Argv_auxv_ldr_presenterrno__ldr_data__main_routinemain__start__istartexit_mcount__eproleprol_fpdata_ftext_etextfopenprintffprintffcloseSVbtidxTTbtidxTAbtidxVVbtidxTSbtidxkey_valuePARSE__exc_add_pc_range_table__exc_add_gp_range__exc_remove_pc_range_table__exc_remove_gp_range__INIT_00_add_pc_range_table__INIT_00_add_gp_range__FINI_00_remove_pc_range_table__FINI_00_remove_gp_range_fpdata_size_gpinfo_gp_fdata.xdata.pdata_edata_ebss_endetextedataend_fbss   ? p    =  D D    @@c@`d@1D`d@7D`d@D@e@&e@, F F F F F F@ F  F` 7E@v@@e@%@e@=@e@G`e@he@pe@xe@ e@e@e@%e@2e@Ce@, FEApA E  Ep E ` E@0d@@e@OHe@VPe@]Xe@cP@ EWs+D0 HH.xdata.dynsym.got.data H Pjh"("@H""p !p "8d@D@ !p "@d@D@0e@