xref: /freebsd/contrib/elftoolchain/libdwarf/dwarf_add_arange.3 (revision 2de3b87a120614a3b053be7dd845b72f1e9ce804)
1*2de3b87aSKai Wang.\" Copyright (c) 2011 Kai Wang
2*2de3b87aSKai Wang.\" All rights reserved.
3*2de3b87aSKai Wang.\"
4*2de3b87aSKai Wang.\" Redistribution and use in source and binary forms, with or without
5*2de3b87aSKai Wang.\" modification, are permitted provided that the following conditions
6*2de3b87aSKai Wang.\" are met:
7*2de3b87aSKai Wang.\" 1. Redistributions of source code must retain the above copyright
8*2de3b87aSKai Wang.\"    notice, this list of conditions and the following disclaimer.
9*2de3b87aSKai Wang.\" 2. Redistributions in binary form must reproduce the above copyright
10*2de3b87aSKai Wang.\"    notice, this list of conditions and the following disclaimer in the
11*2de3b87aSKai Wang.\"    documentation and/or other materials provided with the distribution.
12*2de3b87aSKai Wang.\"
13*2de3b87aSKai Wang.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14*2de3b87aSKai Wang.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15*2de3b87aSKai Wang.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16*2de3b87aSKai Wang.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17*2de3b87aSKai Wang.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18*2de3b87aSKai Wang.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19*2de3b87aSKai Wang.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20*2de3b87aSKai Wang.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21*2de3b87aSKai Wang.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22*2de3b87aSKai Wang.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23*2de3b87aSKai Wang.\" SUCH DAMAGE.
24*2de3b87aSKai Wang.\"
25*2de3b87aSKai Wang.\" $Id: dwarf_add_arange.3 2072 2011-10-27 03:26:49Z jkoshy $
26*2de3b87aSKai Wang.\"
27*2de3b87aSKai Wang.Dd September 18, 2011
28*2de3b87aSKai Wang.Os
29*2de3b87aSKai Wang.Dt DWARF_ADD_ARANGE 3
30*2de3b87aSKai Wang.Sh NAME
31*2de3b87aSKai Wang.Nm dwarf_add_arange ,
32*2de3b87aSKai Wang.Nm dwarf_add_arange_b
33*2de3b87aSKai Wang.Nd add address range information to a DWARF producer instance
34*2de3b87aSKai Wang.Sh LIBRARY
35*2de3b87aSKai Wang.Lb libdwarf
36*2de3b87aSKai Wang.Sh SYNOPSIS
37*2de3b87aSKai Wang.In libdwarf.h
38*2de3b87aSKai Wang.Ft "Dwarf_Unsigned"
39*2de3b87aSKai Wang.Fo dwarf_add_arange
40*2de3b87aSKai Wang.Fa "Dwarf_P_Debug dbg"
41*2de3b87aSKai Wang.Fa "Dwarf_Addr start"
42*2de3b87aSKai Wang.Fa "Dwarf_Unsigned length"
43*2de3b87aSKai Wang.Fa "Dwarf_Signed symbol_index"
44*2de3b87aSKai Wang.Fa "Dwarf_Error *err"
45*2de3b87aSKai Wang.Fc
46*2de3b87aSKai Wang.Ft "Dwarf_Unsigned"
47*2de3b87aSKai Wang.Fo dwarf_add_arange_b
48*2de3b87aSKai Wang.Fa "Dwarf_P_Debug dbg"
49*2de3b87aSKai Wang.Fa "Dwarf_Addr start"
50*2de3b87aSKai Wang.Fa "Dwarf_Unsigned length"
51*2de3b87aSKai Wang.Fa "Dwarf_Unsigned symbol_index"
52*2de3b87aSKai Wang.Fa "Dwarf_Unsigned end_symbol_index"
53*2de3b87aSKai Wang.Fa "Dwarf_Addr offset_from_end_symbol"
54*2de3b87aSKai Wang.Fa "Dwarf_Error *err"
55*2de3b87aSKai Wang.Fc
56*2de3b87aSKai Wang.Sh DESCRIPTION
57*2de3b87aSKai WangFunction
58*2de3b87aSKai Wang.Fn dwarf_add_arange_b
59*2de3b87aSKai Wangadds an address range entry to a producer instance.
60*2de3b87aSKai Wang.Pp
61*2de3b87aSKai WangArgument
62*2de3b87aSKai Wang.Ar dbg
63*2de3b87aSKai Wangshould reference a DWARF producer instance allocated using
64*2de3b87aSKai Wang.Xr dwarf_producer_init 3
65*2de3b87aSKai Wangor
66*2de3b87aSKai Wang.Xr dwarf_producer_init_b 3 .
67*2de3b87aSKai Wang.Pp
68*2de3b87aSKai WangArgument
69*2de3b87aSKai Wang.Ar start
70*2de3b87aSKai Wangspecifies the relocatable start address of the address range.
71*2de3b87aSKai Wang.Pp
72*2de3b87aSKai WangArgument
73*2de3b87aSKai Wang.Ar length
74*2de3b87aSKai Wangspecifies the length of the address range.
75*2de3b87aSKai Wang.Pp
76*2de3b87aSKai WangArgument
77*2de3b87aSKai Wang.Ar symbol_index
78*2de3b87aSKai Wangspecifies the ELF symbol index of the first symbol to be used for
79*2de3b87aSKai Wangrelocation.
80*2de3b87aSKai Wang.Pp
81*2de3b87aSKai WangArgument
82*2de3b87aSKai Wang.Ar end_symbol_index
83*2de3b87aSKai Wangspecifies the ELF symbol index of the second symbol to be used for
84*2de3b87aSKai Wangrelocation.
85*2de3b87aSKai Wang.Bl -bullet
86*2de3b87aSKai Wang.It
87*2de3b87aSKai WangIf argument
88*2de3b87aSKai Wang.Ar end_symbol_index
89*2de3b87aSKai Wangis not 0, the
90*2de3b87aSKai Wang.Dv DW_DLC_SYMBOLIC_RELOCATIONS
91*2de3b87aSKai Wangflag should have been set on the DWARF producer instance.
92*2de3b87aSKai WangThe address value specified by argument
93*2de3b87aSKai Wang.Ar start
94*2de3b87aSKai Wangwill be treated as an offset value from the first symbol,
95*2de3b87aSKai Wangand the argument
96*2de3b87aSKai Wang.Ar offset_from_end_symbol
97*2de3b87aSKai Wangshould hold an offset value from the second symbol.
98*2de3b87aSKai WangApplication code can retrieve the relocation entries for the
99*2de3b87aSKai Wangsymbol pair by calling function
100*2de3b87aSKai Wang.Xr dwarf_get_relocation_info 3 .
101*2de3b87aSKai WangThe relocation entry for the first symbol will have type
102*2de3b87aSKai Wang.Dv dwarf_drt_first_of_length_pair
103*2de3b87aSKai Wangand the relocation entry for the second symbol will have type
104*2de3b87aSKai Wang.Dv dwarf_drt_second_of_length_pair .
105*2de3b87aSKai Wang.It
106*2de3b87aSKai WangIf argument
107*2de3b87aSKai Wang.Ar end_symbol_index
108*2de3b87aSKai Wangis 0, argument
109*2de3b87aSKai Wang.Ar offset_from_end_symbol
110*2de3b87aSKai Wangwill be ignored and only one symbol is used for relocation.
111*2de3b87aSKai Wang.El
112*2de3b87aSKai Wang.Pp
113*2de3b87aSKai WangIf argument
114*2de3b87aSKai Wang.Ar err
115*2de3b87aSKai Wangis not NULL, it will be used to store error information in case
116*2de3b87aSKai Wangof an error.
117*2de3b87aSKai Wang.Pp
118*2de3b87aSKai WangFunction
119*2de3b87aSKai Wang.Fn dwarf_add_arange
120*2de3b87aSKai Wangis deprecated.
121*2de3b87aSKai WangIt is similar to function
122*2de3b87aSKai Wang.Fn dwarf_add_arange_b
123*2de3b87aSKai Wangexcept that it cannot handle all possible symbol index values
124*2de3b87aSKai Wangand supports only one relocation symbol.
125*2de3b87aSKai Wang.Sh RETURN VALUES
126*2de3b87aSKai WangOn success, these functions return a non-zero value.
127*2de3b87aSKai WangIn case of an error, these functions return 0 and set
128*2de3b87aSKai Wangthe argument
129*2de3b87aSKai Wang.Ar err .
130*2de3b87aSKai Wang.Sh ERRORS
131*2de3b87aSKai WangThese functions can fail with:
132*2de3b87aSKai Wang.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT"
133*2de3b87aSKai Wang.It Bq Er DW_DLE_ARGUMENT
134*2de3b87aSKai WangArgument
135*2de3b87aSKai Wang.Ar dbg
136*2de3b87aSKai Wangwas NULL.
137*2de3b87aSKai Wang.It Bq Er DW_DLE_ARGUMENT
138*2de3b87aSKai WangArgument
139*2de3b87aSKai Wang.Ar end_symbol_index
140*2de3b87aSKai Wangwas non-zero, but the flag
141*2de3b87aSKai Wang.Dv DW_DLC_SYMBOLIC_RELOCATIONS
142*2de3b87aSKai Wangwas not set on the producer instance.
143*2de3b87aSKai Wang.It Bq Er DW_DLE_MEMORY
144*2de3b87aSKai WangAn out of memory condition was encountered during the execution of the
145*2de3b87aSKai Wangfunction.
146*2de3b87aSKai Wang.El
147*2de3b87aSKai Wang.Sh SEE ALSO
148*2de3b87aSKai Wang.Xr dwarf 3 ,
149*2de3b87aSKai Wang.Xr dwarf_get_relocation_info 3 ,
150*2de3b87aSKai Wang.Xr dwarf_producer_init 3 ,
151*2de3b87aSKai Wang.Xr dwarf_producer_init_b 3
152