svcadm(8)을 검색하려면 섹션에서 8 을 선택하고, 맨 페이지 이름에 svcadm을 입력하고 검색을 누른다.
ctfmerge(1)
ctfmerge(1) User Commands ctfmerge(1)
NAME
ctfmerge - merge multiple input CTF
SYNOPSIS
ctfmerge [-airsStv] [-l label] [-L label] [-V version]
-o outfile file...
ctfmerge [-airsStv] [-l label] [-L labelenv] [-V version]
-o outfile -d uniqfile [-D uniqlabel] file...
ctfmerge [-airsStv] [-l label] [-L labelenv] [-V version]
-o outfile -w withfile file...
ctfmerge [-rS] [-V version] -c srcfile destfile
DESCRIPTION
The ctfmerge utility reads CTF (Compact C Type Format) data from input
ELF object files, merges that data into a single CTF section named
.SUNW_ctf, and adds that section to the output file. The resulting CTF
data is used by debuggers and other observability tools.
ctfmerge is typically used in conjunction with ctfconvert. The ctfcon‐
vert utility is used to add CTF data to ELF objects produced by compil‐
ers and assemblers. After those objects are linked into a final object,
the ctfmerge utility is applied to the final object to augment it with
the merged CTF data from all the input objects.
The ctfmerge -a option can be used to simplify this process by elimi‐
nating the need to use ctfconvert. When the -a option is specified,
ctfmerge runs the convert process on each input object internally in
order to obtain CTF data for each input. This can be simpler to use,
but at the cost of repeating the conversion operation for every input
object every time the final object is built.
OPTIONS
The following options are supported:
-a
Automatically run the ctfconvert operation on any input object that
does not already have a .SUNW_ctf section, and merge the CTF data
produced into the output. Unlike using the ctfconvert command,
which adds CTF to the input object, the -a option does not modify
the input object. See ctfconvert(1)
-c srcfile destfile
Copy CTF data from srcfile into destfile.
-D uniqlabel
Uniquify against the label given by uniqlabel. See ctf(7).
-d uniqfile
Uniquify against the file given by uniqfile. See ctf(7).
-i
When the -a option is specified, the -i option causes ctfmerge to
silently ignore input object files built from languages other than
C. While CTF can be used with any language, the information it cap‐
tures corresponds directly to C level language concepts, making CTF
particularly useful with code written in C.
In the same sense that the -a option corresponds to the operation
normally performed by the ctfconvert utility, the -i option corre‐
sponds to specifying the -i option to ctfconvert.
-l label
Specifies a label to be associated with the generated CTF. Labels
are of use when employing uniquification to share definitions be‐
tween parent and children objects as a space saving measure. See
ctf(7).
-L labelenv
Specifies a label to be associated with the generated CTF. The
value of the environment variable specified by labelenv provides
the label to be used. If the environment variable is not defined,
no label is set, and the behavior is as if no label were specified.
See ctf(7).
-o outfile
By default, ctfmerge modifies the input object in place. When the
-o option is specified, the input object is not modified, and the
updated object contents are instead written to the file given by
outfile.
-r
Remove outfile on error. This facilitates the use of ctfmerge as
part of a series of commands executed by a makefile rule. The re‐
moval of the file on error forces a subsequent execution of the
make utility to rerun the full set of commands required to build
the target, and ensures that CTF data is added.
-s
Associate the generated CTF section with the dynamic .dynsym symbol
table rather than the default .symtab.
-S
Strip compiler generated debug sections from the resulting object.
-t
Require each input file to have a CTF section, or when the -a op‐
tion is specified, that the conversion operation succeeds in pro‐
ducing CTF.
-V version
Specify the version of the CTF format produced. Valid versions are
2 or 3. By default, ctfmerge produces version 3 CTF data, which is
recommended for most purposes. -V is a specialized option, primar‐
ily of use for testing purposes. See ctf(5).
-v
Enable verbose mode.
-w withfile
Additive merge against the file given by withfile. See ctf(7).
-?
--help
Print usage message and immediately exit.
OPERANDS
The following operands are supported.
file...
Input ELF objects from which merged CTF data will be constructed.
NOTES
GNU CTF
The ctfmerge utility provides support for the GNU CTF produced by the
-gctf option to the gcc compilers. The CTF produced by gcc is a differ‐
ent variant that is not directly compatible with the native CTF used on
Oracle Solaris. However, the Solaris CTF implementation is able to rec‐
ognize GNU CTF, and will automatically translate it to the native form
when it is read during the merge stage. See ctf(7).
Deprecated Historical Options
The ctfmerge utility silently accepts -f and -g options for backward
compatibility with old makefiles. These options have no effect, and may
be removed.
Historical versions of ctfmerge required the -f option to be specified
in order to properly handle global symbols in the CTF data that subse‐
quently have their scope reduced to local by the link-editor. Scope re‐
duction can be requested from a mapfile, or through the use of link-ed‐
itor command line options. ctfmerge now handles this case automati‐
cally, and the use of -f is unnecessary. See ld(1), and Oracle Solaris
11.4 Linkers and Libraries Guide.
Historically, the ctfmerge utility defaulted to the removal of stabs
and dwarf sections from the output object, and the -g option could be
specified to prevent their removal. In current implementations, the be‐
havior has been reversed. Stabs and dwarf sections are retained by de‐
fault, and the -S option is provided to remove them when needed. While
still accepted, the -g option no longer has any effect.
EXAMPLES
Example 1 Use ctfconvert and ctfmerge to add CTF to a program
Add CTF to a program built from three source files.
% cc -g -c main.c a.c b.c
main.c:
a.c:
b.c:
% ctfconvert main.o
% ctfconvert a.o
% ctfconvert b.o
% cc -o prog main.o a.o b.o
% ctfmerge -o prog main.o a.o b.o
Example 2 Use ctfmerge -a to add CTF to a program
Repeat the previous example, using the -a option to eliminate the need
to run ctfconvert on each individual input object.
% cc -g -c main.c a.c b.c
main.c:
a.c:
b.c:
% cc -o prog main.o a.o b.o
% ctfmerge -a -o prog main.o a.o b.o
EXIT STATUS
The following exit values are returned:
0 Successful completion.
> 0 An error occurred.
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
TRIBUTE VALUE _ Availabilitydeveloper/base-developer-utilities _ Inter‐
face StabilityCommitted
HISTORY
The CTF utilities, including ctfmerge, have been used in the construc‐
tion of Solaris since Sun Solaris 9. They were added as system utili‐
ties in Oracle Solaris 11.4.75.
Support for CTF version 3, and the -V option, were added in Oracle So‐
laris 11.4.75.81.
Support for reading GNU CTF from relocatable objects created by the gcc
compilers and translating it to the native CTF representation was added
in the Oracle Solaris 11.4.84 release.
SEE ALSO
ctfconvert(1), ctfdump(1), ld(1), ctf(5), ctf(7)
Oracle Solaris 11.4 Linkers and Libraries Guide
Oracle Solaris 11.4 8 April 2025 ctfmerge(1)