elf_update man page on HP-UX

Man page or keyword search:  
man Server   10987 pages
apropos Keyword Search (all sections)
Output format
HP-UX logo
[printable version]

elf_update(3E)							elf_update(3E)

       elf_update - update an ELF descriptor

       [flag... ] file...  [library] ...

       causes  the  library  to examine the information associated with an ELF
       descriptor, elf, and to recalculate the structural data needed to  gen‐
       erate the file's image.

       cmd may have the following values.

       This value tells	 to  recalculate various values, updating only the ELF
			 descriptor's memory structures.  Any modified	struc‐
			 tures	are  flagged with the bit.  A program thus can
			 update the structural information and then  reexamine
			 them  without	changing  the file associated with the
			 ELF descriptor.  Because this	does  not  change  the
			 file,	the ELF descriptor may allow reading, writing,
			 or both reading and writing (see elf_begin(3E)).

       If		 cmd has this value, duplicates its actions  and  also
			 writes	 any ``dirty'' information associated with the
			 ELF descriptor to the file.  That is, when a  program
			 has  used  or the facilities to supply new (or update
			 existing) information for an  ELF  descriptor,	 those
			 data  will  be	 examined,  coordinated, translated if
			 necessary (see elf_xlate(3E)),	 and  written  to  the
			 file.	 When  portions	 of  the file are written, any
			 bits are reset, indicating those items no longer need
			 to  be	 written  to the file (see elf_flag(3E)).  The
			 sections' data is written in the order of their  sec‐
			 tion  header entries, and the section header table is
			 written to the end of the file.

			 When the ELF descriptor was created with it must have
			 allowed  writing the file.  That is, the command must
			 have been either or

       If succeeds, it returns the total size of the file image (not the  mem‐
       ory  image),  in	 bytes.	 Otherwise an error occurred, and the function
       returns -1.

       When updating the internal structures, sets some members itself.	  Mem‐
       bers  listed  below are the application's responsibility and retain the
       values given by the program.

				  Member   Notes
			e_ident[EI_DATA]   Library controls other
					   e_ident values
		   ELF Header	 e_entry
				 e_phoff   Only when ELF_F_LAYOUT
				 e_shoff   Only when ELF_F_LAYOUT


				Member	 Notes
				p_type	   The application controls all
			      p_offset	   program header entries
	     Program Header   p_filesz

				    Member   Notes
				 sh_offset   Only when ELF_F_LAYOUT
		  Section Header   sh_size   Only when ELF_F_LAYOUT
			      sh_addralign   Only when ELF_F_LAYOUT

				   Member   Notes
		  Data Descriptor   d_off   Only when ELF_F_LAYOUT

       Note the program is responsible for two particularly important  members
       (among  others)	in the ELF header.  The member controls the version of
       data structures written to the file.  If the  version  is  the  library
       uses  its  own  internal version.  The entry controls the data encoding
       used in the file.  As a special case, the value may be to  request  the
       native  data  encoding  for  the host machine.  An error occurs in this
       case if the native encoding doesn't match a file encoding known by  the

       Further	note  that  the	 program is responsible for the section header
       member.	Although the library sets it for sections with known types, it
       cannot reliably know the correct value for all sections.	 Consequently,
       the library relies on the program to provide  the  values  for  unknown
       section	type.	If  the	 entry	size is unknown or not applicable, the
       value should be set to zero.

       When deciding how to build the output file,  obeys  the	alignments  of
       individual  data	 buffers  to create output sections.  A section's most
       strictly aligned data buffer controls  the  section's  alignment.   The
       library	also  inserts padding between buffers, as necessary, to ensure
       the proper alignment of each buffer.

       As mentioned above, the commands translate data	as  necessary,	before
       writing	them  to the file.  This translation is not always transparent
       to the application program.  If a program has obtained pointers to data
       associated  with	 a file (for example, see elf_getehdr(3E) and elf_get‐
       data(3E)), the program should reestablish the pointers after calling

       As elf_begin(3E) describes, a program may ``update''  a	COFF  file  to
       make  the image consistent for ELF. (COFF is an object file format that
       preceded ELF on some computer architectures (Intel, for example).  When
       a  program  calls elf_begin on a COFF file, the library translates COFF
       structures to their ELF equivalents, allowing programs to read (but not
       to  write)  a COFF file as if it were ELF. This conversion happens only
       to the memory image and not to the file itself.)	 The  command  updates
       only  the  memory  image; one can use the command to modify the file as
       well.  Absolute executable  files  files)  require  special  alignment,
       which  cannot normally be preserved between COFF and ELF. Consequently,
       one may not update an executable COFF file with the command (though  is

       elf(3E),	 elf_begin(3E),	 elf_flag(3E), elf_fsize(3E), elf_getdata(3E),
       elf_getehdr(3E), elf_getshdr(3E), elf_xlate(3E).


List of man pages available for HP-UX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net