home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat5 / libelfutil.z / libelfutil
Encoding:
Text File  |  2002-10-03  |  5.0 KB  |  113 lines

  1. LIBELFUTIL(5)                                          Last changed: 1-7-99
  2.  
  3.  
  4. NNAAMMEE
  5.      lliibbeellffuuttiill - Library for xxllaattee sections and lleebb112288 numbers
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<lliibbXXllaattee..hh>>
  9.      ##iinncclluuddee <<ccmmppllrrss//lleebb112288..hh>>
  10.  
  11. IIMMPPLLEEMMEENNTTAATTIIOONN
  12.      IRIX systems
  13.  
  14. DDEESSCCRRIIPPTTIIOONN
  15.      This library is a collection of functions that can be divided into
  16.      three groups:  the xxllaattee functions used to create and access the
  17.      ..MMIIPPSS..xxllaattee and related sections, the lleebb112288 functions, and a
  18.      disassembly function (undocumented).
  19.  
  20.      The following is a description of the xxllaattee routines.  The xxllaattee
  21.      routines are used to create and access address translation data as
  22.      described in xxllaattee(4).
  23.  
  24.      Calls used to create address translation data are called "producer"
  25.      calls.  Calls used to create applications that read the address
  26.      translation data are called "consumer" calls.
  27.  
  28.      Use --lleellffuuttiill --lleellff on the link command line to link in lliibbeellffuuttiill.
  29.  
  30.      All call interfaces described on this man page pass and return values
  31.      sufficient for both 32 and 64 bit executables and DSOs.  On disk, the
  32.      data format is slightly different for 32 and 64 bit executables and
  33.      DSOs, but there is only one library interface.
  34.  
  35. xxllaattee CCoonnssuummeerr IInntteerrffaaccee
  36.      The xxllaattee consumer interface is used by debuggers and other tools that
  37.      want to know, for a transformed executable or DSO, what given
  38.      execution time addresses were in the original program text (executable
  39.      instructions).  Or that want to know, for a given address taken from
  40.      the debugging information, what address this represents in the
  41.      transformed text (the debugging information is not changed by
  42.      transformations, so the debugging information give addresses which are
  43.      not identical to the executing transformed text).
  44.  
  45.      The following code ignores return values to keep the examples small.
  46.  
  47.      The following example gets the untransformed address for a range of
  48.      transformed addresses.
  49.  
  50.           int result;
  51.           xlate_table_con contable = 0;
  52.           xlate_block range;
  53.           result = xlate_init_fd(myopenfd,
  54.             XLATE_OPEN_STD_TABLE,&contable);
  55.           for(pc = startpc; pc <endpc; pc += 4)
  56.           {
  57.                Elf64_Addr oldaddress;
  58.                xlate_Block range;
  59.                   result = xlate_address(contable,
  60.                     XLATE_ADDRESS_INPUT_NEW_ADDRESS,
  61.                     pc,&oldaddress,&range);
  62.                ...do something useful here...
  63.           }
  64.           result = xlate_finish(contable);
  65.  
  66. xxllaattee PPrroodduucceerr IInntteerrffaaccee
  67.      The xxllaattee producer interface is used by transforming applications
  68.      (like ccoorrdd(1) and ppiixxiiee(1)) to register the transformations so other
  69.      tools [like ddbbxx(1)] can, at execution time, use the "Consumer
  70.      Interface" to help the tool user understand the transformed text.
  71.  
  72.      The following example records a trivial transformation and gets back
  73.      the transformed bytes.
  74.  
  75.           int result;
  76.           xlate_table_con contable = 0;
  77.           xlate_table_pro protable = 0;
  78.           result = xlate_pro_init(&protable,xlate_tk_general,contable,
  79.                /*is64bit= */0);
  80.           /* the single transformation */
  81.           result = xlate_pro_add_range(protable,newpc,newrange,
  82.                     oldpc, oldrange);
  83.           result = xlate_pro_disk_header(protable,
  84.                XLATE_PRO_STANDARD_SETUP,
  85.                &totalmemory, &numblocks);
  86.           for(i = 0; i < numblocks; ++i)
  87.           {
  88.                result = xlate_pro_disk_next_block(protable,
  89.                     &data,&datasize);
  90.                /* do something with datasize bytes at address data */
  91.                free(data);
  92.           }
  93.           result = xlate_pro_finish(protable);
  94.  
  95.      You must install the ccoommppiilleerr__eeooee..hhddrr..iinntteerrnnaall subsystem to get the
  96.      headers necessary to work with the xxllaattee functions and lleebb112288
  97.      functions they call.
  98.  
  99. FFIILLEESS
  100.      //uussrr//iinncclluuddee//lliibbXXllaattee..hh
  101.      //uussrr//iinncclluuddee//ccmmppllrrss//xxllaattee..hh
  102.      //uussrr//iinncclluuddee//eellff..hh
  103.      //uussrr//iinncclluuddee//ddwwaarrff..hh
  104.      //uussrr//iinncclluuddee//lliibbddwwaarrff..hh
  105.      //uussrr//lliibb//lliibbeellffuuttiill..aa
  106.  
  107. SSEEEE AALLSSOO
  108.      xxllaattee__iinniitt__ffdd(3e), xxllaattee__pprroo__iinniitt(3e)
  109.  
  110.      xxllaattee(4)
  111.  
  112.      This man page is available only online.
  113.