xref: /onnv-gate/usr/src/cmd/sgs/libelf/demo/00README (revision 12927:a27c46eb192b)
1*12927SRod.Evans@Sun.COM#
2*12927SRod.Evans@Sun.COM# CDDL HEADER START
3*12927SRod.Evans@Sun.COM#
4*12927SRod.Evans@Sun.COM# The contents of this file are subject to the terms of the
5*12927SRod.Evans@Sun.COM# Common Development and Distribution License (the "License").
6*12927SRod.Evans@Sun.COM# You may not use this file except in compliance with the License.
7*12927SRod.Evans@Sun.COM#
8*12927SRod.Evans@Sun.COM# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*12927SRod.Evans@Sun.COM# or http://www.opensolaris.org/os/licensing.
10*12927SRod.Evans@Sun.COM# See the License for the specific language governing permissions
11*12927SRod.Evans@Sun.COM# and limitations under the License.
12*12927SRod.Evans@Sun.COM#
13*12927SRod.Evans@Sun.COM# When distributing Covered Code, include this CDDL HEADER in each
14*12927SRod.Evans@Sun.COM# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*12927SRod.Evans@Sun.COM# If applicable, add the following below this CDDL HEADER, with the
16*12927SRod.Evans@Sun.COM# fields enclosed by brackets "[]" replaced with your own identifying
17*12927SRod.Evans@Sun.COM# information: Portions Copyright [yyyy] [name of copyright owner]
18*12927SRod.Evans@Sun.COM#
19*12927SRod.Evans@Sun.COM# CDDL HEADER END
20*12927SRod.Evans@Sun.COM#
21*12927SRod.Evans@Sun.COM#
22*12927SRod.Evans@Sun.COM# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
23*12927SRod.Evans@Sun.COM#
24*12927SRod.Evans@Sun.COM
25*12927SRod.Evans@Sun.COMThis directory contains sample programs that demonstrate how to use libelf.
26*12927SRod.Evans@Sun.COMManual pages for libelf routines are located in section 3e: Library Functions.
27*12927SRod.Evans@Sun.COM
28*12927SRod.Evans@Sun.COMEach of these sample programs displays, or manipulates information from a ELF
29*12927SRod.Evans@Sun.COMfile.  Each program uses libelf differently.  To learn more about ELF files
30*12927SRod.Evans@Sun.COMand their format refer to the "Linker & Libraries Guide", which is part of the
31*12927SRod.Evans@Sun.COM"Software Developer Collection", and the "System V Application Binary
32*12927SRod.Evans@Sun.COMInterface".
33*12927SRod.Evans@Sun.COM
34*12927SRod.Evans@Sun.COMThe following source files are provided:
35*12927SRod.Evans@Sun.COM
36*12927SRod.Evans@Sun.COMpcom.c		print comment: prints the .comment section of an ELF file.
37*12927SRod.Evans@Sun.COM		Demonstrates how to examine a file opened with
38*12927SRod.Evans@Sun.COM		elf_begin(ELF_C_READ)
39*12927SRod.Evans@Sun.COM
40*12927SRod.Evans@Sun.COMacom.c		append comment: appends to, or creates a .comment section
41*12927SRod.Evans@Sun.COM		within an ELF file.  Demonstrates the updating of a file with
42*12927SRod.Evans@Sun.COM		elf_begin(ELF_C_RDWR)
43*12927SRod.Evans@Sun.COM
44*12927SRod.Evans@Sun.COMdcom.c		delete comment: deletes a .comment section from an ELF file.
45*12927SRod.Evans@Sun.COM		Demonstrates the creation of a ELF file with
46*12927SRod.Evans@Sun.COM		elf_begin(ELF_C_WRITE)
47*12927SRod.Evans@Sun.COM
48*12927SRod.Evans@Sun.COMtpcom.c		threaded print comment:  a threaded version of pcom.c.
49*12927SRod.Evans@Sun.COM		Demonstrates that libelf is MT-Safe and can be used by a
50*12927SRod.Evans@Sun.COM		threaded program.
51*12927SRod.Evans@Sun.COM
52*12927SRod.Evans@Sun.COMdispsyms.c	print symbols:  scans a ELF file for any symbol tables
53*12927SRod.Evans@Sun.COM		(SHT_SYMTAB, SHT_DYNSYM, or SHT_SUNW_LDYNSYM) and
54*12927SRod.Evans@Sun.COM		displays the symbol tables contents.
55*12927SRod.Evans@Sun.COM
56*12927SRod.Evans@Sun.COMMakefile	make file to build the above programs.
57*12927SRod.Evans@Sun.COM
58*12927SRod.Evans@Sun.COM
59*12927SRod.Evans@Sun.COMBuilding the demos
60*12927SRod.Evans@Sun.COM------------------
61*12927SRod.Evans@Sun.COM
62*12927SRod.Evans@Sun.COMTo build the programs:
63*12927SRod.Evans@Sun.COM
64*12927SRod.Evans@Sun.COM  % make all
65*12927SRod.Evans@Sun.COM
66*12927SRod.Evans@Sun.COMTo test the programs:
67*12927SRod.Evans@Sun.COM
68*12927SRod.Evans@Sun.COM  % make test
69