*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> libelfutil (5)              



NAME    [Toc]    [Back]

     libelfutil	- library for xlate sections and leb128	numbers.

SYNOPSIS    [Toc]    [Back]

     #include <libXlate.h>
     #include <cmplrs/leb128.h>

DESCRIPTION    [Toc]    [Back]

     This library is a collection of functions which are perhaps best thought
     of	as three groups:  the xlate functions used to create and access	the
     .MIPS.xlate and related sections, the leb128 functions, and a disassembly
     function (undocumented).

     The following is a	description of the xlate routines.  The	xlate routines
     are used to create	and access addresses translation data  as described in

     Calls used	to create address translation data are called "producer"
     calls.  Calls used	to create applications that read the address
     translation data are called "consumer" calls.

     Use -lelfutil  -lelf on the link command line to link  in libelfutil.

     All call interfaces described here	pass and return	values sufficient for
     both 32 and 64 bit	executables and	DSOs.  On disk the data	format is
     slightly different	for 32 and 64 bit executables and DSOs but there is
     only one library interface.

xlate Consumer Interface
     The xlate consumer	interface is used by debuggers and other tools that
     wish to know, for a transformed executable	or DSO,	what given execution
     time addresses were in the	original program text (executable
     instructions).  Or	that wish to know, for a given address taken from the
     debugging information, what address this represents in the	transformed
     text (the debugging information is	not changed by transformations,	so the
     debugging information give	addresses which	are not	identical to the
     executing transformed text).

     All code here ignores return values to keep the examples small.

     This example gets the untransformed address for a range of	transformed

									Page 1


	  int result;
	  xlate_table_con contable = 0;
	  xlate_block range;
	  result = xlate_init_fd(myopenfd,
	  for(pc = startpc; pc <endpc; pc += 4)
	      Elf64_Addr oldaddress;
	      xlate_Block range;
		  result = xlate_address(contable,
	      ...do something useful here...
	  result = xlate_finish(contable);

xlate Producer Interface
     The xlate producer	interface is used by transforming applications (like
     cord(1) and pixie(1)) to register the transformations so other tools
     (like dbx(1)) can,	at execution time, use the Consumer Interface to help
     the tool user understand the transformed text.

     This example records a trivial transformation and gets back the
     transformed bytes.

	  int result;
	  xlate_table_con contable = 0;
	  xlate_table_pro protable = 0;
	  result = xlate_pro_init(&protable,xlate_tk_general,contable,
	      /*is64bit= */0);
	  /* the single	transformation */
	  result = xlate_pro_add_range(protable,newpc,newrange,
		  oldpc, oldrange);
	  result = xlate_pro_disk_header(protable,
	      &totalmemory, &numblocks);
	  for(i	= 0; i < numblocks; ++i)
	      result = xlate_pro_disk_next_block(protable,
	      /* do something with datasize bytes at address data */
	  result = xlate_pro_finish(protable);

     You must install the compiler_eoe.hdr.internal subsystem to get the
     headers necessary to work with the	xlate functions	and leb128 functions
     they call.

									Page 2



SEE ALSO    [Toc]    [Back]

     xlate(4), xlate_init_fd(3e), xlate_pro_init(3e)

									PPPPaaaaggggeeee 3333
[ Back ]
 Similar pages
Name OS Title
_leb128_unsigned_encode64 IRIX encode leb128 integers
_leb128_unsigned_decode64 IRIX decode leb128 integers
omp_threads IRIX Runtime library procedures used to set, call or return numbers of threads
getNAME FreeBSD get name sections from manual pages
DtMmdbBookGetTabList HP-UX obtains the list of tab sections in a book
cut Linux remove sections from each line of files
DtMmdbTocGetNumOfChildren HP-UX obtains the number of child sections
mcs Tru64 Manipulates object file comment sections
tcpslice Tru64 Extracts sections of or merges tcpdump files
DtMmdbTocGetChildIds HP-UX obtains a list of object identifiers for child sections
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service