xref: /netbsd-src/external/bsd/elftoolchain/dist/libdwarf/dwarf_set_reloc_application.3 (revision 5ac3bc719ce6e70593039505b491894133237d12)
1*5ac3bc71Schristos.\"	$NetBSD: dwarf_set_reloc_application.3,v 1.6 2024/03/03 17:37:32 christos Exp $
2e81373b4Schristos.\"
39dd9d0cfSchristos.\" Copyright (c) 2011 Kai Wang
49dd9d0cfSchristos.\" All rights reserved.
59dd9d0cfSchristos.\"
69dd9d0cfSchristos.\" Redistribution and use in source and binary forms, with or without
79dd9d0cfSchristos.\" modification, are permitted provided that the following conditions
89dd9d0cfSchristos.\" are met:
99dd9d0cfSchristos.\" 1. Redistributions of source code must retain the above copyright
109dd9d0cfSchristos.\"    notice, this list of conditions and the following disclaimer.
119dd9d0cfSchristos.\" 2. Redistributions in binary form must reproduce the above copyright
129dd9d0cfSchristos.\"    notice, this list of conditions and the following disclaimer in the
139dd9d0cfSchristos.\"    documentation and/or other materials provided with the distribution.
149dd9d0cfSchristos.\"
159dd9d0cfSchristos.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
169dd9d0cfSchristos.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
179dd9d0cfSchristos.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
189dd9d0cfSchristos.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
199dd9d0cfSchristos.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
209dd9d0cfSchristos.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
219dd9d0cfSchristos.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
229dd9d0cfSchristos.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
239dd9d0cfSchristos.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
249dd9d0cfSchristos.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
259dd9d0cfSchristos.\" SUCH DAMAGE.
269dd9d0cfSchristos.\"
27cdbf1fe1Sjkoshy.\" Id: dwarf_set_reloc_application.3 3963 2022-03-12 16:07:32Z jkoshy
289dd9d0cfSchristos.\"
2942bd3019Schristos.Dd February 11, 2015
309dd9d0cfSchristos.Dt DWARF_SET_RELOC_APPLICATION 3
31604b0842Sjkoshy.Os
329dd9d0cfSchristos.Sh NAME
339dd9d0cfSchristos.Nm dwarf_set_reloc_application
349dd9d0cfSchristos.Nd set a library-wide relocation flag
359dd9d0cfSchristos.Sh LIBRARY
369dd9d0cfSchristos.Lb libdwarf
379dd9d0cfSchristos.Sh SYNOPSIS
389dd9d0cfSchristos.In libdwarf.h
399dd9d0cfSchristos.Ft int
409dd9d0cfSchristos.Fo dwarf_set_reloc_application
419dd9d0cfSchristos.Fa "int apply"
429dd9d0cfSchristos.Fc
439dd9d0cfSchristos.Sh DESCRIPTION
449dd9d0cfSchristosFunction
459dd9d0cfSchristos.Fn dwarf_set_reloc_application
469dd9d0cfSchristosallows applications to specify how relocation information is to be
479dd9d0cfSchristoshandled by the DWARF(3) library.
489dd9d0cfSchristos.Pp
499dd9d0cfSchristosIf the argument
50cdbf1fe1Sjkoshy.Fa apply
519dd9d0cfSchristosholds a non-zero value, the library will process all the relevant
5242bd3019Schristos.Dq ".rel"
5342bd3019Schristosand
549dd9d0cfSchristos.Dq ".rela"
559dd9d0cfSchristosrelocation sections and will apply the relocation records found to
569dd9d0cfSchristostheir corresponding DWARF sections.
579dd9d0cfSchristos.Pp
589dd9d0cfSchristosIf the argument
59cdbf1fe1Sjkoshy.Fa apply
609dd9d0cfSchristosis zero, the library will not attempt to apply any relocations.
619dd9d0cfSchristos.Pp
629dd9d0cfSchristosThe default behaviour of the library is to process relocation records.
639dd9d0cfSchristos.Sh NOTES
649dd9d0cfSchristosFunction
659dd9d0cfSchristos.Fn dwarf_set_reloc_application
669dd9d0cfSchristosshould be called before initialising a dwarf debugging context, i.e,
679dd9d0cfSchristosit should be called by the application before calling either of the
689dd9d0cfSchristosfunctions
699dd9d0cfSchristos.Xr dwarf_init 3
709dd9d0cfSchristosor
719dd9d0cfSchristos.Xr dwarf_elf_init 3 .
729dd9d0cfSchristos.Sh RETURN VALUES
739dd9d0cfSchristosFunction
749dd9d0cfSchristos.Fn dwarf_set_reloc_application
759dd9d0cfSchristosreturns the previous value of the library-wide relocation application
769dd9d0cfSchristosflag.
779dd9d0cfSchristos.Sh ERRORS
789dd9d0cfSchristosFunction
799dd9d0cfSchristos.Fn dwarf_set_reloc_application
809dd9d0cfSchristosdoes not return an error.
819dd9d0cfSchristos.Sh SEE ALSO
829dd9d0cfSchristos.Xr dwarf 3 ,
83604b0842Sjkoshy.Xr dwarf_elf_init 3 ,
84604b0842Sjkoshy.Xr dwarf_init 3
85