diff --git a/contrib/elftoolchain/README.rst b/contrib/elftoolchain/README.rst new file mode 100644 index 000000000000..75e4bd671540 --- /dev/null +++ b/contrib/elftoolchain/README.rst @@ -0,0 +1,126 @@ +The Elftoolchain Project +======================== + +.. contents:: Table of Contents + +Description +----------- + +This software implements essential compilation tools and libraries for: + +- managing program objects conforming to the ELF_ object format, and +- for managing DWARF_ debugging information in ELF objects. + +The project currently implements the following utilities and +libraries: + +=========== ============================================ +Name Description +=========== ============================================ +ar Archive manager. +addr2line Debug tool. +brandelf Manage the ELF brand on executables. +c++filt Translate encoded symbols. +elfcopy Copy and translate between object formats. +elfdump Diagnostic tool. +findtextrel Find undesired text relocations. +libdwarf DWARF access library. +libelf ELF access library. +mcs Manage comment sections. +nm List symbols in an ELF object. +ranlib Add archive symbol tables to an archive. +readelf Display ELF information. +size List object sizes. +strings Extract printable strings. +strip Discard information from ELF objects. +=========== ============================================ + +.. _ELF: http://en.wikipedia.org/wiki/Executable_and_Linkable_Format +.. _DWARF: http://www.dwarfstd.org/ + + +Project Documentation +--------------------- + +- Release notes for released versions of this software are present in + the file ``RELEASE-NOTES`` in the current directory. +- The file ``INSTALL`` in the current directory contains instructions + on building and installing this software. +- Reference documentation in the form of manual pages is provided for + the utilities and libraries developed by the project. +- Additional tutorial documentation is present in the + ``documentation`` directory. + + +Tracking Ongoing Development +---------------------------- + +The project uses subversion_ for its version control system. + +.. _subversion: https://subversion.apache.org/ + +The subversion branch for the current set of sources may be accessed +at the following URL:: + + https://elftoolchain.svn.sourceforge.net/svnroot/elftoolchain/trunk + +The project's source tree may be checked out from its repository by +using the ``svn checkout`` command:: + + % svn checkout https://elftoolchain.svn.sourceforge.net/svnroot/elftoolchain/trunk + +Checked-out sources may be kept upto-date by running ``svn update`` +inside the source directory:: + + % svn update + + +Instructions on building and installing the software are given in the +file ``INSTALL`` in the current directory. + +Downloading Released Software +----------------------------- + +Released versions of the project's software may also be downloaded +from SourceForge's `file release system`_. + +.. _file release system: http://sourceforge.net/projects/elftoolchain/files/ + +Copyright and License +--------------------- + +This code is copyright its authors, and is distributed under the `BSD +License`_. + +.. _BSD License: http://www.opensource.org/licenses/bsd-license.php + + +Developer Community +------------------- + +The project's developers may be contacted using the mailing list: +````. + + +Reporting Bugs +-------------- + +Please use our `Trac instance`_ for viewing existing bug reports and +for submitting new bug reports. + +.. _`Trac instance`: http://sourceforge.net/apps/trac/elftoolchain/report + + +Additional Information +---------------------- + +Additional information about the project may be found on the `project +website`_. + +.. _project website: http://elftoolchain.sourceforge.net/ + +.. $Id: README.rst 3656 2018-12-26 09:46:24Z jkoshy $ + +.. Local Variables: +.. mode: rst +.. End: diff --git a/contrib/elftoolchain/addr2line/addr2line.1 b/contrib/elftoolchain/addr2line/addr2line.1 index 15c24acb6b68..f1b01954b3a6 100644 --- a/contrib/elftoolchain/addr2line/addr2line.1 +++ b/contrib/elftoolchain/addr2line/addr2line.1 @@ -22,11 +22,11 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Id: addr2line.1 3263 2015-11-30 04:25:54Z kaiwang27 $ +.\" $Id: addr2line.1 3642 2018-10-14 14:24:28Z jkoshy $ .\" .Dd November 30, 2015 -.Os .Dt ADDR2LINE 1 +.Os .Sh NAME .Nm addr2line .Nd translate program addresses to source file names and line numbers diff --git a/contrib/elftoolchain/addr2line/addr2line.c b/contrib/elftoolchain/addr2line/addr2line.c index 9c3a764fcd0d..619214fb0fae 100644 --- a/contrib/elftoolchain/addr2line/addr2line.c +++ b/contrib/elftoolchain/addr2line/addr2line.c @@ -40,7 +40,7 @@ #include "uthash.h" #include "_elftc.h" -ELFTC_VCSID("$Id: addr2line.c 3499 2016-11-25 16:06:29Z emaste $"); +ELFTC_VCSID("$Id: addr2line.c 3544 2017-06-05 14:51:44Z emaste $"); struct Func { char *name; diff --git a/contrib/elftoolchain/ar/ar.1 b/contrib/elftoolchain/ar/ar.1 index f4cd9340724d..4b3c80811d7e 100644 --- a/contrib/elftoolchain/ar/ar.1 +++ b/contrib/elftoolchain/ar/ar.1 @@ -21,51 +21,52 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: ar.1 3230 2015-07-27 17:11:38Z emaste $ +.\" $Id: ar.1 3642 2018-10-14 14:24:28Z jkoshy $ .\" -.Dd July 27, 2015 -.Os +.Dd September 30, 2018 .Dt AR 1 +.Os .Sh NAME .Nm ar .Nd manage archives .Sh SYNOPSIS .Nm .Fl d -.Op Fl T .Op Fl f .Op Fl j +.Op Fl T .Op Fl v .Op Fl z .Ar archive .Ar .Nm .Fl m -.Op Fl T .Op Fl a Ar position-after .Op Fl b Ar position-before .Op Fl f .Op Fl i Ar position-before .Op Fl j .Op Fl s | Fl S +.Op Fl T .Op Fl z .Ar archive .Ar .Nm .Fl p -.Op Fl T .Op Fl f +.Op Fl s +.Op Fl T .Op Fl v .Ar archive .Op Ar .Nm .Fl q -.Op Fl T .Op Fl c .Op Fl D .Op Fl f .Op Fl F Ar flavor | Fl -flavor Ar flavor .Op Fl s | Fl S +.Op Fl T .Op Fl U .Op Fl v .Op Fl z @@ -73,7 +74,6 @@ .Ar .Nm .Fl r -.Op Fl T .Op Fl a Ar position-after .Op Fl b Ar position-before .Op Fl c @@ -83,6 +83,7 @@ .Op Fl i Ar position-before .Op Fl j .Op Fl s | Fl S +.Op Fl T .Op Fl u .Op Fl U .Op Fl v @@ -99,6 +100,7 @@ .Nm .Fl t .Op Fl f +.Op Fl s .Op Fl T .Op Fl v .Ar archive @@ -106,9 +108,10 @@ .Nm .Fl x .Op Fl C -.Op Fl T .Op Fl f .Op Fl o +.Op Fl s +.Op Fl T .Op Fl u .Op Fl v .Ar archive diff --git a/contrib/elftoolchain/ar/ar.5 b/contrib/elftoolchain/ar/ar.5 index 45961e05cf61..9e403d38c5bf 100644 --- a/contrib/elftoolchain/ar/ar.5 +++ b/contrib/elftoolchain/ar/ar.5 @@ -21,11 +21,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: ar.5 3182 2015-04-10 16:08:10Z emaste $ +.\" $Id: ar.5 3642 2018-10-14 14:24:28Z jkoshy $ .\" -.Dd November 28, 2010 -.Os +.Dd September 30, 2018 .Dt AR 5 +.Os .Sh NAME .Nm ar .Nd archive file format for @@ -84,6 +84,8 @@ An archive header comprises the following fixed sized fields: .Bl -tag -width "Li ar_name" .It Ar ar_name (16 bytes) The file name of the archive member. +This field names a leaf file; absolute paths and relative paths containing +directory names are not supported. The format of this field varies between the BSD and SVR4/GNU formats and is described in more detail in the section .Sx "Representing File Names" diff --git a/contrib/elftoolchain/ar/ar.c b/contrib/elftoolchain/ar/ar.c index 1b60a12fd480..82726a1baccf 100644 --- a/contrib/elftoolchain/ar/ar.c +++ b/contrib/elftoolchain/ar/ar.c @@ -72,7 +72,7 @@ #include "ar.h" -ELFTC_VCSID("$Id: ar.c 3319 2016-01-13 21:37:53Z jkoshy $"); +ELFTC_VCSID("$Id: ar.c 3629 2018-09-30 19:26:28Z jkoshy $"); enum options { @@ -100,11 +100,12 @@ main(int argc, char **argv) struct bsdar *bsdar, bsdar_storage; char *arcmd, *argv1_saved; size_t len; - int i, opt; + int exitcode, i, opt; bsdar = &bsdar_storage; memset(bsdar, 0, sizeof(*bsdar)); + exitcode = EXIT_SUCCESS; arcmd = argv1_saved = NULL; bsdar->output = stdout; @@ -152,9 +153,9 @@ main(int argc, char **argv) bsdar->options |= AR_S; while ((bsdar->filename = *argv++) != NULL) - ar_write_archive(bsdar, 's'); + exitcode |= ar_write_archive(bsdar, 's'); - exit(EXIT_SUCCESS); + exit(exitcode); } else { if (argc < 2) bsdar_usage(); @@ -331,30 +332,33 @@ main(int argc, char **argv) if ((!bsdar->mode || strchr("ptx", bsdar->mode)) && bsdar->options & AR_S) { - ar_write_archive(bsdar, 's'); + exitcode = ar_write_archive(bsdar, 's'); if (!bsdar->mode) - exit(EXIT_SUCCESS); + exit(exitcode); } switch(bsdar->mode) { case 'd': case 'm': case 'q': case 'r': - ar_write_archive(bsdar, bsdar->mode); + exitcode = ar_write_archive(bsdar, bsdar->mode); break; case 'p': case 't': case 'x': - ar_read_archive(bsdar, bsdar->mode); + exitcode = ar_read_archive(bsdar, bsdar->mode); break; default: bsdar_usage(); /* NOTREACHED */ } - for (i = 0; i < bsdar->argc; i++) - if (bsdar->argv[i] != NULL) + for (i = 0; i < bsdar->argc; i++) { + if (bsdar->argv[i] != NULL) { bsdar_warnc(bsdar, 0, "%s: not found in archive", bsdar->argv[i]); + exitcode = EXIT_FAILURE; + } + } - exit(EXIT_SUCCESS); + exit(exitcode); } static void diff --git a/contrib/elftoolchain/ar/ar.h b/contrib/elftoolchain/ar/ar.h index a75b9a9eb856..b39a1d978152 100644 --- a/contrib/elftoolchain/ar/ar.h +++ b/contrib/elftoolchain/ar/ar.h @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ar.h 2496 2012-04-24 02:33:40Z jkoshy $ + * $Id: ar.h 3629 2018-09-30 19:26:28Z jkoshy $ */ #include @@ -135,8 +135,8 @@ struct bsdar { }; void ar_mode_script(struct bsdar *ar); -void ar_read_archive(struct bsdar *_ar, int _mode); -void ar_write_archive(struct bsdar *_ar, int _mode); +int ar_read_archive(struct bsdar *_ar, int _mode); +int ar_write_archive(struct bsdar *_ar, int _mode); void bsdar_errc(struct bsdar *, int _code, const char *fmt, ...); int bsdar_is_pseudomember(struct bsdar *_ar, const char *_name); const char *bsdar_strmode(mode_t m); diff --git a/contrib/elftoolchain/ar/ranlib.1 b/contrib/elftoolchain/ar/ranlib.1 index 89ab4ab49cab..84738634e9e7 100644 --- a/contrib/elftoolchain/ar/ranlib.1 +++ b/contrib/elftoolchain/ar/ranlib.1 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: ranlib.1 3195 2015-05-12 17:22:19Z emaste $ +.\" $Id: ranlib.1 3642 2018-10-14 14:24:28Z jkoshy $ .\" .Dd December 9, 2012 -.Os .Dt RANLIB 1 +.Os .Sh NAME .Nm ranlib .Nd update archive symbol tables diff --git a/contrib/elftoolchain/ar/read.c b/contrib/elftoolchain/ar/read.c index 08b3224db17e..0aea381478b9 100644 --- a/contrib/elftoolchain/ar/read.c +++ b/contrib/elftoolchain/ar/read.c @@ -34,16 +34,20 @@ #include #include #include +#include #include #include "ar.h" -ELFTC_VCSID("$Id: read.c 3180 2015-04-09 15:13:57Z emaste $"); +ELFTC_VCSID("$Id: read.c 3629 2018-09-30 19:26:28Z jkoshy $"); /* * Handle read modes: 'x', 't' and 'p'. + * + * Returns EXIT_SUCCESS if all operations completed successfully or returns + * EXIT_FAILURE otherwise. */ -void +int ar_read_archive(struct bsdar *bsdar, int mode) { FILE *out; @@ -60,8 +64,8 @@ ar_read_archive(struct bsdar *bsdar, int mode) gid_t gid; char **av; char buf[25]; - char find; - int i, flags, r; + int found; + int exitcode, i, flags, r; assert(mode == 'p' || mode == 't' || mode == 'x'); @@ -70,6 +74,7 @@ ar_read_archive(struct bsdar *bsdar, int mode) archive_read_support_format_ar(a); AC(archive_read_open_filename(a, bsdar->filename, DEF_BLKSZ)); + exitcode = EXIT_SUCCESS; out = bsdar->output; for (;;) { @@ -96,12 +101,27 @@ ar_read_archive(struct bsdar *bsdar, int mode) if (bsdar_is_pseudomember(bsdar, name)) continue; + /* The ar(5) format only supports 'leaf' file names. */ + if (strchr(name, '/')) { + bsdar_warnc(bsdar, 0, "ignoring entry: %s", + name); + continue; + } + + /* + * If we had been given a list of file names to process, check + * that the current entry is present in this list. + */ if (bsdar->argc > 0) { - find = 0; + found = 0; for(i = 0; i < bsdar->argc; i++) { av = &bsdar->argv[i]; if (*av == NULL) continue; + /* + * Per POSIX, only the basename of a file + * argument should be compared. + */ if ((bname = basename(*av)) == NULL) bsdar_errc(bsdar, errno, "basename failed"); @@ -109,10 +129,10 @@ ar_read_archive(struct bsdar *bsdar, int mode) continue; *av = NULL; - find = 1; + found = 1; break; } - if (!find) + if (!found) continue; } @@ -157,7 +177,7 @@ ar_read_archive(struct bsdar *bsdar, int mode) /* mode == 'x' */ if (stat(name, &sb) != 0) { if (errno != ENOENT) { - bsdar_warnc(bsdar, 0, + bsdar_warnc(bsdar, errno, "stat %s failed", bsdar->filename); continue; @@ -174,12 +194,6 @@ ar_read_archive(struct bsdar *bsdar, int mode) if (bsdar->options & AR_V) (void)fprintf(out, "x - %s\n", name); - /* Disallow absolute paths. */ - if (name[0] == '/') { - bsdar_warnc(bsdar, 0, - "Absolute path '%s'", name); - continue; - } /* Basic path security flags. */ flags = ARCHIVE_EXTRACT_SECURE_SYMLINKS | ARCHIVE_EXTRACT_SECURE_NODOTDOT; @@ -189,11 +203,19 @@ ar_read_archive(struct bsdar *bsdar, int mode) r = archive_read_extract(a, entry, flags); } - if (r) + if (r) { bsdar_warnc(bsdar, 0, "%s", archive_error_string(a)); + exitcode = EXIT_FAILURE; + } } } + + if (r == ARCHIVE_FATAL) + exitcode = EXIT_FAILURE; + AC(archive_read_close(a)); ACV(archive_read_free(a)); + + return (exitcode); } diff --git a/contrib/elftoolchain/ar/write.c b/contrib/elftoolchain/ar/write.c index 90be5da11937..a522d66feff9 100644 --- a/contrib/elftoolchain/ar/write.c +++ b/contrib/elftoolchain/ar/write.c @@ -40,7 +40,7 @@ #include "ar.h" -ELFTC_VCSID("$Id: write.c 3183 2015-04-10 16:18:42Z emaste $"); +ELFTC_VCSID("$Id: write.c 3629 2018-09-30 19:26:28Z jkoshy $"); #define _ARMAG_LEN 8 /* length of the magic string */ #define _ARHDR_LEN 60 /* length of the archive header */ @@ -352,17 +352,20 @@ read_objs(struct bsdar *bsdar, const char *archive, int checkargv) /* * Write an archive. + * + * Returns EXIT_SUCCESS if the write succeeded or EXIT_FAILURE otherwise. */ -void +int ar_write_archive(struct bsdar *bsdar, int mode) { struct ar_obj *nobj, *obj, *obj_temp, *pos; struct stat sb; const char *bname; char **av; - int i; + int exitcode, i; TAILQ_INIT(&bsdar->v_obj); + exitcode = EXIT_SUCCESS; nobj = NULL; pos = NULL; memset(&sb, 0, sizeof(sb)); @@ -376,16 +379,16 @@ ar_write_archive(struct bsdar *bsdar, int mode) */ if (stat(bsdar->filename, &sb) != 0) { if (errno != ENOENT) { - bsdar_warnc(bsdar, 0, "stat %s failed", + bsdar_warnc(bsdar, errno, "stat %s failed", bsdar->filename); - return; + return (EXIT_FAILURE); } /* We do not create archive in mode 'd', 'm' and 's'. */ if (mode != 'r' && mode != 'q') { bsdar_warnc(bsdar, 0, "%s: no such file", bsdar->filename); - return; + return (EXIT_FAILURE); } /* Issue a message if the '-c' option was not specified. */ @@ -474,8 +477,10 @@ ar_write_archive(struct bsdar *bsdar, int mode) */ nobj = create_obj_from_file(bsdar, *av, obj->mtime); - if (nobj == NULL) + if (nobj == NULL) { + exitcode = EXIT_FAILURE; goto skip_obj; + } } if (bsdar->options & AR_V) @@ -510,9 +515,13 @@ ar_write_archive(struct bsdar *bsdar, int mode) av = &bsdar->argv[i]; if (*av != NULL && (mode == 'r' || mode == 'q')) { nobj = create_obj_from_file(bsdar, *av, 0); - if (nobj != NULL) - insert_obj(bsdar, nobj, pos); - if (bsdar->options & AR_V && nobj != NULL) + if (nobj == NULL) { + exitcode = EXIT_FAILURE; + *av = NULL; + continue; + } + insert_obj(bsdar, nobj, pos); + if (bsdar->options & AR_V) (void)fprintf(bsdar->output, "a - %s\n", *av); *av = NULL; } @@ -521,6 +530,8 @@ ar_write_archive(struct bsdar *bsdar, int mode) write_objs: write_objs(bsdar); write_cleanup(bsdar); + + return (exitcode); } /* diff --git a/contrib/elftoolchain/common/native-elf-format b/contrib/elftoolchain/common/native-elf-format index 2bdd914c3052..f29bcb16716b 100755 --- a/contrib/elftoolchain/common/native-elf-format +++ b/contrib/elftoolchain/common/native-elf-format @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: native-elf-format 3293 2016-01-07 19:26:27Z emaste $ +# $Id: native-elf-format 3650 2018-11-25 12:06:28Z jkoshy $ # # Find the native ELF format for a host platform by compiling a # test object and examining the resulting object. @@ -35,7 +35,7 @@ $1 ~ "Machine:" { elfarch = "EM_386"; } else if (match($0, "MIPS")) { elfarch = "EM_MIPS"; - } else if (match($0, ".*[xX]86-64")) { + } else if (match($0, ".*[xX]86[-_]64")) { elfarch = "EM_X86_64"; } else { elfarch = "unknown"; diff --git a/contrib/elftoolchain/cxxfilt/c++filt.1 b/contrib/elftoolchain/cxxfilt/c++filt.1 index b191b44e8215..a473bc38e52c 100644 --- a/contrib/elftoolchain/cxxfilt/c++filt.1 +++ b/contrib/elftoolchain/cxxfilt/c++filt.1 @@ -22,11 +22,11 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Id: c++filt.1 3195 2015-05-12 17:22:19Z emaste $ +.\" $Id: c++filt.1 3642 2018-10-14 14:24:28Z jkoshy $ .\" .Dd August 24, 2011 -.Os .Dt C++FILT 1 +.Os .Sh NAME .Nm c++filt .Nd decode C++ symbols diff --git a/contrib/elftoolchain/elfcopy/elfcopy.1 b/contrib/elftoolchain/elfcopy/elfcopy.1 index a71451056aa3..89d694f46b4e 100644 --- a/contrib/elftoolchain/elfcopy/elfcopy.1 +++ b/contrib/elftoolchain/elfcopy/elfcopy.1 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elfcopy.1 3565 2017-08-31 02:24:19Z emaste $ +.\" $Id: elfcopy.1 3642 2018-10-14 14:24:28Z jkoshy $ .\" .Dd August 30, 2017 -.Os .Dt ELFCOPY 1 +.Os .Sh NAME .Nm elfcopy , .Nm objcopy diff --git a/contrib/elftoolchain/elfcopy/elfcopy.h b/contrib/elftoolchain/elfcopy/elfcopy.h index c152588e86d9..a6578113fe55 100644 --- a/contrib/elftoolchain/elfcopy/elfcopy.h +++ b/contrib/elftoolchain/elfcopy/elfcopy.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elfcopy.h 3446 2016-05-03 01:31:17Z emaste $ + * $Id: elfcopy.h 3615 2018-05-17 04:12:24Z kaiwang27 $ */ #include diff --git a/contrib/elftoolchain/elfcopy/mcs.1 b/contrib/elftoolchain/elfcopy/mcs.1 index edbafb7b88a7..890154c19d33 100644 --- a/contrib/elftoolchain/elfcopy/mcs.1 +++ b/contrib/elftoolchain/elfcopy/mcs.1 @@ -21,11 +21,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: mcs.1 2247 2011-11-29 08:41:34Z jkoshy $ +.\" $Id: mcs.1 3642 2018-10-14 14:24:28Z jkoshy $ .\" .Dd November 29, 2011 -.Os .Dt MCS 1 +.Os .Sh NAME .Nm mcs .Nd manipulate the comment section of an ELF object diff --git a/contrib/elftoolchain/elfcopy/sections.c b/contrib/elftoolchain/elfcopy/sections.c index 82c47f4f9a8b..f8134f944615 100644 --- a/contrib/elftoolchain/elfcopy/sections.c +++ b/contrib/elftoolchain/elfcopy/sections.c @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: sections.c 3443 2016-04-15 18:57:54Z kaiwang27 $"); +ELFTC_VCSID("$Id: sections.c 3646 2018-10-27 02:25:39Z emaste $"); static void add_gnu_debuglink(struct elfcopy *ecp); static uint32_t calc_crc32(const char *p, size_t len, uint32_t crc); diff --git a/contrib/elftoolchain/elfcopy/segments.c b/contrib/elftoolchain/elfcopy/segments.c index 27d5e7a3b6d9..9030248f8d85 100644 --- a/contrib/elftoolchain/elfcopy/segments.c +++ b/contrib/elftoolchain/elfcopy/segments.c @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: segments.c 3449 2016-05-03 13:59:29Z emaste $"); +ELFTC_VCSID("$Id: segments.c 3615 2018-05-17 04:12:24Z kaiwang27 $"); static void insert_to_inseg_list(struct segment *seg, struct section *sec); diff --git a/contrib/elftoolchain/elfcopy/strip.1 b/contrib/elftoolchain/elfcopy/strip.1 index e07affbb9440..b1633a51693b 100644 --- a/contrib/elftoolchain/elfcopy/strip.1 +++ b/contrib/elftoolchain/elfcopy/strip.1 @@ -21,11 +21,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: strip.1 2069 2011-10-26 15:53:48Z jkoshy $ +.\" $Id: strip.1 3642 2018-10-14 14:24:28Z jkoshy $ .\" .Dd September 17, 2011 -.Os .Dt STRIP 1 +.Os .Sh NAME .Nm strip .Nd discard information from ELF objects diff --git a/contrib/elftoolchain/libdwarf/dwarf.3 b/contrib/elftoolchain/libdwarf/dwarf.3 index 863bee6dcfdf..182b04f7685b 100644 --- a/contrib/elftoolchain/libdwarf/dwarf.3 +++ b/contrib/elftoolchain/libdwarf/dwarf.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: dwarf.3 3295 2016-01-08 22:08:10Z jkoshy $ +.\" $Id: dwarf.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd December 21, 2014 -.Os .Dt DWARF 3 +.Os .Sh NAME .Nm dwarf .Nd access debugging information in object files @@ -34,7 +34,6 @@ .Sh SYNOPSIS .In libdwarf.h .Sh DESCRIPTION -.Pp The .Lb libdwarf provides functions that allow an application to read and write debugging @@ -129,7 +128,6 @@ A descriptor representing a static variable. A descriptor representing a weak name. .El .Ss Error Handling -.Pp Library functions that encounter an error will return with a value other than .Dv DW_DLV_OK . @@ -173,7 +171,7 @@ below. .Pp .Bl -tag -compact -width "CCCC" .It Abbreviations -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn dwarf_get_abbrev Retrieve abbreviation information at a given offset. .It Fn dwarf_get_abbrev_children_flag @@ -187,7 +185,7 @@ descriptor. Retrieve the tag for an abbreviation entry. .El .It Addresses -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn dwarf_get_address_size Return the number of bytes needed to represent an address. .It Fn dwarf_get_arange @@ -206,7 +204,7 @@ Retrieve information about non-contiguous address ranges for a debugging information entry. .El .It Attributes -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn dwarf_arrayorder Retrieve the value of a .Dv DW_AT_ordering @@ -279,7 +277,7 @@ Retrieve the attribute code for an attribute. Retrieve the form of an attribute. .El .It Call Information Entries and Frame Descriptor Entries -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn dwarf_get_cie_index Retrieve the index for a CIE descriptor. .It Fn dwarf_get_cie_info @@ -308,7 +306,7 @@ Retrieve an FDE descriptor. Retrieve range information from an FDE descriptor. .El .It Compilation Units -.Bl -tag -compact +.Bl -tag -compact -width indent .It Xo .Fn dwarf_get_cu_die_offset_given_cu_header_offset , .Fn dwarf_get_cu_die_offset_given_cu_header_offset_b @@ -323,7 +321,7 @@ compilation or type unit. Step through compilation units in a debug context. .El .It Debugging Information Entries -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn dwarf_child Returns the child of a debugging information entry. .It Fn dwarf_die_abbrev_code @@ -353,7 +351,7 @@ entry. Retrieve the tag for a debugging information entry. .El .It Functions -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn dwarf_func_cu_offset Retrieves the offset for the compilation unit for a function. .It Fn dwarf_func_die_offset @@ -367,7 +365,7 @@ Retrieve both the name and offsets for a function. Retrieve information about static functions. .El .It Globals -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn dwarf_get_globals Retrieve a list of globals. .It Fn dwarf_global_cu_offset @@ -396,7 +394,7 @@ and allow an application to specify alternate low-level file access routines. .It Line Numbers -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn dwarf_lineaddr Retrieve the program address for a source line. .It Fn dwarf_linebeginstatement @@ -420,7 +418,7 @@ Retrieve source files for a compilation unit. Return line number information for a compilation unit. .El .It Location Lists -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn dwarf_get_loclist_entry Retrieve a location list entry. .It Fn dwarf_loclist , Fn dwarf_loclist_n @@ -433,7 +431,7 @@ Retrieve location expressions. Translate a location expression into a location descriptor. .El .It Error Handling -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn dwarf_errmsg Retrieve a human-readable error message. .It Fn dwarf_errno @@ -444,7 +442,7 @@ Set the argument passed to a callback error handler. Set the callback handler to be called in case of an error. .El .It Frame Handling -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn dwarf_expand_frame_instructions Translate frame instruction bytes. .It Fn dwarf_set_frame_cfa_value @@ -464,7 +462,7 @@ Set the register number representing the rule. .El .It Macros -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn dwarf_find_macro_value_start Return the macro value part of a macro string. .It Fn dwarf_get_macro_details @@ -523,7 +521,7 @@ for DWARF constants: and .Fn dwarf_get_VIS_name . .It Types -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn dwarf_get_pubtypes , Fn dwarf_get_types Retrieve descriptors for user-defined types. .It Fn dwarf_next_types_section @@ -540,7 +538,7 @@ Retrieve the name of a type. Retrieve the name and offsets for a type. .El .It Variables -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn dwarf_get_vars Retrieve descriptors for static variables. .It Fn dwarf_var_cu_offset @@ -553,7 +551,7 @@ Retrieve the name of a variable. Retrieve the name and offsets for a variable. .El .It Weak Symbols -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn dwarf_get_weaks Retrieve information about weak symbols. .It Fn dwarf_weak_cu_offset @@ -566,7 +564,7 @@ Retrieve the name of a weak symbol. Retrieve the name and offsets for a weak symbol. .El .It Miscellaneous -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn dwarf_get_elf Retrieve the ELF descriptor for a debug context, see .Xr elf 3 . @@ -605,7 +603,7 @@ information entry: and .Fn dwarf_add_AT_unsigned_const . .It Debugging Information Entry Management -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn dwarf_add_die_to_debug Set the root debugging information entry for a DWARF producer instance. .It Fn dwarf_die_link @@ -623,7 +621,7 @@ are used to initialize a producer instance. When done, applications release resources using the function .Fn dwarf_producer_finish . .It Relocations and Sections -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn dwarf_get_relocation_info Retrieve a relocation array from a producer instance. .It Fn dwarf_get_relocation_info_count @@ -636,7 +634,7 @@ Reset internal state for a producer instance. Prepare byte streams for writing out. .El .It Macros -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn dwarf_def_macro Add a macro definition. .It Fn dwarf_end_macro_file , Fn dwarf_start_macro_file @@ -647,7 +645,7 @@ Note the removal of a macro definition. Enables storing macro information as specified in the DWARF standard. .El .It Symbols, Expressions, Addresses and Offsets -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn dwarf_add_arange , Fn dwarf_add_arange_b Add address range information. .It Fn dwarf_add_directory_decl @@ -741,7 +739,9 @@ The DWARF(3) API originated at Silicon Graphics Inc. .Pp A BSD-licensed implementation of a subset of the API was written by .An John Birrell Aq Mt jb@FreeBSD.org -for the FreeBSD project. +for the +.Fx +project. The implementation was subsequently revised and completed by .An Kai Wang Aq Mt kaiwang27@users.sourceforge.net . .Pp diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_AT_comp_dir.3 b/contrib/elftoolchain/libdwarf/dwarf_add_AT_comp_dir.3 index 875e13d931db..4477a29476d4 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_AT_comp_dir.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_AT_comp_dir.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_AT_comp_dir.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_AT_comp_dir.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 4, 2011 -.Os .Dt DWARF_ADD_AT_COMP_DIR 3 +.Os .Sh NAME .Nm dwarf_add_AT_comp_dir .Nd create and attach a DW_AT_comp_dir attribute diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_AT_const_value_string.3 b/contrib/elftoolchain/libdwarf/dwarf_add_AT_const_value_string.3 index d6177482c2ad..6baaf2087e2e 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_AT_const_value_string.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_AT_const_value_string.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_AT_const_value_string.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_AT_const_value_string.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 4, 2011 -.Os .Dt DWARF_ADD_AT_CONST_VALUE_STRING 3 +.Os .Sh NAME .Nm dwarf_add_AT_const_value_signedint , .Nm dwarf_add_AT_const_value_string , diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_AT_dataref.3 b/contrib/elftoolchain/libdwarf/dwarf_add_AT_dataref.3 index 29a09e06c1ad..22f753225d77 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_AT_dataref.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_AT_dataref.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_AT_dataref.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_AT_dataref.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd September 4, 2011 -.Os .Dt DWARF_ADD_AT_DATAREF 3 +.Os .Sh NAME .Nm dwarf_add_AT_dataref .Nd create an attribute descriptor for a relocatable address @@ -113,8 +113,8 @@ function. .El .Sh SEE ALSO .Xr dwarf 3 , -.Xr dwarf_add_AT_reference 3 , .Xr dwarf_add_AT_ref_address 3 , +.Xr dwarf_add_AT_reference 3 , .Xr dwarf_add_AT_signed_const 3 , .Xr dwarf_add_AT_unsigned_const 3 , .Xr dwarf_new_die 3 , diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_AT_flag.3 b/contrib/elftoolchain/libdwarf/dwarf_add_AT_flag.3 index 19b345ecd5c1..ad56714ba333 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_AT_flag.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_AT_flag.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_AT_flag.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_AT_flag.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 4, 2011 -.Os .Dt DWARF_ADD_AT_FLAG 3 +.Os .Sh NAME .Nm dwarf_add_AT_flag .Nd create and attach a flag attribute diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_AT_location_expr.3 b/contrib/elftoolchain/libdwarf/dwarf_add_AT_location_expr.3 index 3c9327337855..6edfc59f4cc1 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_AT_location_expr.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_AT_location_expr.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_AT_location_expr.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_AT_location_expr.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 5, 2011 -.Os .Dt DWARF_ADD_AT_LOCATION_EXPR 3 +.Os .Sh NAME .Nm dwarf_add_AT_location_expr .Nd create an attribute descriptor for a location expression diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_AT_name.3 b/contrib/elftoolchain/libdwarf/dwarf_add_AT_name.3 index d5ee761c86f9..352e8bf79222 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_AT_name.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_AT_name.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_AT_name.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_AT_name.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 4, 2011 -.Os .Dt DWARF_ADD_AT_NAME 3 +.Os .Sh NAME .Nm dwarf_add_AT_name .Nd create and attach a DW_AT_name attribute diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_AT_producer.3 b/contrib/elftoolchain/libdwarf/dwarf_add_AT_producer.3 index ae0b088579a4..3aa270d59489 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_AT_producer.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_AT_producer.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_AT_producer.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_AT_producer.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 4, 2011 -.Os .Dt DWARF_ADD_AT_PRODUCER 3 +.Os .Sh NAME .Nm dwarf_add_AT_producer .Nd create and attach a DW_AT_producer attribute diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_AT_ref_address.3 b/contrib/elftoolchain/libdwarf/dwarf_add_AT_ref_address.3 index 8b2efc8f8f62..a255167e6431 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_AT_ref_address.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_AT_ref_address.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_AT_ref_address.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_AT_ref_address.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 7, 2011 -.Os .Dt DWARF_ADD_AT_REF_ADDRESS 3 +.Os .Sh NAME .Nm dwarf_add_AT_ref_address .Nd create a reference class attribute descriptor diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_AT_reference.3 b/contrib/elftoolchain/libdwarf/dwarf_add_AT_reference.3 index 4f6d51a727c6..7b91b904ae4a 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_AT_reference.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_AT_reference.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_AT_reference.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_AT_reference.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 4, 2011 -.Os .Dt DWARF_ADD_AT_REFERENCE 3 +.Os .Sh NAME .Nm dwarf_add_AT_reference .Nd create and attach an attribute that references another DIE diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_AT_signed_const.3 b/contrib/elftoolchain/libdwarf/dwarf_add_AT_signed_const.3 index df7900ddb4b8..cff11d352a2e 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_AT_signed_const.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_AT_signed_const.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_AT_signed_const.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_AT_signed_const.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 4, 2011 -.Os .Dt DWARF_ADD_AT_SIGNED_CONST 3 +.Os .Sh NAME .Nm dwarf_add_AT_signed_const , .Nm dwarf_add_AT_unsigned_const diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_AT_string.3 b/contrib/elftoolchain/libdwarf/dwarf_add_AT_string.3 index a05a19d28946..d70bae4d5f3c 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_AT_string.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_AT_string.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_AT_string.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_AT_string.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 4, 2011 -.Os .Dt DWARF_ADD_AT_STRING 3 +.Os .Sh NAME .Nm dwarf_add_AT_string .Nd create and attach a string class attribute diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_AT_targ_address.3 b/contrib/elftoolchain/libdwarf/dwarf_add_AT_targ_address.3 index ce803c89c2bb..1e3798204543 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_AT_targ_address.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_AT_targ_address.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_AT_targ_address.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_AT_targ_address.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 4, 2011 -.Os .Dt DWARF_ADD_AT_TARG_ADDRESS 3 +.Os .Sh NAME .Nm dwarf_add_AT_targ_address , .Nm dwarf_add_AT_targ_address_b diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_arange.3 b/contrib/elftoolchain/libdwarf/dwarf_add_arange.3 index 90a088a9e4ff..84631bf36a78 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_arange.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_arange.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_arange.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_arange.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 18, 2011 -.Os .Dt DWARF_ADD_ARANGE 3 +.Os .Sh NAME .Nm dwarf_add_arange , .Nm dwarf_add_arange_b diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_die_to_debug.3 b/contrib/elftoolchain/libdwarf/dwarf_add_die_to_debug.3 index 5ea4e3f0a123..f89b4c8722f6 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_die_to_debug.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_die_to_debug.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_die_to_debug.3 2938 2013-04-27 05:09:17Z jkoshy $ +.\" $Id: dwarf_add_die_to_debug.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd August 21, 2011 -.Os .Dt DWARF_ADD_DIE_TO_DEBUG 3 +.Os .Sh NAME .Nm dwarf_add_die_to_debug .Nd set the root debugging information entry diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_directory_decl.3 b/contrib/elftoolchain/libdwarf/dwarf_add_directory_decl.3 index df1970762b94..2d91b0d813db 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_directory_decl.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_directory_decl.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_directory_decl.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_directory_decl.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 17, 2011 -.Os .Dt DWARF_ADD_DIRECTORY_DECL 3 +.Os .Sh NAME .Nm dwarf_add_directory_decl .Nd add a directory name to a producer instance diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_expr_addr.3 b/contrib/elftoolchain/libdwarf/dwarf_add_expr_addr.3 index 4a19ee8aae86..959ad3c70800 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_expr_addr.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_expr_addr.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_expr_addr.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_expr_addr.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 9, 2011 -.Os .Dt DWARF_ADD_EXPR_ADDR 3 +.Os .Sh NAME .Nm dwarf_add_expr_addr , .Nm dwarf_add_expr_addr_b diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_expr_gen.3 b/contrib/elftoolchain/libdwarf/dwarf_add_expr_gen.3 index 71f297704536..0c68935b90ce 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_expr_gen.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_expr_gen.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_expr_gen.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_expr_gen.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 9, 2011 -.Os .Dt DWARF_ADD_EXPR_GEN 3 +.Os .Sh NAME .Nm dwarf_add_expr_gen .Nd add an operator to a location expression descriptor diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_fde_inst.3 b/contrib/elftoolchain/libdwarf/dwarf_add_fde_inst.3 index d2d91570be13..e138962b1778 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_fde_inst.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_fde_inst.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_fde_inst.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_fde_inst.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd September 26, 2011 -.Os .Dt DWARF_ADD_FDE_INST 3 +.Os .Sh NAME .Nm dwarf_add_fde_inst .Nd add a call frame instruction to a DWARF frame descriptor @@ -101,9 +101,9 @@ function. .El .Sh SEE ALSO .Xr dwarf 3 , +.Xr dwarf_add_frame_cie 3 , .Xr dwarf_add_frame_fde 3 , .Xr dwarf_add_frame_fde_b 3 , -.Xr dwarf_add_frame_cie 3 , .Xr dwarf_fde_cfa_offset 3 , .Xr dwarf_new_fde 3 .Rs diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_file_decl.3 b/contrib/elftoolchain/libdwarf/dwarf_add_file_decl.3 index c389484242d4..960253265834 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_file_decl.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_file_decl.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_file_decl.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_file_decl.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 17, 2011 -.Os .Dt DWARF_ADD_FILE_DECL 3 +.Os .Sh NAME .Nm dwarf_add_file_decl .Nd add a source file entry to a producer instance diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_frame_cie.3 b/contrib/elftoolchain/libdwarf/dwarf_add_frame_cie.3 index 1bc6db571f45..ba9d2c8dea9c 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_frame_cie.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_frame_cie.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_frame_cie.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_frame_cie.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 26, 2011 -.Os .Dt DWARF_ADD_FRAME_CIE 3 +.Os .Sh NAME .Nm dwarf_add_frame_cie .Nd add a call frame common information entry to a DWARF producer instance diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_frame_fde.3 b/contrib/elftoolchain/libdwarf/dwarf_add_frame_fde.3 index 3c1ee11ea20e..b4358e42cbd9 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_frame_fde.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_frame_fde.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_frame_fde.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_frame_fde.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 26, 2011 -.Os .Dt DWARF_ADD_FRAME_FDE 3 +.Os .Sh NAME .Nm dwarf_add_frame_fde .Nd add a call frame descriptor to a DWARF producer instance diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_funcname.3 b/contrib/elftoolchain/libdwarf/dwarf_add_funcname.3 index ebc358c4fe35..7d8c2f307686 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_funcname.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_funcname.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_funcname.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_funcname.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 24, 2011 -.Os .Dt DWARF_ADD_FUNCNAME 3 +.Os .Sh NAME .Nm dwarf_add_funcname .Nd add information about a static function to a DWARF producer instance diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_line_entry.3 b/contrib/elftoolchain/libdwarf/dwarf_add_line_entry.3 index 16e807512a44..4d7c5a982777 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_line_entry.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_line_entry.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_line_entry.3 3182 2015-04-10 16:08:10Z emaste $ +.\" $Id: dwarf_add_line_entry.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd June 30, 2013 -.Os .Dt DWARF_ADD_LINE_ENTRY 3 +.Os .Sh NAME .Nm dwarf_add_line_entry .Nd add a line number information entry to a producer instance @@ -109,24 +109,7 @@ returns .Dv DW_DLV_NOCOUNT and sets the argument .Ar err . -.Sh ERRORS -Function -.Fn dwarf_add_line_entry -can fail with: -.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" -.It Bq Er DW_DLE_ARGUMENT -Argument -.Ar dbg -was NULL. -.It Bq Er DW_DLE_ARGUMENT -The function -.Xr dwarf_lne_set_address 3 -was not called before calling this function. -.It Bq Er DW_DLE_MEMORY -An out of memory condition was encountered during the execution of the -function. -.El -.Sh EXAMPLE +.Sh EXAMPLES To add line number information to the producer instance, use: .Bd -literal -offset indent Dwarf_P_Debug dbg; @@ -154,6 +137,23 @@ if (dwarf_add_line_entry(dbg, filendx, 10, 258, 0, 1, 1, &de) != errx(EXIT_FAILURE, "dwarf_add_line_entry failed: %s", dwarf_errmsg(-1)); .Ed +.Sh ERRORS +Function +.Fn dwarf_add_line_entry +can fail with: +.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" +.It Bq Er DW_DLE_ARGUMENT +Argument +.Ar dbg +was NULL. +.It Bq Er DW_DLE_ARGUMENT +The function +.Xr dwarf_lne_set_address 3 +was not called before calling this function. +.It Bq Er DW_DLE_MEMORY +An out of memory condition was encountered during the execution of the +function. +.El .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_add_directory_decl 3 , diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_pubname.3 b/contrib/elftoolchain/libdwarf/dwarf_add_pubname.3 index 8839178da0fd..3b133c6e4074 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_pubname.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_pubname.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_pubname.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_pubname.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 24, 2011 -.Os .Dt DWARF_ADD_PUBNAME 3 +.Os .Sh NAME .Nm dwarf_add_pubname .Nd add information about a global object to a DWARF producer instance diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_typename.3 b/contrib/elftoolchain/libdwarf/dwarf_add_typename.3 index 22a2b0626988..8b0ccb5a1cf7 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_typename.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_typename.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_typename.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_typename.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 24, 2011 -.Os .Dt DWARF_ADD_TYPENAME 3 +.Os .Sh NAME .Nm dwarf_add_typename .Nd add information about a user-defined type to a DWARF producer instance diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_varname.3 b/contrib/elftoolchain/libdwarf/dwarf_add_varname.3 index efcb0d3c1960..10c22d49f677 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_varname.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_varname.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_varname.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_varname.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 24, 2011 -.Os .Dt DWARF_ADD_VARNAME 3 +.Os .Sh NAME .Nm dwarf_add_varname .Nd add information about a static variable to a DWARF producer instance diff --git a/contrib/elftoolchain/libdwarf/dwarf_add_weakname.3 b/contrib/elftoolchain/libdwarf/dwarf_add_weakname.3 index ac1ecbdca285..503f35c72fa3 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_add_weakname.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_add_weakname.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_weakname.3 2072 2011-10-27 03:26:49Z jkoshy $ +.\" $Id: dwarf_add_weakname.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 24, 2011 -.Os .Dt DWARF_ADD_WEAKNAME 3 +.Os .Sh NAME .Nm dwarf_add_weakname .Nd add information about a weak object to a DWARF producer instance diff --git a/contrib/elftoolchain/libdwarf/dwarf_attr.3 b/contrib/elftoolchain/libdwarf/dwarf_attr.3 index 9ba367be5f69..ac745fd2fb7a 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_attr.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_attr.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_attr.3 3093 2014-09-02 22:09:40Z kaiwang27 $ +.\" $Id: dwarf_attr.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd April 8, 2010 -.Os .Dt DWARF_ATTR 3 +.Os .Sh NAME .Nm dwarf_attr .Nd retrieve an attribute descriptor associated with a DWARF debugging information entry @@ -80,7 +80,8 @@ of an error. Function .Fn dwarf_attr returns -.Dv DW_DLV_OK on success. +.Dv DW_DLV_OK +on success. .Pp If the debugging information entry descriptor denoted by argument .Ar die diff --git a/contrib/elftoolchain/libdwarf/dwarf_attrlist.3 b/contrib/elftoolchain/libdwarf/dwarf_attrlist.3 index 0cb918df4f19..e932cc5675cd 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_attrlist.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_attrlist.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_attrlist.3 2122 2011-11-09 15:35:14Z jkoshy $ +.\" $Id: dwarf_attrlist.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd November 9, 2011 -.Os .Dt DWARF_ATTRLIST 3 +.Os .Sh NAME .Nm dwarf_attrlist .Nd retrieve DWARF attribute descriptors @@ -82,7 +82,8 @@ function. Function .Fn dwarf_attrlist returns -.Dv DW_DLV_OK on success. +.Dv DW_DLV_OK +on success. .Pp If the debugging information entry descriptor denoted by argument .Ar die diff --git a/contrib/elftoolchain/libdwarf/dwarf_attroffset.3 b/contrib/elftoolchain/libdwarf/dwarf_attroffset.3 index af24cebab8e9..e592edf14f63 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_attroffset.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_attroffset.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_attroffset.3 3115 2014-12-20 18:26:46Z jkoshy $ +.\" $Id: dwarf_attroffset.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd December 20, 2014 -.Os .Dt DWARF_ATTROFFSET 3 +.Os .Sh NAME .Nm dwarf_attroffset .Nd retrieve the section-relative offset of an attribute descriptor diff --git a/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 b/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 index c9416bc050bc..7bfc9841e2f9 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_attrval_signed.3 3509 2016-12-29 03:58:41Z emaste $ +.\" $Id: dwarf_attrval_signed.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd December 26, 2016 -.Os .Dt DWARF_ATTRVAL_SIGNED 3 +.Os .Sh NAME .Nm dwarf_attrval_flag , .Nm dwarf_attrval_signed , diff --git a/contrib/elftoolchain/libdwarf/dwarf_child.3 b/contrib/elftoolchain/libdwarf/dwarf_child.3 index 1e32e58d4451..c537293ff701 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_child.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_child.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_child.3 3127 2014-12-21 19:09:19Z jkoshy $ +.\" $Id: dwarf_child.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd December 21, 2014 -.Os .Dt DWARF_CHILD 3 +.Os .Sh NAME .Nm dwarf_child , .Nm dwarf_offdie , @@ -215,27 +215,6 @@ there was no debugging information entry at the offset specified by argument .Ar offset . .El -.Sh ERRORS -These functions may fail with the following errors: -.Bl -tag -width ".Bq Er DW_DLE_DIE_NO_CU_CONTEXT" -.It Bq Er DW_DLE_ARGUMENT -Arguments -.Ar dbg , -.Ar die -or -.Ar ret_die -were NULL. -.It Bq Er DW_DLE_DIE_NO_CU_CONTEXT -Argument -.Ar dbg -was not associated with a compilation unit. -.It Bq Er DW_DLE_NO_ENTRY -The descriptor denoted by argument -.Ar die -had no child or sibling, or there was no DWARF debugging information -entry at the offset specified by argument -.Va offset . -.El .Sh EXAMPLES To retrieve the first DWARF Debugging Information Entry descriptor for the first compilation unit associated with a @@ -271,8 +250,29 @@ do { dwarf_errmsg(de)); } while (die0 != NULL); .Ed +.Sh ERRORS +These functions may fail with the following errors: +.Bl -tag -width ".Bq Er DW_DLE_DIE_NO_CU_CONTEXT" +.It Bq Er DW_DLE_ARGUMENT +Arguments +.Ar dbg , +.Ar die +or +.Ar ret_die +were NULL. +.It Bq Er DW_DLE_DIE_NO_CU_CONTEXT +Argument +.Ar dbg +was not associated with a compilation unit. +.It Bq Er DW_DLE_NO_ENTRY +The descriptor denoted by argument +.Ar die +had no child or sibling, or there was no DWARF debugging information +entry at the offset specified by argument +.Va offset . +.El .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_errmsg 3 , -.Xr dwarf_get_die_infotypes_flag.3 , +.Xr dwarf_get_die_infotypes_flag 3 , .Xr dwarf_next_cu_header 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_dealloc.3 b/contrib/elftoolchain/libdwarf/dwarf_dealloc.3 index 51d355b6afde..5a7f875abb65 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_dealloc.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_dealloc.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: dwarf_dealloc.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_dealloc.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd July 23, 2011 -.Os .Dt DWARF_DEALLOC 3 +.Os .Sh NAME .Nm dwarf_dealloc , .Nm dwarf_fde_cie_list_dealloc , diff --git a/contrib/elftoolchain/libdwarf/dwarf_def_macro.3 b/contrib/elftoolchain/libdwarf/dwarf_def_macro.3 index daa090f29f0a..6d3018f3fc20 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_def_macro.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_def_macro.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_def_macro.3 3182 2015-04-10 16:08:10Z emaste $ +.\" $Id: dwarf_def_macro.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd November 9, 2011 -.Os .Dt DWARF_DEF_MACRO 3 +.Os .Sh NAME .Nm dwarf_def_macro .Nd add a macro definition to a DWARF producer instance @@ -91,7 +91,7 @@ returns .Dv DW_DLV_ERROR and sets the argument .Ar err . -.Sh EXAMPLE +.Sh EXAMPLES To record the fact that a macro named .Dv _STDIO_H_ was defined at line 20 of the current macro file, use: diff --git a/contrib/elftoolchain/libdwarf/dwarf_die_abbrev_code.3 b/contrib/elftoolchain/libdwarf/dwarf_die_abbrev_code.3 index 82caf3b81785..c296e135b880 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_die_abbrev_code.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_die_abbrev_code.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_die_abbrev_code.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_die_abbrev_code.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd April 14, 2010 -.Os .Dt DWARF_DIE_ABBREV_CODE 3 +.Os .Sh NAME .Nm dwarf_die_abbrev_code .Nd retrieve the abbreviation code for a DWARF debugging information entry diff --git a/contrib/elftoolchain/libdwarf/dwarf_die_link.3 b/contrib/elftoolchain/libdwarf/dwarf_die_link.3 index 89ddb5b41987..f251e8b945bc 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_die_link.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_die_link.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_die_link.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_die_link.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 4, 2011 -.Os .Dt DWARF_DIE_LINK 3 +.Os .Sh NAME .Nm dwarf_die_link .Nd link a debugging information entry diff --git a/contrib/elftoolchain/libdwarf/dwarf_diename.3 b/contrib/elftoolchain/libdwarf/dwarf_diename.3 index d9404dea3fe4..224bdcc9d264 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_diename.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_diename.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_diename.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_diename.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd March 31, 2010 -.Os .Dt DWARF_DIENAME 3 +.Os .Sh NAME .Nm dwarf_diename .Nd retrieve the name associated with a debugging information entry @@ -51,7 +51,8 @@ pointed to by argument Function .Fn dwarf_diename returns -.Dv DW_DLV_OK on success. +.Dv DW_DLV_OK +on success. .Pp If the debugging information entry descriptor denoted by argument .Ar die @@ -85,6 +86,6 @@ attribute. .El .Sh SEE ALSO .Xr dwarf 3 , -.Xr dwarf_tag 3 , +.Xr dwarf_die_abbrev_code 3 , .Xr dwarf_dieoffset 3 , -.Xr dwarf_die_abbrev_code 3 +.Xr dwarf_tag 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_dieoffset.3 b/contrib/elftoolchain/libdwarf/dwarf_dieoffset.3 index 00b0e71b8389..bc6276148917 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_dieoffset.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_dieoffset.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_dieoffset.3 3129 2014-12-21 20:06:26Z jkoshy $ +.\" $Id: dwarf_dieoffset.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd December 21, 2014 -.Os .Dt DWARF_DIEOFFSET 3 +.Os .Sh NAME .Nm dwarf_die_CU_offset , .Nm dwarf_die_CU_offset_range , diff --git a/contrib/elftoolchain/libdwarf/dwarf_end_macro_file.3 b/contrib/elftoolchain/libdwarf/dwarf_end_macro_file.3 index a4de18ce8d26..486fe1d180bc 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_end_macro_file.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_end_macro_file.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_end_macro_file.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_end_macro_file.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd September 25, 2011 -.Os .Dt DWARF_END_MACRO_FILE 3 +.Os .Sh NAME .Nm dwarf_end_macro_file .Nd mark the end of the current source file inclusion @@ -38,7 +38,6 @@ .Fo dwarf_end_macro_file .Fa "Dwarf_P_Debug dbg" .Fa "Dwarf_Error *err" -.Fa .Fc .Sh DESCRIPTION Function diff --git a/contrib/elftoolchain/libdwarf/dwarf_errmsg.3 b/contrib/elftoolchain/libdwarf/dwarf_errmsg.3 index 466c091f5db6..adbd2d8453df 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_errmsg.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_errmsg.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: dwarf_errmsg.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_errmsg.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd December 12, 2009 -.Os .Dt DWARF_ERRMSG 3 +.Os .Sh NAME .Nm dwarf_errmsg .Nd retrieve a human-readable string corresponding to a diff --git a/contrib/elftoolchain/libdwarf/dwarf_errno.3 b/contrib/elftoolchain/libdwarf/dwarf_errno.3 index 7e1a1ebfa2bf..cd7ddfccbbfe 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_errno.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_errno.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: dwarf_errno.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_errno.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd March 25, 2010 -.Os .Dt DWARF_ERRNO 3 +.Os .Sh NAME .Nm dwarf_errno .Nd retrieve the error number corresponding to a diff --git a/contrib/elftoolchain/libdwarf/dwarf_expand_frame_instructions.3 b/contrib/elftoolchain/libdwarf/dwarf_expand_frame_instructions.3 index 7bcd105f030f..b19912d5f723 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_expand_frame_instructions.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_expand_frame_instructions.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_expand_frame_instructions.3 3181 2015-04-10 13:22:51Z emaste $ +.\" $Id: dwarf_expand_frame_instructions.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd November 9, 2011 -.Os .Dt DWARF_EXPAND_FRAME_INSTRUCTIONS 3 +.Os .Sh NAME .Nm dwarf_expand_frame_instructions .Nd expand frame instructions @@ -104,32 +104,7 @@ In case of an error, it returns .Dv DW_DLV_ERROR and sets the argument .Ar err . -.Sh ERRORS -Function -.Fn dwarf_expand_frame_instructions -can fail with: -.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" -.It Bq Er DW_DLE_ARGUMENT -One of the arguments -.Ar cie , -.Ar instructions , -.Ar ret_ops -or -.Ar ret_opcnt -was NULL. -.It Bq Er DW_DLE_ARGUMENT -Argument -.Ar len -was 0. -.It Bq Er DW_DLE_MEMORY -An out of memory condition was encountered during the execution of -this function. -.It Bq Er DW_DLE_FRAME_INSTR_EXEC_ERROR -An unknown instruction was found in the instruction bytes provided -in argument -.Ar instructions . -.El -.Sh EXAMPLE +.Sh EXAMPLES To retrieve and expand the frame instructions for a given FDE descriptor, use: .Bd -literal -offset indent @@ -164,12 +139,37 @@ for (i = 0; i < opcnt; i++) { /* Free the memory area when no longer needed. */ dwarf_dealloc(dbg, ops, DW_DLA_FRAME_BLOCK); .Ed +.Sh ERRORS +Function +.Fn dwarf_expand_frame_instructions +can fail with: +.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" +.It Bq Er DW_DLE_ARGUMENT +One of the arguments +.Ar cie , +.Ar instructions , +.Ar ret_ops +or +.Ar ret_opcnt +was NULL. +.It Bq Er DW_DLE_ARGUMENT +Argument +.Ar len +was 0. +.It Bq Er DW_DLE_MEMORY +An out of memory condition was encountered during the execution of +this function. +.It Bq Er DW_DLE_FRAME_INSTR_EXEC_ERROR +An unknown instruction was found in the instruction bytes provided +in argument +.Ar instructions . +.El .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_frame_instructions_dealloc 3 , -.Xr dwarf_get_cie_info 3 , .Xr dwarf_get_cie_index 3 , -.Xr dwarf_get_cie_of_fde , +.Xr dwarf_get_cie_info 3 , +.Xr dwarf_get_cie_of_fde 3 , .Xr dwarf_get_fde_at_pc 3 , .Xr dwarf_get_fde_info_for_all_regs 3 , .Xr dwarf_get_fde_info_for_all_regs3 3 , diff --git a/contrib/elftoolchain/libdwarf/dwarf_expr_current_offset.3 b/contrib/elftoolchain/libdwarf/dwarf_expr_current_offset.3 index f22294e6c8d4..c1221c50bb44 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_expr_current_offset.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_expr_current_offset.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_expr_current_offset.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_expr_current_offset.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 13, 2011 -.Os .Dt DWARF_EXPR_CURRENT_OFFSET 3 +.Os .Sh NAME .Nm dwarf_expr_current_offset .Nd retrieve the number of bytes in a location expression stream diff --git a/contrib/elftoolchain/libdwarf/dwarf_expr_into_block.3 b/contrib/elftoolchain/libdwarf/dwarf_expr_into_block.3 index 69f1d9cad7a7..49aefb172f99 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_expr_into_block.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_expr_into_block.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_expr_into_block.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_expr_into_block.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 13, 2011 -.Os .Dt DWARF_EXPR_INTO_BLOCK 3 +.Os .Sh NAME .Nm dwarf_expr_into_block .Nd retrieve the byte stream for a location expression diff --git a/contrib/elftoolchain/libdwarf/dwarf_fde_cfa_offset.3 b/contrib/elftoolchain/libdwarf/dwarf_fde_cfa_offset.3 index 8150e78e5b42..c00ee9a84173 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_fde_cfa_offset.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_fde_cfa_offset.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_fde_cfa_offset.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_fde_cfa_offset.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd September 26, 2011 -.Os .Dt DWARF_FDE_CFA_OFFSET 3 +.Os .Sh NAME .Nm dwarf_fde_cfa_offset .Nd add a DW_CFA_offset frame instruction to a DWARF frame descriptor @@ -93,7 +93,7 @@ function. .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_add_fde_inst 3 , +.Xr dwarf_add_frame_cie 3 , .Xr dwarf_add_frame_fde 3 , .Xr dwarf_add_frame_fde_b 3 , -.Xr dwarf_add_frame_cie 3 , .Xr dwarf_new_fde 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_find_macro_value_start.3 b/contrib/elftoolchain/libdwarf/dwarf_find_macro_value_start.3 index ede0df9bd558..0902ccbf10e5 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_find_macro_value_start.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_find_macro_value_start.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_find_macro_value_start.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_find_macro_value_start.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd March 26, 2011 -.Os .Dt DWARF_FIND_MACRO_VALUE_START 3 +.Os .Sh NAME .Nm dwarf_find_macro_value_start .Nd return the address of the first byte of a macro value diff --git a/contrib/elftoolchain/libdwarf/dwarf_finish.3 b/contrib/elftoolchain/libdwarf/dwarf_finish.3 index a26bf9b9c59c..161acb0a25a4 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_finish.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_finish.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: dwarf_finish.3 2122 2011-11-09 15:35:14Z jkoshy $ +.\" $Id: dwarf_finish.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd November 9, 2011 -.Os .Dt DWARF_FINISH 3 +.Os .Sh NAME .Nm dwarf_finish , .Nm dwarf_object_finish @@ -133,8 +133,8 @@ if (dwarf_finish(dbg, &de) != DW_DLV_OK) (void) elf_end(e); .Ed .Sh SEE ALSO -.Xr elf_end 3 , .Xr dwarf_elf_init 3 , .Xr dwarf_get_elf 3 , .Xr dwarf_init 3 , -.Xr dwarf_object_init 3 +.Xr dwarf_object_init 3 , +.Xr elf_end 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_formaddr.3 b/contrib/elftoolchain/libdwarf/dwarf_formaddr.3 index 6b8c70d00342..a6bb85d0b885 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_formaddr.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_formaddr.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_formaddr.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_formaddr.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd July 23, 2010 -.Os .Dt DWARF_FORMADDR 3 +.Os .Sh NAME .Nm dwarf_formaddr .Nd return the value of an ADDRESS class attribute diff --git a/contrib/elftoolchain/libdwarf/dwarf_formblock.3 b/contrib/elftoolchain/libdwarf/dwarf_formblock.3 index 1ffb6e6fec0d..a3a8aae8bf53 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_formblock.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_formblock.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_formblock.3 3182 2015-04-10 16:08:10Z emaste $ +.\" $Id: dwarf_formblock.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd July 23, 2010 -.Os .Dt DWARF_FORMBLOCK 3 +.Os .Sh NAME .Nm dwarf_formblock .Nd return the value of a BLOCK attribute diff --git a/contrib/elftoolchain/libdwarf/dwarf_formexprloc.3 b/contrib/elftoolchain/libdwarf/dwarf_formexprloc.3 index 231ba3ac3bbf..278edcdfb6eb 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_formexprloc.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_formexprloc.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_formexprloc.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_formexprloc.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd July 25, 2010 -.Os .Dt DWARF_FORMEXPRLOC 3 +.Os .Sh NAME .Nm dwarf_formexprloc .Nd return information about a location expression diff --git a/contrib/elftoolchain/libdwarf/dwarf_formflag.3 b/contrib/elftoolchain/libdwarf/dwarf_formflag.3 index 2e23b3301661..29fa303e0953 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_formflag.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_formflag.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_formflag.3 3181 2015-04-10 13:22:51Z emaste $ +.\" $Id: dwarf_formflag.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd June 21, 2010 -.Os .Dt DWARF_FORMFLAG 3 +.Os .Sh NAME .Nm dwarf_formflag .Nd return the value of a BOOLEAN class attribute diff --git a/contrib/elftoolchain/libdwarf/dwarf_formref.3 b/contrib/elftoolchain/libdwarf/dwarf_formref.3 index abde30cfb9e4..9c6669cc43a4 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_formref.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_formref.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_formref.3 3181 2015-04-10 13:22:51Z emaste $ +.\" $Id: dwarf_formref.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd June 21, 2010 -.Os .Dt DWARF_FORMREF 3 +.Os .Sh NAME .Nm dwarf_formref , .Nm dwarf_global_formref diff --git a/contrib/elftoolchain/libdwarf/dwarf_formsig8.3 b/contrib/elftoolchain/libdwarf/dwarf_formsig8.3 index a76c1107d9eb..a2549a16f4d2 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_formsig8.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_formsig8.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_formsig8.3 3181 2015-04-10 13:22:51Z emaste $ +.\" $Id: dwarf_formsig8.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd July 24, 2010 -.Os .Dt DWARF_FORMSIG8 3 +.Os .Sh NAME .Nm dwarf_formsig8 .Nd return the 64-bit type signature for a DWARF type diff --git a/contrib/elftoolchain/libdwarf/dwarf_formstring.3 b/contrib/elftoolchain/libdwarf/dwarf_formstring.3 index 63e83f684be6..1da92f80e201 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_formstring.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_formstring.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_formstring.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_formstring.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd July 24, 2010 -.Os .Dt DWARF_FORMSTRING 3 +.Os .Sh NAME .Nm dwarf_formstring .Nd return the value of a STRING class attribute diff --git a/contrib/elftoolchain/libdwarf/dwarf_formudata.3 b/contrib/elftoolchain/libdwarf/dwarf_formudata.3 index 9ed154eebb97..ddcaeecbf581 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_formudata.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_formudata.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_formudata.3 3181 2015-04-10 13:22:51Z emaste $ +.\" $Id: dwarf_formudata.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd June 21, 2010 -.Os .Dt DWARF_FORMUDATA 3 +.Os .Sh NAME .Nm dwarf_formudata , .Nm dwarf_formsdata diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_AT_name.3 b/contrib/elftoolchain/libdwarf/dwarf_get_AT_name.3 index 473adc331f3f..f84202664557 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_AT_name.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_AT_name.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_AT_name.3 3142 2015-01-29 23:11:14Z jkoshy $ +.\" $Id: dwarf_get_AT_name.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd April 22, 2011 -.Os .Dt DWARF_GET_AT_NAME 3 +.Os .Sh NAME .Nm dwarf_get_ACCESS_name , .Nm dwarf_get_AT_name , @@ -250,7 +250,8 @@ constants. .El .Sh RETURN VALUES These functions return -.Dv DW_DLV_OK on success. +.Dv DW_DLV_OK +on success. If the DWARF constant denoted by argument .Ar val is not recognized, these function return diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_abbrev.3 b/contrib/elftoolchain/libdwarf/dwarf_get_abbrev.3 index afb546839248..2e4ae2e28ecc 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_abbrev.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_abbrev.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_abbrev.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_abbrev.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd March 27, 2011 -.Os .Dt DWARF_GET_ABBREV 3 +.Os .Sh NAME .Nm dwarf_get_abbrev .Nd retrieve abbreviation information @@ -123,24 +123,7 @@ In case of an error, it returns .Dv DW_DLV_ERROR and sets the argument .Ar err . -.Sh ERRORS -Function -.Fn dwarf_get_abbrev -can fail with: -.Bl -tag -width ".Bq Er DW_DLE_NO_ENTRY" -.It Bq Er DW_DLE_ARGUMENT -One of the arguments -.Ar dbg , -.Ar ret_abbrev , -.Ar length -or -.Ar attr_count -was NULL. -.It Bq Er DW_DLE_NO_ENTRY -There is no abbreviation information at offset -.Ar offset . -.El -.Sh EXAMPLE +.Sh EXAMPLES To loop through all the abbreviation information associated with a DWARF debug context, use: .Bd -literal -offset indent @@ -170,10 +153,27 @@ while ((ret = dwarf_next_cu_header(dbg, NULL, NULL, &aboff, if (ret == DW_DLV_ERROR) warnx("dwarf_next_cu_header: %s", dwarf_errmsg(de)); .Ed +.Sh ERRORS +Function +.Fn dwarf_get_abbrev +can fail with: +.Bl -tag -width ".Bq Er DW_DLE_NO_ENTRY" +.It Bq Er DW_DLE_ARGUMENT +One of the arguments +.Ar dbg , +.Ar ret_abbrev , +.Ar length +or +.Ar attr_count +was NULL. +.It Bq Er DW_DLE_NO_ENTRY +There is no abbreviation information at offset +.Ar offset . +.El .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_dealloc 3 , -.Xr dwarf_get_abbrev_tag 3 , -.Xr dwarf_get_abbrev_code 3 , .Xr dwarf_get_abbrev_children_flag 3 , -.Xr dwarf_get_abbrev_entry 3 +.Xr dwarf_get_abbrev_code 3 , +.Xr dwarf_get_abbrev_entry 3 , +.Xr dwarf_get_abbrev_tag 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_children_flag.3 b/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_children_flag.3 index 6f9ed84176e0..8660b57e5a82 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_children_flag.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_children_flag.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_abbrev_children_flag.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_abbrev_children_flag.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd March 14, 2011 -.Os .Dt DWARF_GET_ABBREV_CHILDREN_FLAG 3 +.Os .Sh NAME .Nm dwarf_get_abbrev_children_flag .Nd return a flag indicating the presence of children @@ -69,7 +69,6 @@ If argument .Ar err is not NULL, it will be used to store error information in case of an error. -.Pp .Sh RETURN VALUES Function .Fn dwarf_get_abbrev_children_flag @@ -96,5 +95,5 @@ was NULL. .Xr dwarf 3 , .Xr dwarf_get_abbrev 3 , .Xr dwarf_get_abbrev_code 3 , -.Xr dwarf_get_abbrev_tag 3 , -.Xr dwarf_get_abbrev_entry 3 +.Xr dwarf_get_abbrev_entry 3 , +.Xr dwarf_get_abbrev_tag 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_code.3 b/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_code.3 index 18c3c297059e..bc8c25978d48 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_code.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_code.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_abbrev_code.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_abbrev_code.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd March 13, 2011 -.Os .Dt DWARF_GET_ABBREV_CODE 3 +.Os .Sh NAME .Nm dwarf_get_abbrev_code .Nd retrieve the abbreviation code for an abbreviation @@ -81,6 +81,6 @@ was NULL. .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_get_abbrev 3 , -.Xr dwarf_get_abbrev_tag 3 , .Xr dwarf_get_abbrev_children_flag 3 , -.Xr dwarf_get_abbrev_entry 3 +.Xr dwarf_get_abbrev_entry 3 , +.Xr dwarf_get_abbrev_tag 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_entry.3 b/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_entry.3 index f9e084b134de..5cadb8084003 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_entry.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_entry.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_abbrev_entry.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_abbrev_entry.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd April 02, 2011 -.Os .Dt DWARF_GET_ABBREV_ENTRY 3 +.Os .Sh NAME .Nm dwarf_get_abbrev_entry .Nd retrieve attribute information from an abbreviation descriptor @@ -96,25 +96,7 @@ In case of an error, it returns .Dv DW_DLV_ERROR and sets the argument .Ar err . -.Sh ERRORS -Function -.Fn dwarf_get_abbrev_entry -can fail with: -.Bl -tag -width ".Bq Er DW_DLE_NO_ENTRY" -.It Bq Er DW_DLE_ARGUMENT -One of the arguments -.Ar abbrev , -.Ar code , -.Ar form -or -.Ar offset -was NULL. -.It Bq Er DW_DLE_NO_ENTRY -The attribute index specified by argument -.Ar ndx -was out of range. -.El -.Sh EXAMPLE +.Sh EXAMPLES To loop through all the attribute entries contained in the abbreviation section, use: .Bd -literal -offset indent @@ -154,6 +136,24 @@ while ((ret = dwarf_next_cu_header(dbg, NULL, NULL, &aboff, if (ret == DW_DLV_ERROR) warnx("dwarf_next_cu_header: %s", dwarf_errmsg(de)); .Ed +.Sh ERRORS +Function +.Fn dwarf_get_abbrev_entry +can fail with: +.Bl -tag -width ".Bq Er DW_DLE_NO_ENTRY" +.It Bq Er DW_DLE_ARGUMENT +One of the arguments +.Ar abbrev , +.Ar code , +.Ar form +or +.Ar offset +was NULL. +.It Bq Er DW_DLE_NO_ENTRY +The attribute index specified by argument +.Ar ndx +was out of range. +.El .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_get_abbrev 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_tag.3 b/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_tag.3 index c1fc37f049d1..d8b8c07962b1 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_tag.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_tag.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_abbrev_tag.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_abbrev_tag.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd March 13, 2011 -.Os .Dt DWARF_GET_ABBREV_TAG 3 +.Os .Sh NAME .Nm dwarf_get_abbrev_tag .Nd retrieve the tag for an abbreviation @@ -81,6 +81,6 @@ was NULL. .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_get_abbrev 3 , -.Xr dwarf_get_abbrev_code 3 , .Xr dwarf_get_abbrev_children_flag 3 , +.Xr dwarf_get_abbrev_code 3 , .Xr dwarf_get_abbrev_entry 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_address_size.3 b/contrib/elftoolchain/libdwarf/dwarf_get_address_size.3 index 856b375e1ba9..d03ef00d301c 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_address_size.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_address_size.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_address_size.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_address_size.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd April 14, 2010 -.Os .Dt DWARF_GET_ADDRESS_SIZE 3 +.Os .Sh NAME .Nm dwarf_get_address_size .Nd return the number of bytes needed to represent an address @@ -78,5 +78,5 @@ was NULL. .El .Sh SEE ALSO .Xr dwarf 3 , -.Xr dwarf_init 3 , -.Xr dwarf_finish 3 +.Xr dwarf_finish 3 , +.Xr dwarf_init 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_arange.3 b/contrib/elftoolchain/libdwarf/dwarf_get_arange.3 index b16914087729..bde55ec08b19 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_arange.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_arange.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_arange.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_arange.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd April 16, 2011 -.Os .Dt DWARF_GET_ARANGE 3 +.Os .Sh NAME .Nm dwarf_get_arange .Nd retrieve the address range descriptor for an address @@ -115,7 +115,7 @@ was not found. .El .Sh SEE ALSO .Xr dwarf 3 , -.Xr dwarf_get_aranges 3 , .Xr dwarf_get_arange_cu_header_offset 3 , .Xr dwarf_get_arange_info 3 , +.Xr dwarf_get_aranges 3 , .Xr dwarf_get_cu_die_offset 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_arange_info.3 b/contrib/elftoolchain/libdwarf/dwarf_get_arange_info.3 index 3878edde19bb..b3cca0e216a0 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_arange_info.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_arange_info.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_arange_info.3 3142 2015-01-29 23:11:14Z jkoshy $ +.\" $Id: dwarf_get_arange_info.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd April 16, 2011 -.Os .Dt DWARF_GET_ARANGE_INFO 3 +.Os .Sh NAME .Nm dwarf_get_arange_info .Nd extract address range information from a descriptor @@ -89,21 +89,7 @@ In case of an error, it returns .Dv DW_DLV_ERROR and sets the argument .Ar err . -.Sh ERRORS -Function -.Fn dwarf_get_arange_info -can fail with: -.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" -.It Bq Er DW_DLE_ARGUMENT -One of the arguments -.Ar ar , -.Ar start , -.Ar length -or -.Ar cu_die_offset -was NULL. -.El -.Sh EXAMPLE +.Sh EXAMPLES To loop through all the address lookup table entries, use: .Bd -literal -offset indent Dwarf_Debug dbg; @@ -127,9 +113,23 @@ for (i = 0; i < cnt; i++) { /* Do something with the returned information. */ } .Ed +.Sh ERRORS +Function +.Fn dwarf_get_arange_info +can fail with: +.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" +.It Bq Er DW_DLE_ARGUMENT +One of the arguments +.Ar ar , +.Ar start , +.Ar length +or +.Ar cu_die_offset +was NULL. +.El .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_get_arange 3 , -.Xr dwarf_get_aranges 3 , .Xr dwarf_get_arange_cu_header_offset 3 , +.Xr dwarf_get_aranges 3 , .Xr dwarf_get_cu_die_offset 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_aranges.3 b/contrib/elftoolchain/libdwarf/dwarf_get_aranges.3 index 1444704293f4..db1c1bfea507 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_aranges.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_aranges.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_aranges.3 2122 2011-11-09 15:35:14Z jkoshy $ +.\" $Id: dwarf_get_aranges.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd November 9, 2011 -.Os .Dt DWARF_GET_ARANGES 3 +.Os .Sh NAME .Nm dwarf_get_aranges .Nd retrieve program address space mappings @@ -96,26 +96,7 @@ In case of an error, it returns .Dv DW_DLV_ERROR and sets the argument .Ar err . -.Sh ERRORS -Function -.Fn dwarf_get_aranges -can fail with: -.Bl -tag -width ".Bq Er DW_DLE_NO_ENTRY" -.It Bq Er DW_DLE_ARGUMENT -One of the arguments -.Ar dbg , -.Ar ar_list -or -.Ar ar_cnt -was NULL. -.It Bq Er DW_DLE_NO_ENTRY -The debugging context -.Ar dbg -did not contain a -.Dq ".debug_aranges" -string section. -.El -.Sh EXAMPLE +.Sh EXAMPLES To loop through all the address lookup table entries, use: .Bd -literal -offset indent Dwarf_Debug dbg; @@ -140,6 +121,25 @@ for (i = 0; i < cnt; i++) { /* Do something with the returned information. */ } .Ed +.Sh ERRORS +Function +.Fn dwarf_get_aranges +can fail with: +.Bl -tag -width ".Bq Er DW_DLE_NO_ENTRY" +.It Bq Er DW_DLE_ARGUMENT +One of the arguments +.Ar dbg , +.Ar ar_list +or +.Ar ar_cnt +was NULL. +.It Bq Er DW_DLE_NO_ENTRY +The debugging context +.Ar dbg +did not contain a +.Dq ".debug_aranges" +string section. +.El .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_get_arange 3 , diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_cie_index.3 b/contrib/elftoolchain/libdwarf/dwarf_get_cie_index.3 index d6bc015b2d0a..ffcca4747385 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_cie_index.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_cie_index.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_cie_index.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_cie_index.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd May 22, 2011 -.Os .Dt DWARF_GET_CIE_INDEX 3 +.Os .Sh NAME .Nm dwarf_get_cie_index .Nd retrieve the index of a CIE descriptor diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_cie_info.3 b/contrib/elftoolchain/libdwarf/dwarf_get_cie_info.3 index f3710ca5bbe9..f40053e2e7a2 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_cie_info.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_cie_info.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_cie_info.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_cie_info.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd May 29, 2011 -.Os .Dt DWARF_GET_CIE_INFO 3 +.Os .Sh NAME .Nm dwarf_get_cie_info .Nd retrieve information associated with a CIE descriptor diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_cie_of_fde.3 b/contrib/elftoolchain/libdwarf/dwarf_get_cie_of_fde.3 index 4fa5c5d0931f..bd414f1353f4 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_cie_of_fde.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_cie_of_fde.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_cie_of_fde.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_cie_of_fde.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd May 22, 2011 -.Os .Dt DWARF_GET_CIE_OF_FDE 3 +.Os .Sh NAME .Nm dwarf_get_cie_of_fde .Nd retrieve CIE descriptor @@ -82,7 +82,7 @@ was NULL. .El .Sh SEE ALSO .Xr dwarf 3 , -.Xr dwarf_get_cie_info 3 , .Xr dwarf_get_cie_index 3 , +.Xr dwarf_get_cie_info 3 , .Xr dwarf_get_fde_at_pc 3 , .Xr dwarf_get_fde_n 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_cu_die_offset.3 b/contrib/elftoolchain/libdwarf/dwarf_get_cu_die_offset.3 index b71e431fc9f3..b842b7e864ae 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_cu_die_offset.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_cu_die_offset.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_cu_die_offset.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_cu_die_offset.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd April 10, 2011 -.Os .Dt DWARF_GET_CU_DIE_OFFSET 3 +.Os .Sh NAME .Nm dwarf_get_arange_cu_header_offset , .Nm dwarf_get_cu_die_offset diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_die_infotypes_flag.3 b/contrib/elftoolchain/libdwarf/dwarf_get_die_infotypes_flag.3 index 4f5a19ace367..ef84375b20f5 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_die_infotypes_flag.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_die_infotypes_flag.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_die_infotypes_flag.3 3118 2014-12-20 20:30:06Z jkoshy $ +.\" $Id: dwarf_get_die_infotypes_flag.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd December 20, 2014 -.Os .Dt DWARF_GET_DIE_INFOTYPES_FLAG 3 +.Os .Sh NAME .Nm dwarf_get_die_infotypes_flag .Nd indicate the originating DWARF section for a DIE diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_elf.3 b/contrib/elftoolchain/libdwarf/dwarf_get_elf.3 index c93a7ef48ceb..9363171320cd 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_elf.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_elf.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: dwarf_get_elf.3 2122 2011-11-09 15:35:14Z jkoshy $ +.\" $Id: dwarf_get_elf.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd November 9, 2011 -.Os .Dt DWARF_GET_ELF 3 +.Os .Sh NAME .Nm dwarf_get_elf .Nd retrieve the @@ -98,6 +98,6 @@ if (dwarf_get_elf(dbg, &elf, &de) != DW_DLV_OK) .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_errmsg 3 , -.Xr dwarf_init 3 , .Xr dwarf_finish 3 , +.Xr dwarf_init 3 , .Xr elf 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_fde_at_pc.3 b/contrib/elftoolchain/libdwarf/dwarf_get_fde_at_pc.3 index 8aa36ec8d583..843a5d78d76a 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_fde_at_pc.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_fde_at_pc.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_fde_at_pc.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_fde_at_pc.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd May 22, 2011 -.Os .Dt DWARF_GET_FDE_AT_PC 3 +.Os .Sh NAME .Nm dwarf_get_fde_at_pc .Nd retrieve the FDE descriptor for an address diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_all_regs.3 b/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_all_regs.3 index f55d3d68a5bb..58c0ed002646 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_all_regs.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_all_regs.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_fde_info_for_all_regs.3 3182 2015-04-10 16:08:10Z emaste $ +.\" $Id: dwarf_get_fde_info_for_all_regs.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd June 4, 2011 -.Os .Dt DWARF_GET_FDE_INFO_FOR_ALL_REGS 3 +.Os .Sh NAME .Nm dwarf_get_fde_info_for_all_regs .Nd retrieve register rule row @@ -150,7 +150,7 @@ did not fall in the range covered by argument .Xr dwarf_get_fde_info_for_reg3 3 , .Xr dwarf_get_fde_n 3 , .Xr dwarf_set_frame_cfa_value 3 , -.Xr dwarf_set_frame_rule_table_size 3 , .Xr dwarf_set_frame_rule_initial_value 3 , +.Xr dwarf_set_frame_rule_table_size 3 , .Xr dwarf_set_frame_same_value 3 , .Xr dwarf_set_frame_undefined_value 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_all_regs3.3 b/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_all_regs3.3 index 841d98346959..96c160eb9b57 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_all_regs3.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_all_regs3.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_fde_info_for_all_regs3.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_fde_info_for_all_regs3.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd June 26, 2011 -.Os .Dt DWARF_GET_FDE_INFO_FOR_ALL_REGS3 3 +.Os .Sh NAME .Nm dwarf_get_fde_info_for_all_regs3 .Nd retrieve register rule row @@ -177,7 +177,7 @@ did not fall in the range covered by argument .Xr dwarf_get_fde_info_for_reg3 3 , .Xr dwarf_get_fde_n 3 , .Xr dwarf_set_frame_cfa_value 3 , -.Xr dwarf_set_frame_rule_table_size 3 , .Xr dwarf_set_frame_rule_initial_value 3 , +.Xr dwarf_set_frame_rule_table_size 3 , .Xr dwarf_set_frame_same_value 3 , .Xr dwarf_set_frame_undefined_value 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_cfa_reg3.3 b/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_cfa_reg3.3 index f8271f065671..6e339aec8179 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_cfa_reg3.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_cfa_reg3.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_fde_info_for_cfa_reg3.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_fde_info_for_cfa_reg3.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd June 12, 2011 -.Os .Dt DWARF_GET_FDE_INFO_FOR_CFA_REGS3 3 +.Os .Sh NAME .Nm dwarf_get_fde_info_for_cfa_regs3 .Nd retrieve a CFA register rule @@ -165,7 +165,7 @@ did not fall in the range covered by argument .Xr dwarf_get_fde_info_for_reg3 3 , .Xr dwarf_get_fde_n 3 , .Xr dwarf_set_frame_cfa_value 3 , -.Xr dwarf_set_frame_rule_table_size 3 , .Xr dwarf_set_frame_rule_initial_value 3 , +.Xr dwarf_set_frame_rule_table_size 3 , .Xr dwarf_set_frame_same_value 3 , .Xr dwarf_set_frame_undefined_value 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_reg.3 b/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_reg.3 index fd05814a3630..5a241570be76 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_reg.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_reg.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_fde_info_for_reg.3 3181 2015-04-10 13:22:51Z emaste $ +.\" $Id: dwarf_get_fde_info_for_reg.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd June 4, 2011 -.Os .Dt DWARF_GET_FDE_INFO_FOR_REG 3 +.Os .Sh NAME .Nm dwarf_get_fde_info_for_reg .Nd retrieve register rule @@ -150,7 +150,7 @@ did not fall in the range covered by argument .Xr dwarf_get_fde_info_for_reg3 3 , .Xr dwarf_get_fde_n 3 , .Xr dwarf_set_frame_cfa_value 3 , -.Xr dwarf_set_frame_rule_table_size 3 , .Xr dwarf_set_frame_rule_initial_value 3 , +.Xr dwarf_set_frame_rule_table_size 3 , .Xr dwarf_set_frame_same_value 3 , .Xr dwarf_set_frame_undefined_value 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_reg3.3 b/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_reg3.3 index 85c0f7f0ea0d..8e26fa6c65b5 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_reg3.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_reg3.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_fde_info_for_reg3.3 2122 2011-11-09 15:35:14Z jkoshy $ +.\" $Id: dwarf_get_fde_info_for_reg3.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd November 9, 2011 -.Os .Dt DWARF_GET_FDE_INFO_FOR_REG3 3 +.Os .Sh NAME .Nm dwarf_get_fde_info_for_reg3 .Nd retrieve register rule @@ -140,33 +140,7 @@ In case of an error, it returns .Dv DW_DLV_ERROR and sets the argument .Ar err . -.Sh ERRORS -Function -.Fn dwarf_get_fde_info_for_reg3 -can fail with: -.Bl -tag -width ".Bq Er DW_DLE_FRAME_TABLE_COL_BAD" -.It Bq Er DW_DLE_ARGUMENT -One of the arguments -.Ar block_ptr , -.Ar fde , -.Ar offset_or_block_len , -.Ar offset_relevant , -.Ar register_num , -.Ar row_pc , -or -.Ar type -was NULL. -.It Bq Er DW_DLE_FRAME_TABLE_COL_BAD -The column number provided in argument -.Ar table_column -was too large. -.It Bq Er DW_DLE_PC_NOT_IN_FDE_RANGE -The program counter value provided in argument -.Ar pc -did not fall in the range covered by argument -.Ar fde . -.El -.Sh EXAMPLE +.Sh EXAMPLES To retrieve the register rules at column 3 from a rule table associated with a FDE descriptor: .Bd -literal -offset indent @@ -199,6 +173,32 @@ for (pc = low_pc; pc < low_pc + func_len; pc++) { /* ... use the retrieved register rule ... */ } .Ed +.Sh ERRORS +Function +.Fn dwarf_get_fde_info_for_reg3 +can fail with: +.Bl -tag -width ".Bq Er DW_DLE_FRAME_TABLE_COL_BAD" +.It Bq Er DW_DLE_ARGUMENT +One of the arguments +.Ar block_ptr , +.Ar fde , +.Ar offset_or_block_len , +.Ar offset_relevant , +.Ar register_num , +.Ar row_pc , +or +.Ar type +was NULL. +.It Bq Er DW_DLE_FRAME_TABLE_COL_BAD +The column number provided in argument +.Ar table_column +was too large. +.It Bq Er DW_DLE_PC_NOT_IN_FDE_RANGE +The program counter value provided in argument +.Ar pc +did not fall in the range covered by argument +.Ar fde . +.El .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_get_fde_at_pc 3 , @@ -208,7 +208,7 @@ for (pc = low_pc; pc < low_pc + func_len; pc++) { .Xr dwarf_get_fde_info_for_reg 3 , .Xr dwarf_get_fde_n 3 , .Xr dwarf_set_frame_cfa_value 3 , -.Xr dwarf_set_frame_rule_table_size 3 , .Xr dwarf_set_frame_rule_initial_value 3 , +.Xr dwarf_set_frame_rule_table_size 3 , .Xr dwarf_set_frame_same_value 3 , .Xr dwarf_set_frame_undefined_value 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_fde_instr_bytes.3 b/contrib/elftoolchain/libdwarf/dwarf_get_fde_instr_bytes.3 index 488d56633c18..d8c8734bfb22 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_fde_instr_bytes.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_fde_instr_bytes.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_fde_instr_bytes.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_fde_instr_bytes.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd May 23, 2011 -.Os .Dt DWARF_GET_FDE_INSTR_BYTES 3 +.Os .Sh NAME .Nm dwarf_get_fde_instr_bytes .Nd retrieve instructions from FDE descritpor @@ -98,9 +98,9 @@ was NULL. .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_expand_frame_instructions 3 , -.Xr dwarf_get_cie_info 3 , .Xr dwarf_get_cie_index 3 , -.Xr dwarf_get_cie_of_fde , +.Xr dwarf_get_cie_info 3 , +.Xr dwarf_get_cie_of_fde 3 , .Xr dwarf_get_fde_at_pc 3 , .Xr dwarf_get_fde_info_for_all_regs 3 , .Xr dwarf_get_fde_info_for_all_regs3 3 , diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_fde_list.3 b/contrib/elftoolchain/libdwarf/dwarf_get_fde_list.3 index 7164ae6e1123..bc4034fd3156 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_fde_list.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_fde_list.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_fde_list.3 2122 2011-11-09 15:35:14Z jkoshy $ +.\" $Id: dwarf_get_fde_list.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd November 9, 2011 -.Os .Dt DWARF_GET_FDE_LIST 3 +.Os .Sh NAME .Nm dwarf_get_fde_list .Nd retrieve frame information @@ -132,23 +132,7 @@ In case of an error, they return .Dv DW_DLV_ERROR and set the argument .Ar err . -.Sh ERRORS -These functions may fail with the following errors: -.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" -.It Bq Er DW_DLE_ARGUMENT -One of the arguments -.Va dbg , -.Va cie_list , -.Va cie_count , -.Va fde_list -or -.Va fde_count -was NULL. -.It Bq Er DW_DLE_NO_ENTRY -There is no frame information associated with the giving DWARF debug -context. -.El -.Sh EXAMPLE +.Sh EXAMPLES To obtain frame information from the .Dq ".debug_frame" section, use: @@ -202,17 +186,33 @@ for (i = 0; i < fde_count; i++) { dwarf_fde_cie_list_dealloc(dbg, cie_list, cie_count, fde_list, fde_count); .Ed +.Sh ERRORS +These functions may fail with the following errors: +.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" +.It Bq Er DW_DLE_ARGUMENT +One of the arguments +.Va dbg , +.Va cie_list , +.Va cie_count , +.Va fde_list +or +.Va fde_count +was NULL. +.It Bq Er DW_DLE_NO_ENTRY +There is no frame information associated with the giving DWARF debug +context. +.El .Sh SEE ALSO .Xr dwarf 3 , +.Xr dwarf_fde_cie_list_dealloc 3 , .Xr dwarf_get_cie_index 3 , .Xr dwarf_get_cie_of_fde 3 , .Xr dwarf_get_fde_at_pc 3 , .Xr dwarf_get_fde_instr_bytes 3 , .Xr dwarf_get_fde_n 3 , .Xr dwarf_get_fde_range 3 , -.Xr dwarf_fde_cie_list_dealloc 3 , .Xr dwarf_set_frame_cfa_value 3 , -.Xr dwarf_set_frame_rule_table_size 3 , .Xr dwarf_set_frame_rule_initial_value 3 , +.Xr dwarf_set_frame_rule_table_size 3 , .Xr dwarf_set_frame_same_value 3 , .Xr dwarf_set_frame_undefined_value 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_fde_n.3 b/contrib/elftoolchain/libdwarf/dwarf_get_fde_n.3 index dbb6c27a883b..a44eeabe7705 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_fde_n.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_fde_n.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_fde_n.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_fde_n.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd May 14, 2011 -.Os .Dt DWARF_GET_FDE_N 3 +.Os .Sh NAME .Nm dwarf_get_fde_n .Nd retrieve FDE descriptor diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_fde_range.3 b/contrib/elftoolchain/libdwarf/dwarf_get_fde_range.3 index 1ea708cebccf..d3e978927378 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_fde_range.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_fde_range.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_fde_range.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_fde_range.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd May 22, 2011 -.Os .Dt DWARF_GET_FDE_RANGE 3 +.Os .Sh NAME .Nm dwarf_get_fde_range .Nd retrieve range information from an FDE descriptor @@ -134,9 +134,9 @@ was NULL. .El .Sh SEE ALSO .Xr dwarf 3 , -.Xr dwarf_get_cie_info 3 , .Xr dwarf_get_cie_index 3 , -.Xr dwarf_get_cie_of_fde , +.Xr dwarf_get_cie_info 3 , +.Xr dwarf_get_cie_of_fde 3 , .Xr dwarf_get_fde_at_pc 3 , .Xr dwarf_get_fde_info_for_all_regs 3 , .Xr dwarf_get_fde_info_for_all_regs3 3 , diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_form_class.3 b/contrib/elftoolchain/libdwarf/dwarf_get_form_class.3 index 82cbe1a6cafc..12d69d066db4 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_form_class.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_form_class.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_form_class.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_form_class.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd June 26, 2011 -.Os .Dt DWARF_GET_FORM_CLASS 3 +.Os .Sh NAME .Nm dwarf_get_form_class .Nd retrieve the form class of an attribute diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_funcs.3 b/contrib/elftoolchain/libdwarf/dwarf_get_funcs.3 index 4abc1d92c47e..649fa5de94db 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_funcs.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_funcs.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_funcs.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_funcs.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd April 10, 2011 -.Os .Dt DWARF_GET_FUNCS 3 +.Os .Sh NAME .Nm dwarf_get_funcs , .Nm dwarf_func_cu_offset , @@ -211,5 +211,5 @@ did not contain information about static functions. .El .Sh SEE ALSO .Xr dwarf 3 , -.Xr dwarf_get_cu_die_offset_given_cu_header_offset 3 , -.Xr dwarf_funcs_dealloc 3 +.Xr dwarf_funcs_dealloc 3 , +.Xr dwarf_get_cu_die_offset_given_cu_header_offset 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_globals.3 b/contrib/elftoolchain/libdwarf/dwarf_get_globals.3 index b5f976e45465..ac6aa172e381 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_globals.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_globals.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_globals.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_globals.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd April 2, 2011 -.Os .Dt DWARF_GET_GLOBALS 3 +.Os .Sh NAME .Nm dwarf_get_globals , .Nm dwarf_global_cu_offset , diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_loclist_entry.3 b/contrib/elftoolchain/libdwarf/dwarf_get_loclist_entry.3 index 50c3455de674..02bc7afc704e 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_loclist_entry.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_loclist_entry.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_loclist_entry.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_loclist_entry.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd July 6, 2011 -.Os .Dt DWARF_GET_LOCLIST_ENTRY 3 +.Os .Sh NAME .Nm dwarf_get_loclist_entry .Nd retrieve DWARF location list entry @@ -108,26 +108,7 @@ In case of an error, it returns .Dv DW_DLV_ERROR and sets the argument .Ar err . -.Sh ERRORS -Function -.Fn dwarf_get_loclist_entry -can fail with: -.Bl -tag -width ".Bq Er DW_DLE_NO_ENTRY" -.It Bq Er DW_DLE_ARGUMENT -One of the arguments -.Ar dbg , -.Ar hipc , -.Ar lopc , -.Ar data , -.Ar entry_len -or -.Ar next_entry -was NULL. -.It Bq Er DW_DLE_NO_ENTRY -There is no location list at the specified offset -.Ar offset . -.El -.Sh EXAMPLE +.Sh EXAMPLES To iterate through all the location list entries in the .Dq ".debug_loc" section, use: @@ -148,9 +129,28 @@ while ((ret = dwarf_get_loclist_entry(dbg, off, &hipc, &lopc, &data, if (ret == DW_DLV_ERROR) warnx("dwarf_get_loclist_entry failed: %s", dwarf_errmsg(de)); .Ed +.Sh ERRORS +Function +.Fn dwarf_get_loclist_entry +can fail with: +.Bl -tag -width ".Bq Er DW_DLE_NO_ENTRY" +.It Bq Er DW_DLE_ARGUMENT +One of the arguments +.Ar dbg , +.Ar hipc , +.Ar lopc , +.Ar data , +.Ar entry_len +or +.Ar next_entry +was NULL. +.It Bq Er DW_DLE_NO_ENTRY +There is no location list at the specified offset +.Ar offset . +.El .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_loclist 3 , -.Xr dwarf_loclist_n 3 , .Xr dwarf_loclist_from_expr 3 , -.Xr dwarf_loclist_from_expr_a 3 +.Xr dwarf_loclist_from_expr_a 3 , +.Xr dwarf_loclist_n 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_macro_details.3 b/contrib/elftoolchain/libdwarf/dwarf_get_macro_details.3 index 71e491420642..cd2f55b0ba3c 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_macro_details.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_macro_details.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_macro_details.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_macro_details.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd March 20, 2011 -.Os .Dt DWARF_GET_MACRO_DETAILS 3 +.Os .Sh NAME .Nm dwarf_get_macro_details .Nd retrieve macro information @@ -150,23 +150,7 @@ In case of an error, it returns .Dv DW_DLV_ERROR and sets the argument .Ar err . -.Sh ERRORS -Function -.Fn dwarf_get_macro_details -can fail with: -.Bl -tag -width ".Bq Er DW_DLE_NO_ENTRY" -.It Bq Er DW_DLE_ARGUMENT -One of the arguments -.Ar dbg , -.Ar entry_cnt -or -.Ar details -was NULL. -.It Bq Er DW_DLE_NO_ENTRY -There is no more macro information at the specified offset -.Ar offset . -.El -.Sh EXAMPLE +.Sh EXAMPLES To loop through all the macro information entries associated with a DWARF debug context: .Bd -literal -offset indent @@ -185,6 +169,22 @@ while (dwarf_get_macro_details(dbg, offset, 0, offset = md[cnt - 1].dmd_offset + 1; } .Ed +.Sh ERRORS +Function +.Fn dwarf_get_macro_details +can fail with: +.Bl -tag -width ".Bq Er DW_DLE_NO_ENTRY" +.It Bq Er DW_DLE_ARGUMENT +One of the arguments +.Ar dbg , +.Ar entry_cnt +or +.Ar details +was NULL. +.It Bq Er DW_DLE_NO_ENTRY +There is no more macro information at the specified offset +.Ar offset . +.El .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_dealloc 3 , diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_pubtypes.3 b/contrib/elftoolchain/libdwarf/dwarf_get_pubtypes.3 index 23ad78341132..700f2aa06c7b 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_pubtypes.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_pubtypes.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_pubtypes.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_pubtypes.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd April 4, 2011 -.Os .Dt DWARF_GET_PUBTYPES 3 +.Os .Sh NAME .Nm dwarf_get_pubtypes , .Nm dwarf_pubtype_cu_offset , diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_ranges.3 b/contrib/elftoolchain/libdwarf/dwarf_get_ranges.3 index 15bad4dfd7ac..f8e84ead35a7 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_ranges.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_ranges.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_ranges.3 3182 2015-04-10 16:08:10Z emaste $ +.\" $Id: dwarf_get_ranges.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd November 9, 2011 -.Os .Dt DWARF_GET_RANGES 3 +.Os .Sh NAME .Nm dwarf_get_ranges .Nd retrieve non-contiguous address ranges @@ -159,23 +159,6 @@ The application should not attempt to directly free this pointer. Portable code should instead use .Fn dwarf_ranges_dealloc to indicate that the memory may be freed. -.Sh COMPATIBILITY -Function -.Fn dwarf_get_ranges_a -is identical to -.Fn dwarf_get_ranges , -except that it requires one additional argument -.Ar die -denoting the debugging information entry associated with -the address range list. -In this implementation of the -.Lb libdwarf , -the argument -.Ar die -is ignored, and function -.Fn dwarf_get_ranges_a -is only provided for compatibility with other implementations of the -DWARF(3) API. .Sh RETURN VALUES These functions return @@ -189,21 +172,7 @@ In case of an error, they return .Dv DW_DLV_ERROR and set the argument .Ar err . -.Sh ERRORS -These function can fail with: -.Bl -tag -width ".Bq Er DW_DLE_NO_ENTRY" -.It Bq Er DW_DLE_ARGUMENT -One of the arguments -.Ar dbg , -.Ar ranges -or -.Ar cnt -was NULL. -.It Bq Er DW_DLE_NO_ENTRY -There is no address range list at the specified offset -.Ar offset . -.El -.Sh EXAMPLE +.Sh EXAMPLES To retrieve the address range list associated with a debugging information entry, use: .Bd -literal -offset indent @@ -253,6 +222,37 @@ for (i = 0; (Dwarf_Unsigned) i < attr_count; i++) { } } .Ed +.Sh COMPATIBILITY +Function +.Fn dwarf_get_ranges_a +is identical to +.Fn dwarf_get_ranges , +except that it requires one additional argument +.Ar die +denoting the debugging information entry associated with +the address range list. +In this implementation of the +.Lb libdwarf , +the argument +.Ar die +is ignored, and function +.Fn dwarf_get_ranges_a +is only provided for compatibility with other implementations of the +DWARF(3) API. +.Sh ERRORS +These function can fail with: +.Bl -tag -width ".Bq Er DW_DLE_NO_ENTRY" +.It Bq Er DW_DLE_ARGUMENT +One of the arguments +.Ar dbg , +.Ar ranges +or +.Ar cnt +was NULL. +.It Bq Er DW_DLE_NO_ENTRY +There is no address range list at the specified offset +.Ar offset . +.El .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_ranges_dealloc 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_relocation_info.3 b/contrib/elftoolchain/libdwarf/dwarf_get_relocation_info.3 index 96166cfa9ce9..04fb460f8c8b 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_relocation_info.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_relocation_info.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_relocation_info.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_relocation_info.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd September 3, 2011 -.Os .Dt DWARF_GET_RELOCATION_INFO 3 +.Os .Sh NAME .Nm dwarf_get_relocation_info .Nd retrieve generated relocation arrays @@ -147,32 +147,6 @@ returns .Dv DW_DLV_ERROR and sets the argument .Ar err . -.Sh ERRORS -Function -.Fn dwarf_get_relocation_info -can fail with: -.Bl -tag -width ".Bq Er DW_DLE_NO_ENTRY" -.It Bq Er DW_DLE_ARGUMENT -One of the arguments -.Ar dbg , -.Ar elf_section_index , -.Ar elf_section_link , -.Ar reloc_entry_count -or -.Ar reloc_buf -was NULL. -.It Bq Er DW_DLE_NO_ENTRY -There were no more ELF relocation arrays to retrieve. -.It Bq Er DW_DLE_NO_ENTRY -The flag -.Dv DW_DLC_SYMBOLIC_RELOCATIONS -was not set on the producer instance. -.It Bq Er DW_DLE_NO_ENTRY -Function -.Xr dwarf_transform_to_disk_form 3 -was not called prior to calling function -.Fn dwarf_get_relocation_info . -.El .Sh EXAMPLES To generate relocation entries and retrieve them, use: .Bd -literal -offset indent @@ -218,11 +192,37 @@ for (i = 0; (Dwarf_Unsigned) i < reloc_cnt; i++) { dwarf_producer_finish(dbg, &de); .Ed +.Sh ERRORS +Function +.Fn dwarf_get_relocation_info +can fail with: +.Bl -tag -width ".Bq Er DW_DLE_NO_ENTRY" +.It Bq Er DW_DLE_ARGUMENT +One of the arguments +.Ar dbg , +.Ar elf_section_index , +.Ar elf_section_link , +.Ar reloc_entry_count +or +.Ar reloc_buf +was NULL. +.It Bq Er DW_DLE_NO_ENTRY +There were no more ELF relocation arrays to retrieve. +.It Bq Er DW_DLE_NO_ENTRY +The flag +.Dv DW_DLC_SYMBOLIC_RELOCATIONS +was not set on the producer instance. +.It Bq Er DW_DLE_NO_ENTRY +Function +.Xr dwarf_transform_to_disk_form 3 +was not called prior to calling function +.Fn dwarf_get_relocation_info . +.El .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_get_relocation_info_count 3 , -.Xr dwarf_reset_section_bytes 3 , .Xr dwarf_producer_finish 3 , .Xr dwarf_producer_init 3 , .Xr dwarf_producer_init_b 3 , +.Xr dwarf_reset_section_bytes 3 , .Xr dwarf_transform_to_disk_form 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_relocation_info_count.3 b/contrib/elftoolchain/libdwarf/dwarf_get_relocation_info_count.3 index 38e1a004f3b9..05b70a32ea47 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_relocation_info_count.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_relocation_info_count.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_relocation_info_count.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_relocation_info_count.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 3, 2011 -.Os .Dt DWARF_GET_RELOCATION_INFO_COUNT 3 +.Os .Sh NAME .Nm dwarf_get_relocation_info_count .Nd return the number of relocation arrays diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_section_bytes.3 b/contrib/elftoolchain/libdwarf/dwarf_get_section_bytes.3 index 1b0ac9eb6d5f..5256459efcc6 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_section_bytes.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_section_bytes.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_section_bytes.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_section_bytes.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd August 26, 2011 -.Os .Dt DWARF_GET_SECTION_BYTES 3 +.Os .Sh NAME .Nm dwarf_get_section_bytes .Nd retrieve ELF section byte streams @@ -96,23 +96,6 @@ In case of an error, function .Fn dwarf_get_section_bytes will return NULL and set the argument .Ar err . -.Sh ERRORS -Function -.Fn dwarf_get_section_bytes -can fail with: -.Bl -tag -width ".Bq Er DW_DLE_NO_ENTRY" -.It Bq Er DW_DLE_ARGUMENT -One of the arguments -.Ar dbg , -.Ar elf_section_index , -or -.Ar length -was NULL. -.It Bq Er DW_DLE_NO_ENTRY -There were no more ELF sections to retrieve, or the function was -called before a call to -.Xr dwarf_transform_to_disk_form 3 . -.El .Sh EXAMPLES To generate and retrieve ELF section byte streams, use: .Bd -literal -offset indent @@ -148,10 +131,27 @@ for (i = 0; i < count; i++) { /* Release resources. */ dwarf_producer_finish(dbg, &de); .Ed +.Sh ERRORS +Function +.Fn dwarf_get_section_bytes +can fail with: +.Bl -tag -width ".Bq Er DW_DLE_NO_ENTRY" +.It Bq Er DW_DLE_ARGUMENT +One of the arguments +.Ar dbg , +.Ar elf_section_index , +or +.Ar length +was NULL. +.It Bq Er DW_DLE_NO_ENTRY +There were no more ELF sections to retrieve, or the function was +called before a call to +.Xr dwarf_transform_to_disk_form 3 . +.El .Sh SEE ALSO .Xr dwarf 3 , -.Xr dwarf_reset_section_bytes 3 , .Xr dwarf_producer_finish 3 , .Xr dwarf_producer_init 3 , .Xr dwarf_producer_init_b 3 , +.Xr dwarf_reset_section_bytes 3 , .Xr dwarf_transform_to_disk_form 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_section_max_offsets.3 b/contrib/elftoolchain/libdwarf/dwarf_get_section_max_offsets.3 index 963d4ac3814e..d8280a5d56cf 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_section_max_offsets.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_section_max_offsets.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_section_max_offsets.3 3141 2015-01-29 23:11:10Z jkoshy $ +.\" $Id: dwarf_get_section_max_offsets.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd December 21, 2014 +.Dt DWARF_GET_SECTION_MAX_OFFSETS 3 .Os -.Dt DWARF_GET_SECTION_MAX_OFFSETS .Sh NAME .Nm dwarf_get_section_max_offsets , .Nm dwarf_get_section_max_offsets_b diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_str.3 b/contrib/elftoolchain/libdwarf/dwarf_get_str.3 index 5917c97a4752..cdc302a55559 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_str.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_str.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_str.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_str.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd April 3, 2011 -.Os .Dt DWARF_GET_STR 3 +.Os .Sh NAME .Nm dwarf_get_str .Nd retrieve a string from the DWARF string section @@ -95,6 +95,26 @@ In case of an error, it returns .Dv DW_DLV_ERROR and sets the argument .Ar err . +.Sh EXAMPLES +To retrieve all the strings in the DWARF string section, use: +.Bd -literal -offset indent +Dwarf_Debug dbg; +Dwarf_Off offset; +Dwarf_Signed len; +Dwarf_Error de; +char *str; +int ret + +offset = 0; +while ((ret = dwarf_get_str(dbg, offset, &str, &len, &de)) == + DW_DLV_OK) { + /* .. Use the retrieved string. .. */ + offset += len + 1; /* Account for the terminating NUL. */ +} + +if (ret == DW_DLV_ERROR) + warnx("dwarf_get_str: %s", dwarf_errmsg(de)); +.Ed .Sh ERRORS Function .Fn dwarf_get_str @@ -124,26 +144,6 @@ was at the very end of the .Dq ".debug_str" section. .El -.Sh EXAMPLE -To retrieve all the strings in the DWARF string section, use: -.Bd -literal -offset indent -Dwarf_Debug dbg; -Dwarf_Off offset; -Dwarf_Signed len; -Dwarf_Error de; -char *str; -int ret - -offset = 0; -while ((ret = dwarf_get_str(dbg, offset, &str, &len, &de)) == - DW_DLV_OK) { - /* .. Use the retrieved string. .. */ - offset += len + 1; /* Account for the terminating NUL. */ -} - -if (ret == DW_DLV_ERROR) - warnx("dwarf_get_str: %s", dwarf_errmsg(de)); -.Ed .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_init 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_types.3 b/contrib/elftoolchain/libdwarf/dwarf_get_types.3 index 59e58681d613..e095f16af80c 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_types.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_types.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_types.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_types.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd April 10, 2011 -.Os .Dt DWARF_GET_TYPES 3 +.Os .Sh NAME .Nm dwarf_get_types , .Nm dwarf_type_cu_offset , diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_vars.3 b/contrib/elftoolchain/libdwarf/dwarf_get_vars.3 index d2c3ebd17b8b..a82b6ce1a5b8 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_vars.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_vars.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_vars.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_vars.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd April 2, 2011 -.Os .Dt DWARF_GET_VARS 3 +.Os .Sh NAME .Nm dwarf_get_vars , .Nm dwarf_var_cu_offset , diff --git a/contrib/elftoolchain/libdwarf/dwarf_get_weaks.3 b/contrib/elftoolchain/libdwarf/dwarf_get_weaks.3 index 470973e4369d..4e347ba1804b 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_get_weaks.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_get_weaks.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_weaks.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_weaks.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd April 10, 2011 -.Os .Dt DWARF_GET_WEAKS 3 +.Os .Sh NAME .Nm dwarf_get_weaks , .Nm dwarf_weak_cu_offset , diff --git a/contrib/elftoolchain/libdwarf/dwarf_hasattr.3 b/contrib/elftoolchain/libdwarf/dwarf_hasattr.3 index 659887588563..31d6e3e44b95 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_hasattr.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_hasattr.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_hasattr.3 3181 2015-04-10 13:22:51Z emaste $ +.\" $Id: dwarf_hasattr.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd April 17, 2010 -.Os .Dt DWARF_HASATTR 3 +.Os .Sh NAME .Nm dwarf_hasattr .Nd check for the presence of an attribute diff --git a/contrib/elftoolchain/libdwarf/dwarf_hasform.3 b/contrib/elftoolchain/libdwarf/dwarf_hasform.3 index 2cb6fc536bd4..bba706820ca7 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_hasform.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_hasform.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: dwarf_hasform.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_hasform.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd May 22, 2010 -.Os .Dt DWARF_HASFORM 3 +.Os .Sh NAME .Nm dwarf_hasform , .Nm dwarf_whatform , diff --git a/contrib/elftoolchain/libdwarf/dwarf_highpc.3 b/contrib/elftoolchain/libdwarf/dwarf_highpc.3 index 4d31f5c8d1a2..94cc4cf62ece 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_highpc.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_highpc.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_highpc.3 3092 2014-09-02 22:09:30Z kaiwang27 $ +.\" $Id: dwarf_highpc.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd July 22, 2014 -.Os .Dt DWARF_HIGHPC 3 +.Os .Sh NAME .Nm dwarf_arrayorder , .Nm dwarf_bitoffset , @@ -155,7 +155,8 @@ or if the caller is not interested in the respective value. .Sh RETURN VALUES These functions return -.Dv DW_DLV_OK on success. +.Dv DW_DLV_OK +on success. .Pp If the debugging information entry descriptor denoted by argument .Ar die @@ -189,5 +190,5 @@ had no requested attribute. .Xr dwarf 3 , .Xr dwarf_attr 3 , .Xr dwarf_attrlist 3 , -.Xr dwarf_hasattr 3 , -.Xr dwarf_get_form_class 3 +.Xr dwarf_get_form_class 3 , +.Xr dwarf_hasattr 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_init.3 b/contrib/elftoolchain/libdwarf/dwarf_init.3 index 36c6449dc991..094126ae7978 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_init.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_init.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: dwarf_init.3 2122 2011-11-09 15:35:14Z jkoshy $ +.\" $Id: dwarf_init.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd November 9, 2011 -.Os .Dt DWARF_INIT 3 +.Os .Sh NAME .Nm dwarf_init , .Nm dwarf_elf_init @@ -137,6 +137,11 @@ The .Vt Dwarf_Debug instance returned by these functions should be freed using .Fn dwarf_finish . +.Sh IMPLEMENTATION NOTES +The current implementation does not support access modes +.Dv DW_DLC_RDWR +and +.Dv DW_DLC_WRITE . .Sh RETURN VALUES These functions return the following values: .Bl -tag -width ".Bq Er DW_DLV_NO_ENTRY" @@ -151,11 +156,6 @@ or .Ar "elf" did not contain debug information. .El -.Sh IMPLEMENTATION NOTES -The current implementation does not support access modes -.Dv DW_DLC_RDWR -and -.Dv DW_DLC_WRITE . .Sh EXAMPLES To initialize a .Vt Dwarf_Debug diff --git a/contrib/elftoolchain/libdwarf/dwarf_lineno.3 b/contrib/elftoolchain/libdwarf/dwarf_lineno.3 index 0a0362f80e9d..d1811819b391 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_lineno.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_lineno.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_lineno.3 2074 2011-10-27 03:34:33Z jkoshy $ +.\" $Id: dwarf_lineno.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd February 5, 2011 -.Os .Dt DWARF_LINENO 3 +.Os .Sh NAME .Nm dwarf_lineaddr , .Nm dwarf_linebeginstatement , diff --git a/contrib/elftoolchain/libdwarf/dwarf_lne_end_sequence.3 b/contrib/elftoolchain/libdwarf/dwarf_lne_end_sequence.3 index a826acbbacda..efa33a49c2b7 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_lne_end_sequence.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_lne_end_sequence.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_lne_end_sequence.3 2074 2011-10-27 03:34:33Z jkoshy $ +.\" $Id: dwarf_lne_end_sequence.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 15, 2011 -.Os .Dt DWARF_LNE_END_SEQUENCE 3 +.Os .Sh NAME .Nm dwarf_lne_end_sequence .Nd set the end of instruction sequence diff --git a/contrib/elftoolchain/libdwarf/dwarf_lne_set_address.3 b/contrib/elftoolchain/libdwarf/dwarf_lne_set_address.3 index 8a46b7b434d6..208a3d81f635 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_lne_set_address.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_lne_set_address.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_lne_set_address.3 2074 2011-10-27 03:34:33Z jkoshy $ +.\" $Id: dwarf_lne_set_address.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 14, 2011 -.Os .Dt DWARF_LNE_SET_ADDRESS 3 +.Os .Sh NAME .Nm dwarf_lne_set_address .Nd set the base address for line number information diff --git a/contrib/elftoolchain/libdwarf/dwarf_loclist.3 b/contrib/elftoolchain/libdwarf/dwarf_loclist.3 index 2e95d74405ae..4350fc7db951 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_loclist.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_loclist.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_loclist.3 2122 2011-11-09 15:35:14Z jkoshy $ +.\" $Id: dwarf_loclist.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd November 9, 2011 -.Os .Dt DWARF_LOCLIST 3 +.Os .Sh NAME .Nm dwarf_loclist , .Nm dwarf_loclist_n @@ -181,23 +181,7 @@ In case of an error, they return .Dv DW_DLV_ERROR and set the argument .Ar err . -.Sh ERRORS -These functions can fail with: -.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" -.It Bq Er DW_DLE_ARGUMENT -One of the arguments -.Ar at , -.Ar llbuf -or -.Ar listlen -was NULL. -.It Bq Er DW_DLE_ARGUMENT -The attribute provided by argument -.Ar at -does not contain a location expression or is not associated with a -location expression list. -.El -.Sh EXAMPLE +.Sh EXAMPLES To retrieve the location list associated with an attribute, use: .Bd -literal -offset indent Dwarf_Attribute at; @@ -222,9 +206,25 @@ for (i = 0; i < lcnt; i++) { } dwarf_dealloc(dbg, llbuf, DW_DLA_LIST); .Ed +.Sh ERRORS +These functions can fail with: +.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" +.It Bq Er DW_DLE_ARGUMENT +One of the arguments +.Ar at , +.Ar llbuf +or +.Ar listlen +was NULL. +.It Bq Er DW_DLE_ARGUMENT +The attribute provided by argument +.Ar at +does not contain a location expression or is not associated with a +location expression list. +.El .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_dealloc 3 , +.Xr dwarf_get_loclist_entry 3 , .Xr dwarf_loclist_from_expr 3 , -.Xr dwarf_loclist_from_expr_a 3 , -.Xr dwarf_get_loclist_entry 3 +.Xr dwarf_loclist_from_expr_a 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_loclist_from_expr.3 b/contrib/elftoolchain/libdwarf/dwarf_loclist_from_expr.3 index d0eb88c464d2..cc2a61844aca 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_loclist_from_expr.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_loclist_from_expr.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_loclist_from_expr.3 3129 2014-12-21 20:06:26Z jkoshy $ +.\" $Id: dwarf_loclist_from_expr.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd December 21, 2014 -.Os .Dt DWARF_LOCLIST_FROM_EXPR 3 +.Os .Sh NAME .Nm dwarf_loclist_from_expr , .Nm dwarf_loclist_from_expr_a , @@ -194,8 +194,8 @@ this function. .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_dealloc 3 , -.Xr dwarf_loclist_n 3 , .Xr dwarf_get_fde_info_for_all_regs3 3 , .Xr dwarf_get_fde_info_for_cfa_reg3 3 , .Xr dwarf_get_fde_info_for_reg3 3 , -.Xr dwarf_get_loclist_entry 3 +.Xr dwarf_get_loclist_entry 3 , +.Xr dwarf_loclist_n 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_new_die.3 b/contrib/elftoolchain/libdwarf/dwarf_new_die.3 index 1c463d35f030..70ff2b6fe004 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_new_die.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_new_die.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_new_die.3 2074 2011-10-27 03:34:33Z jkoshy $ +.\" $Id: dwarf_new_die.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd September 4, 2011 -.Os .Dt DWARF_NEW_DIE 3 +.Os .Sh NAME .Nm dwarf_new_die .Nd allocate a new debugging information entry @@ -106,27 +106,6 @@ returns .Dv DW_DLV_BADADDR and sets the argument .Ar err . -.Sh ERRORS -Function -.Fn dwarf_new_die -can fail with: -.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" -.It Bq Er DW_DLE_ARGUMENT -Argument -.Ar dbg -was NULL. -.It Bq Er DW_DLE_ARGUMENT -More than one of the arguments -.Ar parent , -.Ar child , -.Ar left -and -.Ar right -were non-NULL. -.It Bq Er DW_DLE_MEMORY -An out of memory condition was encountered during the execution of the -function. -.El .Sh EXAMPLES To create debugging information entries and add them to the producer instance, use: @@ -156,6 +135,27 @@ if (dwarf_add_die_to_debug(dbg, die1, &de) != DW_DLV_OK) { return; } .Ed +.Sh ERRORS +Function +.Fn dwarf_new_die +can fail with: +.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" +.It Bq Er DW_DLE_ARGUMENT +Argument +.Ar dbg +was NULL. +.It Bq Er DW_DLE_ARGUMENT +More than one of the arguments +.Ar parent , +.Ar child , +.Ar left +and +.Ar right +were non-NULL. +.It Bq Er DW_DLE_MEMORY +An out of memory condition was encountered during the execution of the +function. +.El .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_add_die_to_debug 3 , diff --git a/contrib/elftoolchain/libdwarf/dwarf_new_expr.3 b/contrib/elftoolchain/libdwarf/dwarf_new_expr.3 index d8f4c8adb373..242699a60a73 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_new_expr.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_new_expr.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_new_expr.3 2074 2011-10-27 03:34:33Z jkoshy $ +.\" $Id: dwarf_new_expr.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd September 8, 2011 -.Os .Dt DWARF_NEW_EXPR 3 +.Os .Sh NAME .Nm dwarf_new_expr .Nd create a location expression descriptor @@ -79,19 +79,6 @@ returns .Dv DW_DLV_BADADDR and sets the argument .Ar err . -.Sh ERRORS -Function -.Fn dwarf_new_expr -can fail with: -.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" -.It Bq Er DW_DLE_ARGUMENT -Argument -.Ar dbg -was NULL. -.It Bq Er DW_DLE_MEMORY -An out of memory condition was encountered during the execution of -the function. -.El .Sh EXAMPLES To create a location expression descriptor, add location expression operators to it and to retrieve the generated byte stream, @@ -123,12 +110,25 @@ if ((buf = dwarf_expr_into_block(pe, &len, &de)) == return; } .Ed +.Sh ERRORS +Function +.Fn dwarf_new_expr +can fail with: +.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" +.It Bq Er DW_DLE_ARGUMENT +Argument +.Ar dbg +was NULL. +.It Bq Er DW_DLE_MEMORY +An out of memory condition was encountered during the execution of +the function. +.El .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_add_AT_location_expr 3 , -.Xr dwarf_add_expr_gen 3 , .Xr dwarf_add_expr_addr 3 , .Xr dwarf_add_expr_addr_b 3 , +.Xr dwarf_add_expr_gen 3 , .Xr dwarf_expr_current_offset 3 , .Xr dwarf_expr_into_block 3 , .Xr dwarf_producer_init 3 , diff --git a/contrib/elftoolchain/libdwarf/dwarf_new_fde.3 b/contrib/elftoolchain/libdwarf/dwarf_new_fde.3 index 1ca19a858429..790addebb663 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_new_fde.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_new_fde.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_new_fde.3 2074 2011-10-27 03:34:33Z jkoshy $ +.\" $Id: dwarf_new_fde.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd September 24, 2011 -.Os .Dt DWARF_NEW_FDE 3 +.Os .Sh NAME .Nm dwarf_new_fde .Nd allocate a DWARF frame descriptor @@ -81,7 +81,7 @@ function. .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_add_fde_inst 3 , +.Xr dwarf_add_frame_cie 3 , .Xr dwarf_add_frame_fde 3 , .Xr dwarf_add_frame_fde_b 3 , -.Xr dwarf_add_frame_cie 3 , .Xr dwarf_fde_cfa_offset 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_next_cu_header.3 b/contrib/elftoolchain/libdwarf/dwarf_next_cu_header.3 index f68867d7f21e..97f1d32eaf78 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_next_cu_header.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_next_cu_header.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_next_cu_header.3 3182 2015-04-10 16:08:10Z emaste $ +.\" $Id: dwarf_next_cu_header.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd December 21, 2014 -.Os .Dt DWARF_NEXT_CU_HEADER 3 +.Os .Sh NAME .Nm dwarf_next_cu_header , .Nm dwarf_next_cu_header_b , @@ -198,7 +198,6 @@ and .Ar err if the caller is not interested in the respective value. .Ss Iterating Through Compilation Units in a Debug Context -.Pp The first call to function .Fn dwarf_next_cu_header_c for a given debug context with argument diff --git a/contrib/elftoolchain/libdwarf/dwarf_next_types_section.3 b/contrib/elftoolchain/libdwarf/dwarf_next_types_section.3 index 98ff70d82668..5e01d81f9207 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_next_types_section.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_next_types_section.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_next_types_section.3 3116 2014-12-20 18:26:55Z jkoshy $ +.\" $Id: dwarf_next_types_section.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd December 20, 2014 -.Os .Dt DWARF_NEXT_TYPES_SECTION 3 +.Os .Sh NAME .Nm dwarf_next_types_section .Nd step through .debug_types sections in a debug context @@ -95,20 +95,6 @@ When there are no more .Dq \&.debug_types sections left to traverse, it returns .Dv DW_DLV_NO_ENTRY . -.Sh COMPATIBILITY -This function is an extension to the -.Xr DWARF 3 -API. -.Sh ERRORS -The -.Fn dwarf_next_types_section -function may fail with the following errors: -.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" -.It Bq Er DW_DLE_ARGUMENT -Argument -.Va dbg -was NULL. -.El .Sh EXAMPLES To iterate though every type unit in all the .Dq \&.debug_types @@ -128,6 +114,20 @@ do { } } while (dwarf_next_types_section(dbg, &de) == DW_DLV_OK); .Ed +.Sh COMPATIBILITY +This function is an extension to the +.Xr DWARF 3 +API. +.Sh ERRORS +The +.Fn dwarf_next_types_section +function may fail with the following errors: +.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" +.It Bq Er DW_DLE_ARGUMENT +Argument +.Va dbg +was NULL. +.El .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_init 3 , diff --git a/contrib/elftoolchain/libdwarf/dwarf_object_init.3 b/contrib/elftoolchain/libdwarf/dwarf_object_init.3 index 2915669155e1..06e0a8618780 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_object_init.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_object_init.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_object_init.3 2074 2011-10-27 03:34:33Z jkoshy $ +.\" $Id: dwarf_object_init.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd September 29, 2011 -.Os .Dt DWARF_OBJECT_INIT 3 +.Os .Sh NAME .Nm dwarf_object_init .Nd allocate a DWARF debug descriptor with application-specific file \ @@ -44,7 +44,6 @@ access methods .Fa "Dwarf_Error *err" .Fc .Sh DESCRIPTION -.Pp The .Fn dwarf_object_init function allocates and returns a @@ -202,7 +201,7 @@ function returns In case of an error, the function returns .Dv DW_DLV_ERROR and sets the argument -.Ar err. +.Ar err . .Sh ERRORS The .Fn dwarf_object_init diff --git a/contrib/elftoolchain/libdwarf/dwarf_producer_init.3 b/contrib/elftoolchain/libdwarf/dwarf_producer_init.3 index b8ca6a9ce657..7d4dff3880bc 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_producer_init.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_producer_init.3 @@ -22,13 +22,13 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_producer_init.3 3182 2015-04-10 16:08:10Z emaste $ +.\" $Id: dwarf_producer_init.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd August 20, 2011 -.Os .Dt DWARF_PRODUCER_INIT 3 +.Os .Sh NAME -.Nm dwarf_producer_init +.Nm dwarf_producer_init , .Nm dwarf_producer_init_b .Nd allocate a DWARF producer descriptor .Sh LIBRARY @@ -79,7 +79,6 @@ The argument .Ar flags specifies additional characteristics of the DWARF producer instance. The following flags are recognized: -.Pp .Bl -tag -width "Dv DW_DLC_ISA_MIPS" .It Dv DW_DLC_ISA_IA64 .Pq Deprecated @@ -229,6 +228,23 @@ In case of an error, they return .Dv DW_DLV_BADADDR and set the argument .Ar err . +.Sh EXAMPLES +To initialize a +.Vt Dwarf_P_Debug +instance for a MIPS32 big endian object, use: +.Bd -literal -offset indent +Dwarf_P_Debug dbg; +Dwarf_Unsigned flags; +Dwarf_Error de; + +/* ... assume cb_func points to the callback function ... */ + +flags = DW_DLC_WRITE | DW_DLC_SIZE_32 | DW_DLC_ISA_MIPS | + DW_DLC_STREAM_RELOCATIONS | DW_DLC_TARGET_BIGENDIAN; +if ((dbg = dwarf_producer_init(flags, cb_func, NULL, NULL, &de)) == + DW_DLV_BADADDR) + warnx("dwarf_producer_init failed: %s", dwarf_errmsg(-1)); +.Ed .Sh ERRORS These functions can fail with: .Bl -tag -width ".Bq Er DW_DLE_NO_ENTRY" @@ -272,23 +288,6 @@ were both set in argument .It Bq Er DW_DLE_MEMORY An out of memory condition was encountered. .El -.Sh EXAMPLES -To initialize a -.Vt Dwarf_P_Debug -instance for a MIPS32 big endian object, use: -.Bd -literal -offset indent -Dwarf_P_Debug dbg; -Dwarf_Unsigned flags; -Dwarf_Error de; - -/* ... assume cb_func points to the callback function ... */ - -flags = DW_DLC_WRITE | DW_DLC_SIZE_32 | DW_DLC_ISA_MIPS | - DW_DLC_STREAM_RELOCATIONS | DW_DLC_TARGET_BIGENDIAN; -if ((dbg = dwarf_producer_init(flags, cb_func, NULL, NULL, &de)) == - DW_DLV_BADADDR) - warnx("dwarf_producer_init failed: %s", dwarf_errmsg(-1)); -.Ed .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_errmsg 3 , diff --git a/contrib/elftoolchain/libdwarf/dwarf_producer_set_isa.3 b/contrib/elftoolchain/libdwarf/dwarf_producer_set_isa.3 index fc8a31f8526f..e97bd1efbfe8 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_producer_set_isa.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_producer_set_isa.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_producer_set_isa.3 2074 2011-10-27 03:34:33Z jkoshy $ +.\" $Id: dwarf_producer_set_isa.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd September 29, 2011 -.Os .Dt DWARF_PRODUCER_SET_ISA 3 +.Os .Sh NAME .Nm dwarf_producer_set_isa .Nd specify the instruction set architecture for a DWARF producer instance @@ -65,10 +65,6 @@ If the argument .Ar err is not NULL, it will be used to store error information in case of an error. -.Sh COMPATIBILITY -The -.Fn dwarf_producer_set_isa -function is a local extension. .Sh RETURN VALUES On success, the function .Fn dwarf_producer_set_isa @@ -78,6 +74,10 @@ In case of an error, this function returns .Dv DW_DLV_ERROR and sets the argument .Ar err . +.Sh COMPATIBILITY +The +.Fn dwarf_producer_set_isa +function is a local extension. .Sh ERRORS The .Fn dwarf_producer_set_isa diff --git a/contrib/elftoolchain/libdwarf/dwarf_reset_section_bytes.3 b/contrib/elftoolchain/libdwarf/dwarf_reset_section_bytes.3 index 702d56898cc3..7f7132a42af9 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_reset_section_bytes.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_reset_section_bytes.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_reset_section_bytes.3 2075 2011-10-27 03:47:28Z jkoshy $ +.\" $Id: dwarf_reset_section_bytes.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 3, 2011 -.Os .Dt DWARF_RESET_SECTION_BYTES 3 +.Os .Sh NAME .Nm dwarf_reset_section_bytes .Nd reset the internal state of a producer instance diff --git a/contrib/elftoolchain/libdwarf/dwarf_set_frame_cfa_value.3 b/contrib/elftoolchain/libdwarf/dwarf_set_frame_cfa_value.3 index c3d9c48bcb18..329c76968c44 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_set_frame_cfa_value.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_set_frame_cfa_value.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_set_frame_cfa_value.3 2075 2011-10-27 03:47:28Z jkoshy $ +.\" $Id: dwarf_set_frame_cfa_value.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd June 18, 2011 -.Os .Dt DWARF_SET_FRAME_CFA_VALUE 3 +.Os .Sh NAME .Nm dwarf_set_frame_cfa_value , .Nm dwarf_set_frame_rule_initial_value , diff --git a/contrib/elftoolchain/libdwarf/dwarf_set_reloc_application.3 b/contrib/elftoolchain/libdwarf/dwarf_set_reloc_application.3 index db40cbb2522a..76262ed76115 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_set_reloc_application.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_set_reloc_application.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_set_reloc_application.3 3161 2015-02-15 21:43:36Z emaste $ +.\" $Id: dwarf_set_reloc_application.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd February 11, 2015 -.Os .Dt DWARF_SET_RELOC_APPLICATION 3 +.Os .Sh NAME .Nm dwarf_set_reloc_application .Nd set a library-wide relocation flag @@ -78,5 +78,5 @@ Function does not return an error. .Sh SEE ALSO .Xr dwarf 3 , -.Xr dwarf_init 3 , -.Xr dwarf_elf_init 3 +.Xr dwarf_elf_init 3 , +.Xr dwarf_init 3 diff --git a/contrib/elftoolchain/libdwarf/dwarf_seterrarg.3 b/contrib/elftoolchain/libdwarf/dwarf_seterrarg.3 index 55d78d94258f..437e3943ac4c 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_seterrarg.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_seterrarg.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: dwarf_seterrarg.3 2075 2011-10-27 03:47:28Z jkoshy $ +.\" $Id: dwarf_seterrarg.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd May 01, 2010 -.Os .Dt DWARF_SETERRARG 3 +.Os .Sh NAME .Nm dwarf_seterrarg , .Nm dwarf_seterrhand @@ -90,7 +90,6 @@ If argument is NULL, function .Fn dwarf_seterrarg returns the previous library-wide callback argument. -.Pp .Sh COMPATIBILITY The behavior of these functions when argument .Ar dbg diff --git a/contrib/elftoolchain/libdwarf/dwarf_srcfiles.3 b/contrib/elftoolchain/libdwarf/dwarf_srcfiles.3 index 906bb925ab31..55606812c5f2 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_srcfiles.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_srcfiles.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: dwarf_srcfiles.3 2075 2011-10-27 03:47:28Z jkoshy $ +.\" $Id: dwarf_srcfiles.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd April 28, 2010 -.Os .Dt DWARF_SRCFILES 3 +.Os .Sh NAME .Nm dwarf_srcfiles .Nd retrieve source file information diff --git a/contrib/elftoolchain/libdwarf/dwarf_srclines.3 b/contrib/elftoolchain/libdwarf/dwarf_srclines.3 index 0f8d8307fdca..3c10de42c7c3 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_srclines.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_srclines.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: dwarf_srclines.3 2122 2011-11-09 15:35:14Z jkoshy $ +.\" $Id: dwarf_srclines.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd November 9, 2011 -.Os .Dt DWARF_SRCLINES 3 +.Os .Sh NAME .Nm dwarf_srclines .Nd retrieve line number information for a debugging information entry @@ -93,27 +93,7 @@ In case of an error, it returns .Dv DW_DLV_ERROR and sets the argument .Ar err . -.Sh ERRORS -Function -.Fn dwarf_srclines -can fail with: -.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" -.It Bq Er DW_DLE_ARGUMENT -One of the arguments -.Ar die , -.Ar lines -or -.Ar nlines -was NULL. -.It Bq Er DW_DLE_NO_ENTRY -The compilation unit referenced by argument -.Ar die -does not have associated line number information. -.It Bq Er DW_DLE_MEMORY -An out of memory condition was encountered during the execution of -this function. -.El -.Sh EXAMPLE +.Sh EXAMPLES To obtain an array of .Vt Dwarf_Line descriptors and to retrieve the source file, line number, and virtual address @@ -149,6 +129,26 @@ for (n = 0; n < nlines; n++) { dwarf_errmsg(de)); } .Ed +.Sh ERRORS +Function +.Fn dwarf_srclines +can fail with: +.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" +.It Bq Er DW_DLE_ARGUMENT +One of the arguments +.Ar die , +.Ar lines +or +.Ar nlines +was NULL. +.It Bq Er DW_DLE_NO_ENTRY +The compilation unit referenced by argument +.Ar die +does not have associated line number information. +.It Bq Er DW_DLE_MEMORY +An out of memory condition was encountered during the execution of +this function. +.El .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_line_srcfileno 3 , diff --git a/contrib/elftoolchain/libdwarf/dwarf_start_macro_file.3 b/contrib/elftoolchain/libdwarf/dwarf_start_macro_file.3 index 1e821d7fd7b9..945aa99f2a7d 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_start_macro_file.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_start_macro_file.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_start_macro_file.3 2075 2011-10-27 03:47:28Z jkoshy $ +.\" $Id: dwarf_start_macro_file.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd September 25, 2011 -.Os .Dt DWARF_START_MACRO_FILE 3 +.Os .Sh NAME .Nm dwarf_start_macro_file .Nd mark the start of a source file inclusion @@ -40,7 +40,6 @@ .Fa "Dwarf_Unsigned lineno" .Fa "Dwarf_Unsigned fileindex" .Fa "Dwarf_Error *err" -.Fa .Fc .Sh DESCRIPTION Function diff --git a/contrib/elftoolchain/libdwarf/dwarf_tag.3 b/contrib/elftoolchain/libdwarf/dwarf_tag.3 index bb49a495bef7..eae0181723c6 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_tag.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_tag.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_tag.3 2075 2011-10-27 03:47:28Z jkoshy $ +.\" $Id: dwarf_tag.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd April 14, 2010 -.Os .Dt DWARF_TAG 3 +.Os .Sh NAME .Nm dwarf_tag .Nd retrieve the tag associated with a DWARF debugging information entry diff --git a/contrib/elftoolchain/libdwarf/dwarf_transform_to_disk_form.3 b/contrib/elftoolchain/libdwarf/dwarf_transform_to_disk_form.3 index 54896caa7ea3..97ec8c328556 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_transform_to_disk_form.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_transform_to_disk_form.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_transform_to_disk_form.3 2075 2011-10-27 03:47:28Z jkoshy $ +.\" $Id: dwarf_transform_to_disk_form.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd August 25, 2011 -.Os .Dt DWARF_TRANSFORM_TO_DISK_FORM 3 +.Os .Sh NAME .Nm dwarf_transform_to_disk_form .Nd transform DWARF information into byte streams diff --git a/contrib/elftoolchain/libdwarf/dwarf_undef_macro.3 b/contrib/elftoolchain/libdwarf/dwarf_undef_macro.3 index b787289ab2e7..c5a6d4115373 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_undef_macro.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_undef_macro.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_undef_macro.3 2122 2011-11-09 15:35:14Z jkoshy $ +.\" $Id: dwarf_undef_macro.3 3644 2018-10-15 19:55:01Z jkoshy $ .\" .Dd November 9, 2011 -.Os .Dt DWARF_UNDEF_MACRO 3 +.Os .Sh NAME .Nm dwarf_undef_macro .Nd record the removal of a macro definition @@ -81,7 +81,7 @@ returns .Dv DW_DLV_ERROR and sets the argument .Ar err . -.Sh EXAMPLE +.Sh EXAMPLES To record the fact that the macro named .Dv _STDIO_H_ was removed at line 220 of the current macro file, use: diff --git a/contrib/elftoolchain/libdwarf/dwarf_vendor_ext.3 b/contrib/elftoolchain/libdwarf/dwarf_vendor_ext.3 index c7ae56fc87e7..31e01d817c6f 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_vendor_ext.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_vendor_ext.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_vendor_ext.3 2075 2011-10-27 03:47:28Z jkoshy $ +.\" $Id: dwarf_vendor_ext.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd September 25, 2011 -.Os .Dt DWARF_VENDOR_EXT 3 +.Os .Sh NAME .Nm dwarf_vendor_ext .Nd add vendor-specific macro information to a DWARF producer instance diff --git a/contrib/elftoolchain/libdwarf/dwarf_whatattr.3 b/contrib/elftoolchain/libdwarf/dwarf_whatattr.3 index d7f6dd4e38b9..f25c8c851517 100644 --- a/contrib/elftoolchain/libdwarf/dwarf_whatattr.3 +++ b/contrib/elftoolchain/libdwarf/dwarf_whatattr.3 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_whatattr.3 3181 2015-04-10 13:22:51Z emaste $ +.\" $Id: dwarf_whatattr.3 3640 2018-10-14 14:09:13Z jkoshy $ .\" .Dd May 22, 2010 -.Os .Dt DWARF_WHATATTR 3 +.Os .Sh NAME .Nm dwarf_whatattr .Nd retrieve the attribute code for a DWARF attribute diff --git a/contrib/elftoolchain/libelf/Makefile b/contrib/elftoolchain/libelf/Makefile index 75ef1e78d543..4167519cc278 100644 --- a/contrib/elftoolchain/libelf/Makefile +++ b/contrib/elftoolchain/libelf/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile 3594 2018-04-11 18:26:50Z jkoshy $ +# $Id: Makefile 3632 2018-10-10 21:12:43Z jkoshy $ TOP= .. @@ -52,6 +52,7 @@ SRCS= elf.c \ libelf_checksum.c \ libelf_data.c \ libelf_ehdr.c \ + libelf_elfmachine.c \ libelf_extended.c \ libelf_memory.c \ libelf_open.c \ diff --git a/contrib/elftoolchain/libelf/_libelf.h b/contrib/elftoolchain/libelf/_libelf.h index c5561d078f01..f7f8d9a151c2 100644 --- a/contrib/elftoolchain/libelf/_libelf.h +++ b/contrib/elftoolchain/libelf/_libelf.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: _libelf.h 3174 2015-03-27 17:13:41Z emaste $ + * $Id: _libelf.h 3632 2018-10-10 21:12:43Z jkoshy $ */ #ifndef __LIBELF_H_ @@ -194,6 +194,9 @@ enum { * Function Prototypes. */ +typedef int _libelf_translator_function(unsigned char *_dst, size_t dsz, + unsigned char *_src, size_t _cnt, int _byteswap); + #ifdef __cplusplus extern "C" { #endif @@ -207,12 +210,12 @@ Elf_Arsym *_libelf_ar_process_bsd_symtab(Elf *_ar, size_t *_dst); Elf_Arsym *_libelf_ar_process_svr4_symtab(Elf *_ar, size_t *_dst); long _libelf_checksum(Elf *_e, int _elfclass); void *_libelf_ehdr(Elf *_e, int _elfclass, int _allocate); +int _libelf_elfmachine(Elf *_e); unsigned int _libelf_falign(Elf_Type _t, int _elfclass); size_t _libelf_fsize(Elf_Type _t, int _elfclass, unsigned int _version, size_t count); -int (*_libelf_get_translator(Elf_Type _t, int _direction, int _elfclass)) - (unsigned char *_dst, size_t dsz, unsigned char *_src, - size_t _cnt, int _byteswap); +_libelf_translator_function *_libelf_get_translator(Elf_Type _t, + int _direction, int _elfclass, int _elfmachine); void *_libelf_getphdr(Elf *_e, int _elfclass); void *_libelf_getshdr(Elf_Scn *_scn, int _elfclass); void _libelf_init_elf(Elf *_e, Elf_Kind _kind); @@ -233,7 +236,7 @@ int _libelf_setshnum(Elf *_e, void *_eh, int _elfclass, size_t _shnum); int _libelf_setshstrndx(Elf *_e, void *_eh, int _elfclass, size_t _shstrndx); Elf_Data *_libelf_xlate(Elf_Data *_d, const Elf_Data *_s, - unsigned int _encoding, int _elfclass, int _direction); + unsigned int _encoding, int _elfclass, int _elfmachine, int _direction); int _libelf_xlate_shtype(uint32_t _sht); #ifdef __cplusplus } diff --git a/contrib/elftoolchain/libelf/elf.3 b/contrib/elftoolchain/libelf/elf.3 index 20cb9445535d..269725a09ac8 100644 --- a/contrib/elftoolchain/libelf/elf.3 +++ b/contrib/elftoolchain/libelf/elf.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf.3 3195 2015-05-12 17:22:19Z emaste $ +.\" $Id: elf.3 3643 2018-10-14 21:09:24Z jkoshy $ .\" -.Dd July 28, 2014 -.Os +.Dd October 10, 2018 .Dt ELF 3 +.Os .Sh NAME .Nm elf .Nd API for manipulating ELF objects @@ -116,9 +116,12 @@ library offers translation facilities .Xr elf64_xlatetof 3 and .Xr elf64_xlatetom 3 ) -to and from these -representations and also provides higher-level APIs that retrieve and store -data from the ELF object in a transparent manner. +to and from these representations. +It also provides higher-level APIs +.Xr ( gelf_xlatetof 3 , +.Xr gelf_xlatetom 3 ) +that retrieve and store data from the ELF object in a class-agnostic +manner. .Ss Library Working Version Conceptually, there are three version numbers associated with an application using the ELF library to manipulate ELF objects: @@ -155,7 +158,7 @@ Used for class-independent data types. .It Dv ELF_C_ Used for command values used in a few functions. These symbols are defined as members of the -.Vt Dv Elf_Cmd +.Vt Elf_Cmd enumeration. .It Dv ELF_E_ Used for error numbers. @@ -237,7 +240,6 @@ The .Vt Elf structure is opaque and has no members visible to the application. -.\" TODO describe the Elf_Arhdr and Elf_Arsym structures. .It Vt Elf_Data An .Vt Elf_Data @@ -409,7 +411,7 @@ Same as .El .Pp Section types in the range -.Ns [ Dv SHT_LOOS , +.Dv [ SHT_LOOS , .Dv SHT_HIUSER ] are otherwise considered to be of type .Dv ELF_T_BYTE . @@ -419,7 +421,7 @@ in the ELF library. Each function listed here is described further in its own manual page. .Bl -tag -width indent .It "Archive Access" -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn elf_getarsym Retrieve the archive symbol table. .It Fn elf_getarhdr @@ -436,7 +438,7 @@ Random access inside an archive. .El .It "Data Structures" -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn elf_getdata Retrieve translated data for an ELF section. .It Fn elf_getscn @@ -469,7 +471,7 @@ Allocate an Executable Header in an ELF object. Allocate or resize the Program Header Table in an ELF object. .El .It "Data Translation" -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn elf32_xlatetof , Fn elf64_xlatetof Translate an ELF data structure from its native representation to its file representation. @@ -478,14 +480,14 @@ Translate an ELF data structure from its file representation to a native representation. .El .It "Error Reporting" -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn elf_errno Retrieve the current error. .It Fn elf_errmsg Retrieve a human readable description of the current error. .El .It "Initialization" -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn elf_begin Opens an .Xr ar 1 @@ -529,9 +531,11 @@ back to the underlying file. Compute checksum of an ELF object. .It Fn elf_getident Retrieve the identification bytes for an ELF object. -.It Fn elf_getshnum +.It Fn elf_getphdrnum +Retrieve the number of program headers in an ELF object. +.It Fn elf_getshdrnum Retrieve the number of sections in an ELF object. -.It Fn elf_getshstrndx +.It Fn elf_getshdrstrndx Retrieve the section index of the section name string table in an ELF object. .It Fn elf_hash @@ -601,6 +605,7 @@ library will reclaim the space used by the descriptor itself. .Sh SEE ALSO .Xr gelf 3 , +.Xr ar 5 , .Xr elf 5 .Sh HISTORY The original ELF(3) API was developed for Unix System V. diff --git a/contrib/elftoolchain/libelf/elf_begin.3 b/contrib/elftoolchain/libelf/elf_begin.3 index e6c11b60e865..b7d8a9ec88b0 100644 --- a/contrib/elftoolchain/libelf/elf_begin.3 +++ b/contrib/elftoolchain/libelf/elf_begin.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_begin.3 3182 2015-04-10 16:08:10Z emaste $ +.\" $Id: elf_begin.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd December 11, 2011 -.Os .Dt ELF_BEGIN 3 +.Os .Sh NAME .Nm elf_begin .Nd open an ELF file or ar(1) archive diff --git a/contrib/elftoolchain/libelf/elf_cntl.3 b/contrib/elftoolchain/libelf/elf_cntl.3 index 257897590db2..59d375dad07d 100644 --- a/contrib/elftoolchain/libelf/elf_cntl.3 +++ b/contrib/elftoolchain/libelf/elf_cntl.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_cntl.3 3181 2015-04-10 13:22:51Z emaste $ +.\" $Id: elf_cntl.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd August 9, 2006 -.Os .Dt ELF_CNTL 3 +.Os .Sh NAME .Nm elf_cntl .Nd control an elf file descriptor diff --git a/contrib/elftoolchain/libelf/elf_data.c b/contrib/elftoolchain/libelf/elf_data.c index d494eda2de3f..bab70d003cee 100644 --- a/contrib/elftoolchain/libelf/elf_data.c +++ b/contrib/elftoolchain/libelf/elf_data.c @@ -32,7 +32,7 @@ #include "_libelf.h" -ELFTC_VCSID("$Id: elf_data.c 3466 2016-05-11 18:35:44Z emaste $"); +ELFTC_VCSID("$Id: elf_data.c 3632 2018-10-10 21:12:43Z jkoshy $"); Elf_Data * elf_getdata(Elf_Scn *s, Elf_Data *ed) @@ -43,8 +43,7 @@ elf_getdata(Elf_Scn *s, Elf_Data *ed) size_t count, fsz, msz; struct _Libelf_Data *d; uint64_t sh_align, sh_offset, sh_size; - int (*xlate)(unsigned char *_d, size_t _dsz, unsigned char *_s, - size_t _c, int _swap); + _libelf_translator_function *xlate; d = (struct _Libelf_Data *) ed; @@ -151,7 +150,8 @@ elf_getdata(Elf_Scn *s, Elf_Data *ed) d->d_flags |= LIBELF_F_DATA_MALLOCED; - xlate = _libelf_get_translator(elftype, ELF_TOMEMORY, elfclass); + xlate = _libelf_get_translator(elftype, ELF_TOMEMORY, elfclass, + _libelf_elfmachine(e)); if (!(*xlate)(d->d_data.d_buf, (size_t) d->d_data.d_size, e->e_rawfile + sh_offset, count, e->e_byteorder != LIBELF_PRIVATE(byteorder))) { diff --git a/contrib/elftoolchain/libelf/elf_end.3 b/contrib/elftoolchain/libelf/elf_end.3 index 8649faaa696d..fab4df34eefb 100644 --- a/contrib/elftoolchain/libelf/elf_end.3 +++ b/contrib/elftoolchain/libelf/elf_end.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_end.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: elf_end.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd June 29, 2006 -.Os .Dt ELF_END 3 +.Os .Sh NAME .Nm elf_end .Nd release an ELF descriptor diff --git a/contrib/elftoolchain/libelf/elf_errmsg.3 b/contrib/elftoolchain/libelf/elf_errmsg.3 index 822ba6ac894f..ec2561e42c80 100644 --- a/contrib/elftoolchain/libelf/elf_errmsg.3 +++ b/contrib/elftoolchain/libelf/elf_errmsg.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_errmsg.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: elf_errmsg.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd June 11, 2006 -.Os .Dt ELF_ERRMSG 3 +.Os .Sh NAME .Nm elf_errmsg , .Nm elf_errno diff --git a/contrib/elftoolchain/libelf/elf_fill.3 b/contrib/elftoolchain/libelf/elf_fill.3 index ab42a4245f77..2b78d5907cf4 100644 --- a/contrib/elftoolchain/libelf/elf_fill.3 +++ b/contrib/elftoolchain/libelf/elf_fill.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_fill.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: elf_fill.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd June 11, 2006 -.Os .Dt ELF_FILL 3 +.Os .Sh NAME .Nm elf_fill .Nd set fill byte for inter-section padding diff --git a/contrib/elftoolchain/libelf/elf_flagdata.3 b/contrib/elftoolchain/libelf/elf_flagdata.3 index de3cfd973160..c210e4a56971 100644 --- a/contrib/elftoolchain/libelf/elf_flagdata.3 +++ b/contrib/elftoolchain/libelf/elf_flagdata.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_flagdata.3 3479 2016-06-25 20:44:33Z jkoshy $ +.\" $Id: elf_flagdata.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd December 3, 2011 -.Os .Dt ELF_FLAGDATA 3 +.Os .Sh NAME .Nm elf_flagarhdr , .Nm elf_flagdata , diff --git a/contrib/elftoolchain/libelf/elf_getarhdr.3 b/contrib/elftoolchain/libelf/elf_getarhdr.3 index 1aab71ce4306..7af2e726c75c 100644 --- a/contrib/elftoolchain/libelf/elf_getarhdr.3 +++ b/contrib/elftoolchain/libelf/elf_getarhdr.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_getarhdr.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: elf_getarhdr.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd August 15, 2006 -.Os .Dt ELF_GETARHDR 3 +.Os .Sh NAME .Nm elf_getarhdr .Nd retrieve ar(1) header for an archive member diff --git a/contrib/elftoolchain/libelf/elf_getarsym.3 b/contrib/elftoolchain/libelf/elf_getarsym.3 index cda0511dfd7a..c42aab4ffb6f 100644 --- a/contrib/elftoolchain/libelf/elf_getarsym.3 +++ b/contrib/elftoolchain/libelf/elf_getarsym.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_getarsym.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: elf_getarsym.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd August 15, 2006 -.Os .Dt ELF_GETARSYM 3 +.Os .Sh NAME .Nm elf_getarsym .Nd retrieve the symbol table of an archive diff --git a/contrib/elftoolchain/libelf/elf_getbase.3 b/contrib/elftoolchain/libelf/elf_getbase.3 index fa1735394173..6319b8ad9d1a 100644 --- a/contrib/elftoolchain/libelf/elf_getbase.3 +++ b/contrib/elftoolchain/libelf/elf_getbase.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_getbase.3 978 2010-06-06 12:40:19Z jkoshy $ +.\" $Id: elf_getbase.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd June 6, 2010 -.Os .Dt ELF_GETBASE 3 +.Os .Sh NAME .Nm elf_getbase .Nd get the base offset for an object file diff --git a/contrib/elftoolchain/libelf/elf_getdata.3 b/contrib/elftoolchain/libelf/elf_getdata.3 index 68b28890b4d6..b287a25a00bc 100644 --- a/contrib/elftoolchain/libelf/elf_getdata.3 +++ b/contrib/elftoolchain/libelf/elf_getdata.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_getdata.3 3181 2015-04-10 13:22:51Z emaste $ +.\" $Id: elf_getdata.3 3643 2018-10-14 21:09:24Z jkoshy $ .\" .Dd January 26, 2011 -.Os .Dt ELF_GETDATA 3 +.Os .Sh NAME .Nm elf_getdata , .Nm elf_newdata , @@ -144,7 +144,7 @@ structures of type .Dv ELF_T_BYTE . .Ss Special handling of zero-sized and SHT_NOBITS sections For sections of type -.Dv SHT_NOBITS, +.Dv SHT_NOBITS , and for zero-sized sections, the functions .Fn elf_getdata diff --git a/contrib/elftoolchain/libelf/elf_getident.3 b/contrib/elftoolchain/libelf/elf_getident.3 index 01d7f9733ade..200fa4e350fb 100644 --- a/contrib/elftoolchain/libelf/elf_getident.3 +++ b/contrib/elftoolchain/libelf/elf_getident.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_getident.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: elf_getident.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd July 3, 2006 -.Os .Dt ELF_GETIDENT 3 +.Os .Sh NAME .Nm elf_getident .Nd return the initial bytes of a file diff --git a/contrib/elftoolchain/libelf/elf_getphdrnum.3 b/contrib/elftoolchain/libelf/elf_getphdrnum.3 index f0fae5ebb01e..d20a457e408e 100644 --- a/contrib/elftoolchain/libelf/elf_getphdrnum.3 +++ b/contrib/elftoolchain/libelf/elf_getphdrnum.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_getphdrnum.3 467 2009-08-05 18:18:49Z jkoshy $ +.\" $Id: elf_getphdrnum.3 3643 2018-10-14 21:09:24Z jkoshy $ .\" -.Dd August 5, 2009 -.Os +.Dd July 25, 2018 .Dt ELF_GETPHDRNUM 3 +.Os .Sh NAME .Nm elf_getphdrnum .Nd return the number of program headers in an ELF file @@ -45,14 +45,13 @@ and stores it into the location pointed to by argument .Pp This routine allows applications to uniformly process both normal ELF objects and ELF objects that use extended numbering. -.Pp .Sh RETURN VALUES Function .Fn elf_getphdrnum returns a zero value if successful, or -1 in case of an error. .Sh ERRORS Function -.Fn elf_getphnum +.Fn elf_getphdrnum can fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" .It Bq Er ELF_E_ARGUMENT diff --git a/contrib/elftoolchain/libelf/elf_getphnum.3 b/contrib/elftoolchain/libelf/elf_getphnum.3 index 95c75403c35e..77c595730890 100644 --- a/contrib/elftoolchain/libelf/elf_getphnum.3 +++ b/contrib/elftoolchain/libelf/elf_getphnum.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_getphnum.3 467 2009-08-05 18:18:49Z jkoshy $ +.\" $Id: elf_getphnum.3 3643 2018-10-14 21:09:24Z jkoshy $ .\" .Dd August 5, 2009 -.Os .Dt ELF_GETPHNUM 3 +.Os .Sh NAME .Nm elf_getphnum .Nd return the number of program headers in an ELF file @@ -50,7 +50,6 @@ and stores it into the location pointed to by argument .Pp This routine allows applications to uniformly process both normal ELF objects and ELF objects that use extended numbering. -.Pp .Sh RETURN VALUES Function .Fn elf_getphnum diff --git a/contrib/elftoolchain/libelf/elf_getscn.3 b/contrib/elftoolchain/libelf/elf_getscn.3 index 0afe44340cc0..ad3c88b82b2a 100644 --- a/contrib/elftoolchain/libelf/elf_getscn.3 +++ b/contrib/elftoolchain/libelf/elf_getscn.3 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2006-2008 Joseph Koshy. All rights reserved. +.\" Copyright (c) 2006-2008,2018 Joseph Koshy. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_getscn.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: elf_getscn.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" -.Dd October 22, 2007 -.Os +.Dd September 24, 2018 .Dt ELF_GETSCN 3 +.Os .Sh NAME .Nm elf_getscn , .Nm elf_ndxscn , @@ -86,6 +86,10 @@ takes a section descriptor .Ar scn and returns a pointer to the section descriptor at the next higher index. +As a consequence, +.Fn elf_nextscn +will never return a pointer to the empty section at index zero +.Dv ( SHN_UNDEF ) . Argument .Ar scn is allowed to be NULL, in which case this function will return a diff --git a/contrib/elftoolchain/libelf/elf_getshdrnum.3 b/contrib/elftoolchain/libelf/elf_getshdrnum.3 index e2bf354baebd..744fcf2dbf6c 100644 --- a/contrib/elftoolchain/libelf/elf_getshdrnum.3 +++ b/contrib/elftoolchain/libelf/elf_getshdrnum.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_getshdrnum.3 467 2009-08-05 18:18:49Z jkoshy $ +.\" $Id: elf_getshdrnum.3 3643 2018-10-14 21:09:24Z jkoshy $ .\" .Dd August 4, 2009 -.Os .Dt ELF_GETSHDRNUM 3 +.Os .Sh NAME .Nm elf_getshdrnum .Nd return the number of sections in an ELF file @@ -45,7 +45,6 @@ and stores it into the location pointed to by argument .Pp This routine allows applications to uniformly process both normal ELF objects, and ELF objects that use extended section numbering. -.Pp .Sh RETURN VALUES Function .Fn elf_getshdrnum diff --git a/contrib/elftoolchain/libelf/elf_getshdrstrndx.3 b/contrib/elftoolchain/libelf/elf_getshdrstrndx.3 index b02e71582403..e6c4eb774f26 100644 --- a/contrib/elftoolchain/libelf/elf_getshdrstrndx.3 +++ b/contrib/elftoolchain/libelf/elf_getshdrstrndx.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_getshdrstrndx.3 467 2009-08-05 18:18:49Z jkoshy $ +.\" $Id: elf_getshdrstrndx.3 3643 2018-10-14 21:09:24Z jkoshy $ .\" .Dd August 5, 2009 -.Os .Dt ELF_GETSHDRSTRNDX 3 +.Os .Sh NAME .Nm elf_getshdrstrndx .Nd retrieve the index of the section name string table @@ -46,7 +46,6 @@ and stores it into the location pointed to by argument .Pp This function allow applications to process both normal ELF objects and ELF objects that use extended section numbering uniformly. -.Pp .Sh RETURN VALUES These functions return zero if successful, or -1 in case of an error. .Sh ERRORS diff --git a/contrib/elftoolchain/libelf/elf_getshnum.3 b/contrib/elftoolchain/libelf/elf_getshnum.3 index 615aa71faa84..20be5c546773 100644 --- a/contrib/elftoolchain/libelf/elf_getshnum.3 +++ b/contrib/elftoolchain/libelf/elf_getshnum.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_getshnum.3 467 2009-08-05 18:18:49Z jkoshy $ +.\" $Id: elf_getshnum.3 3643 2018-10-14 21:09:24Z jkoshy $ .\" .Dd August 5, 2009 -.Os .Dt ELF_GETSHNUM 3 +.Os .Sh NAME .Nm elf_getshnum .Nd return the number of sections in an ELF file @@ -50,7 +50,6 @@ and stores it into the location pointed to by argument .Pp This routine allows applications to uniformly process both normal ELF objects, and ELF objects that use extended section numbering. -.Pp .Sh RETURN VALUES Function .Fn elf_getshnum diff --git a/contrib/elftoolchain/libelf/elf_getshstrndx.3 b/contrib/elftoolchain/libelf/elf_getshstrndx.3 index 71c6f9518c93..b03820f9c02c 100644 --- a/contrib/elftoolchain/libelf/elf_getshstrndx.3 +++ b/contrib/elftoolchain/libelf/elf_getshstrndx.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_getshstrndx.3 467 2009-08-05 18:18:49Z jkoshy $ +.\" $Id: elf_getshstrndx.3 3643 2018-10-14 21:09:24Z jkoshy $ .\" -.Dd August 5, 2009 -.Os +.Dd July 25, 2018 .Dt ELF_GETSHSTRNDX 3 +.Os .Sh NAME .Nm elf_getshstrndx , .Nm elf_setshstrndx @@ -41,17 +41,18 @@ .Sh DESCRIPTION Function .Fn elf_getshstrndx +is deprecated. +Please use +.Xr elf_getshdrstrndx 3 +instead. +.Pp +Function +.Fn elf_getshstrndx retrieves the section index of the string table containing section names from descriptor .Ar elf and stores it into the location pointed to by argument .Ar ndxptr . -Function -.Fn elf_getshstrndx -is deprecated. -Please use -.Xr elf_getshdrstrndx 3 -instead. .Pp Function .Fn elf_setshstrndx @@ -60,7 +61,6 @@ sets the index of the section name string table to argument .Pp These routines allow applications to process both normal ELF objects and ELF objects that use extended section numbering uniformly. -.Pp .Sh RETURN VALUES These functions return a non-zero value if successful, or zero in case of an error. diff --git a/contrib/elftoolchain/libelf/elf_hash.3 b/contrib/elftoolchain/libelf/elf_hash.3 index f099558570fd..a772a1a52ac1 100644 --- a/contrib/elftoolchain/libelf/elf_hash.3 +++ b/contrib/elftoolchain/libelf/elf_hash.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_hash.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: elf_hash.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd August 15, 2006 -.Os .Dt ELF_HASH 3 +.Os .Sh NAME .Nm elf_hash .Nd compute a hash value for a string diff --git a/contrib/elftoolchain/libelf/elf_kind.3 b/contrib/elftoolchain/libelf/elf_kind.3 index a5bbf9df4554..e7f5b9d232a0 100644 --- a/contrib/elftoolchain/libelf/elf_kind.3 +++ b/contrib/elftoolchain/libelf/elf_kind.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_kind.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: elf_kind.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd June 1, 2006 -.Os .Dt ELF_KIND 3 +.Os .Sh NAME .Nm elf_kind .Nd determine ELF file type diff --git a/contrib/elftoolchain/libelf/elf_memory.3 b/contrib/elftoolchain/libelf/elf_memory.3 index bcb888ff8d8b..f7b0e7f2270e 100644 --- a/contrib/elftoolchain/libelf/elf_memory.3 +++ b/contrib/elftoolchain/libelf/elf_memory.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_memory.3 2314 2011-12-11 06:19:51Z jkoshy $ +.\" $Id: elf_memory.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd June 28, 2006 -.Os .Dt ELF_MEMORY 3 +.Os .Sh NAME .Nm elf_memory .Nd process an ELF or ar(1) archive mapped into memory diff --git a/contrib/elftoolchain/libelf/elf_next.3 b/contrib/elftoolchain/libelf/elf_next.3 index 859d06cccda9..0c2d92d67e2d 100644 --- a/contrib/elftoolchain/libelf/elf_next.3 +++ b/contrib/elftoolchain/libelf/elf_next.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_next.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: elf_next.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd June 17, 2006 -.Os .Dt ELF_NEXT 3 +.Os .Sh NAME .Nm elf_next .Nd provide sequential access to the next archive member diff --git a/contrib/elftoolchain/libelf/elf_open.3 b/contrib/elftoolchain/libelf/elf_open.3 index 3dd1e36a03f4..acfbe8bc1cfd 100644 --- a/contrib/elftoolchain/libelf/elf_open.3 +++ b/contrib/elftoolchain/libelf/elf_open.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_open.3 3181 2015-04-10 13:22:51Z emaste $ +.\" $Id: elf_open.3 3643 2018-10-14 21:09:24Z jkoshy $ .\" .Dd May 31, 2012 -.Os .Dt ELF_OPEN 3 +.Os .Sh NAME .Nm elf_open .Nd open ELF objects and ar(1) archives @@ -67,6 +67,9 @@ archive contained in the memory area pointed to by the argument The argument .Ar sz specifies the size of the memory area in bytes. +.Sh RETURN VALUES +The function returns a pointer to a ELF descriptor if successful, or +NULL if an error occurred. .Sh COMPATIBILITY These functions are non-standard extensions to the ELF(3) API set. .Pp @@ -79,9 +82,6 @@ and .Xr ar 1 archives, returning an Elf descriptor of type .Dv ELF_K_NONE . -.Sh RETURN VALUES -The function returns a pointer to a ELF descriptor if successful, or -NULL if an error occurred. .Sh ERRORS These functions can fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" diff --git a/contrib/elftoolchain/libelf/elf_rand.3 b/contrib/elftoolchain/libelf/elf_rand.3 index e5affd6a3f7d..1a4696073f09 100644 --- a/contrib/elftoolchain/libelf/elf_rand.3 +++ b/contrib/elftoolchain/libelf/elf_rand.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_rand.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: elf_rand.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd June 17, 2006 -.Os .Dt ELF_RAND 3 +.Os .Sh NAME .Nm elf_rand .Nd provide sequential access to the next archive member diff --git a/contrib/elftoolchain/libelf/elf_rawfile.3 b/contrib/elftoolchain/libelf/elf_rawfile.3 index a713b4295305..355301cf6c12 100644 --- a/contrib/elftoolchain/libelf/elf_rawfile.3 +++ b/contrib/elftoolchain/libelf/elf_rawfile.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_rawfile.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: elf_rawfile.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd July 3, 2006 -.Os .Dt ELF_RAWFILE 3 +.Os .Sh NAME .Nm elf_rawfile .Nd return uninterpreted contents of an ELF file diff --git a/contrib/elftoolchain/libelf/elf_scn.c b/contrib/elftoolchain/libelf/elf_scn.c index d3e274715b78..b72fef66c46b 100644 --- a/contrib/elftoolchain/libelf/elf_scn.c +++ b/contrib/elftoolchain/libelf/elf_scn.c @@ -36,7 +36,7 @@ #include "_libelf.h" -ELFTC_VCSID("$Id: elf_scn.c 3177 2015-03-30 18:19:41Z emaste $"); +ELFTC_VCSID("$Id: elf_scn.c 3632 2018-10-10 21:12:43Z jkoshy $"); /* * Load an ELF section table and create a list of Elf_Scn structures. @@ -51,8 +51,7 @@ _libelf_load_section_headers(Elf *e, void *ehdr) int ec, swapbytes; unsigned char *src; size_t fsz, i, shnum; - int (*xlator)(unsigned char *_d, size_t _dsz, unsigned char *_s, - size_t _c, int _swap); + _libelf_translator_function *xlator; assert(e != NULL); assert(ehdr != NULL); @@ -84,7 +83,8 @@ _libelf_load_section_headers(Elf *e, void *ehdr) CHECK_EHDR(e, eh64); } - xlator = _libelf_get_translator(ELF_T_SHDR, ELF_TOMEMORY, ec); + xlator = _libelf_get_translator(ELF_T_SHDR, ELF_TOMEMORY, ec, + _libelf_elfmachine(e)); swapbytes = e->e_byteorder != LIBELF_PRIVATE(byteorder); src = e->e_rawfile + shoff; diff --git a/contrib/elftoolchain/libelf/elf_strptr.3 b/contrib/elftoolchain/libelf/elf_strptr.3 index 31e0f830a0af..8fb9118ebada 100644 --- a/contrib/elftoolchain/libelf/elf_strptr.3 +++ b/contrib/elftoolchain/libelf/elf_strptr.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_strptr.3 1081 2010-08-14 02:23:48Z jkoshy $ +.\" $Id: elf_strptr.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd December 16, 2006 -.Os .Dt ELF_STRPTR 3 +.Os .Sh NAME .Nm elf_strptr .Nd retrieve a string pointer in a string table diff --git a/contrib/elftoolchain/libelf/elf_update.3 b/contrib/elftoolchain/libelf/elf_update.3 index 40a1e40c2d50..b6419cf9bf53 100644 --- a/contrib/elftoolchain/libelf/elf_update.3 +++ b/contrib/elftoolchain/libelf/elf_update.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_update.3 1729 2011-08-14 09:13:00Z jkoshy $ +.\" $Id: elf_update.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd August 14, 2011 -.Os .Dt ELF_UPDATE 3 +.Os .Sh NAME .Nm elf_update .Nd update an ELF descriptor diff --git a/contrib/elftoolchain/libelf/elf_update.c b/contrib/elftoolchain/libelf/elf_update.c index 9f5230d1df19..755f33690e36 100644 --- a/contrib/elftoolchain/libelf/elf_update.c +++ b/contrib/elftoolchain/libelf/elf_update.c @@ -41,7 +41,7 @@ #include #endif -ELFTC_VCSID("$Id: elf_update.c 3190 2015-05-04 15:23:08Z jkoshy $"); +ELFTC_VCSID("$Id: elf_update.c 3632 2018-10-10 21:12:43Z jkoshy $"); /* * Layout strategy: @@ -712,8 +712,8 @@ _libelf_resync_elf(Elf *e, struct _Elf_Extent_List *extents) static off_t _libelf_write_scn(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) { - int ec; off_t rc; + int ec, em; Elf_Scn *s; int elftype; Elf_Data *d, dst; @@ -747,6 +747,11 @@ _libelf_write_scn(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) sh_off = s->s_offset; assert(sh_off % _libelf_falign(elftype, ec) == 0); + em = _libelf_elfmachine(e); +#if 0 + assert(em >= EM_NONE && em < EM__LAST__); +#endif + /* * If the section has a `rawdata' descriptor, and the section * contents have not been modified, use its contents directly. @@ -818,8 +823,8 @@ _libelf_write_scn(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) dst.d_buf = nf + rc; dst.d_size = fsz; - if (_libelf_xlate(&dst, d, e->e_byteorder, ec, ELF_TOFILE) == - NULL) + if (_libelf_xlate(&dst, d, e->e_byteorder, ec, em, ELF_TOFILE) + == NULL) return ((off_t) -1); rc += (off_t) fsz; @@ -835,7 +840,7 @@ _libelf_write_scn(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) static off_t _libelf_write_ehdr(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) { - int ec; + int ec, em; void *ehdr; size_t fsz, msz; Elf_Data dst, src; @@ -851,6 +856,8 @@ _libelf_write_ehdr(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) fsz = _libelf_fsize(ELF_T_EHDR, ec, e->e_version, (size_t) 1); msz = _libelf_msize(ELF_T_EHDR, ec, e->e_version); + em = _libelf_elfmachine(e); + (void) memset(&dst, 0, sizeof(dst)); (void) memset(&src, 0, sizeof(src)); @@ -862,7 +869,7 @@ _libelf_write_ehdr(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) dst.d_buf = nf; dst.d_size = fsz; - if (_libelf_xlate(&dst, &src, e->e_byteorder, ec, ELF_TOFILE) == + if (_libelf_xlate(&dst, &src, e->e_byteorder, ec, em, ELF_TOFILE) == NULL) return ((off_t) -1); @@ -876,7 +883,7 @@ _libelf_write_ehdr(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) static off_t _libelf_write_phdr(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) { - int ec; + int ec, em; void *ehdr; Elf32_Ehdr *eh32; Elf64_Ehdr *eh64; @@ -900,6 +907,8 @@ _libelf_write_phdr(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) phoff = eh64->e_phoff; } + em = _libelf_elfmachine(e); + assert(phoff > 0); assert(ex->ex_start == phoff); assert(phoff % _libelf_falign(ELF_T_PHDR, ec) == 0); @@ -919,7 +928,7 @@ _libelf_write_phdr(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) dst.d_size = fsz; dst.d_buf = nf + ex->ex_start; - if (_libelf_xlate(&dst, &src, e->e_byteorder, ec, ELF_TOFILE) == + if (_libelf_xlate(&dst, &src, e->e_byteorder, ec, em, ELF_TOFILE) == NULL) return ((off_t) -1); @@ -933,7 +942,7 @@ _libelf_write_phdr(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) static off_t _libelf_write_shdr(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) { - int ec; + int ec, em; void *ehdr; Elf_Scn *scn; uint64_t shoff; @@ -956,6 +965,8 @@ _libelf_write_shdr(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) shoff = eh64->e_shoff; } + em = _libelf_elfmachine(e); + assert(nscn > 0); assert(shoff % _libelf_falign(ELF_T_SHDR, ec) == 0); assert(ex->ex_start == shoff); @@ -978,8 +989,8 @@ _libelf_write_shdr(Elf *e, unsigned char *nf, struct _Elf_Extent *ex) dst.d_size = fsz; dst.d_buf = nf + ex->ex_start + scn->s_ndx * fsz; - if (_libelf_xlate(&dst, &src, e->e_byteorder, ec, - ELF_TOFILE) == NULL) + if (_libelf_xlate(&dst, &src, e->e_byteorder, ec, em, + ELF_TOFILE) == NULL) return ((off_t) -1); } diff --git a/contrib/elftoolchain/libelf/elf_version.3 b/contrib/elftoolchain/libelf/elf_version.3 index b09fb479cfae..b679aa7aaa03 100644 --- a/contrib/elftoolchain/libelf/elf_version.3 +++ b/contrib/elftoolchain/libelf/elf_version.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_version.3 2123 2011-11-09 15:40:09Z jkoshy $ +.\" $Id: elf_version.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd November 9, 2011 -.Os .Dt ELF_VERSION 3 +.Os .Sh NAME .Nm elf_version .Nd retrieve or set ELF library operating version diff --git a/contrib/elftoolchain/libelf/gelf.3 b/contrib/elftoolchain/libelf/gelf.3 index d00d5b330980..704ae154700f 100644 --- a/contrib/elftoolchain/libelf/gelf.3 +++ b/contrib/elftoolchain/libelf/gelf.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf.3 3195 2015-05-12 17:22:19Z emaste $ +.\" $Id: gelf.3 3643 2018-10-14 21:09:24Z jkoshy $ .\" .Dd September 1, 2006 -.Os .Dt GELF 3 +.Os .Sh NAME .Nm GElf .Nd class-independent API for ELF manipulation @@ -115,7 +115,7 @@ routines will signal an error if a GElf value is out of range for the underlying ELF data type. .Ss Namespace use The GElf interface uses the following symbols: -.Bl -tag +.Bl -tag -width indent .It GElf_* Class-independent data types. .It gelf_* @@ -125,16 +125,16 @@ For functions defined in the API set. This section provides an overview of the GElf programming APIs. Further information is provided in the manual page of each function listed here. -.Bl -tag +.Bl -tag -width indent .It "Allocating ELF Data Structures" -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn gelf_newehdr Allocate a new ELF Executable Header. .It Fn gelf_newphdr Allocate a new ELF Program Header Table. .El .It "Data Translation" -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn gelf_xlatetof Translate the native representation of an ELF data structure to its file representation. @@ -143,7 +143,7 @@ Translate from the file representation of an ELF data structure to a native representation. .El .It "Retrieving ELF Data" -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn gelf_getdyn Retrieve an ELF .Sy .dynamic @@ -162,7 +162,7 @@ Retrieve an ELF Section Header Table entry from the underlying ELF descriptor. Retrieve an ELF symbol table entry. .El .It Queries -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn gelf_checksum Retrieves the ELF checksum for an ELF descriptor. .It Fn gelf_fsize diff --git a/contrib/elftoolchain/libelf/gelf_checksum.3 b/contrib/elftoolchain/libelf/gelf_checksum.3 index e5f845f6c922..7972cb90cd55 100644 --- a/contrib/elftoolchain/libelf/gelf_checksum.3 +++ b/contrib/elftoolchain/libelf/gelf_checksum.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_checksum.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: gelf_checksum.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd August 29, 2006 -.Os .Dt GELF_CHECKSUM 3 +.Os .Sh NAME .Nm elf32_checksum , .Nm elf64_checksum , diff --git a/contrib/elftoolchain/libelf/gelf_fsize.3 b/contrib/elftoolchain/libelf/gelf_fsize.3 index ac7996f9296b..7103d69ba1c8 100644 --- a/contrib/elftoolchain/libelf/gelf_fsize.3 +++ b/contrib/elftoolchain/libelf/gelf_fsize.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_fsize.3 317 2009-03-06 17:29:22Z jkoshy $ +.\" $Id: gelf_fsize.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd February 5, 2008 -.Os .Dt GELF_FSIZE 3 +.Os .Sh NAME .Nm gelf_fsize , .Nm elf32_fsize , diff --git a/contrib/elftoolchain/libelf/gelf_getcap.3 b/contrib/elftoolchain/libelf/gelf_getcap.3 index ed8eb0275825..276933a8365a 100644 --- a/contrib/elftoolchain/libelf/gelf_getcap.3 +++ b/contrib/elftoolchain/libelf/gelf_getcap.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_getcap.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: gelf_getcap.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETCAP 3 +.Os .Sh NAME .Nm gelf_getcap , .Nm gelf_update_cap diff --git a/contrib/elftoolchain/libelf/gelf_getclass.3 b/contrib/elftoolchain/libelf/gelf_getclass.3 index 3504569fd141..f3d204995cd4 100644 --- a/contrib/elftoolchain/libelf/gelf_getclass.3 +++ b/contrib/elftoolchain/libelf/gelf_getclass.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_getclass.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: gelf_getclass.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd July 3, 2006 -.Os .Dt GELF_GETCLASS 3 +.Os .Sh NAME .Nm gelf_getclass .Nd retrieve the class of an ELF descriptor diff --git a/contrib/elftoolchain/libelf/gelf_getdyn.3 b/contrib/elftoolchain/libelf/gelf_getdyn.3 index f8c177876d07..a4e51ecd0ee2 100644 --- a/contrib/elftoolchain/libelf/gelf_getdyn.3 +++ b/contrib/elftoolchain/libelf/gelf_getdyn.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_getdyn.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: gelf_getdyn.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETDYN 3 +.Os .Sh NAME .Nm gelf_getdyn , .Nm gelf_update_dyn diff --git a/contrib/elftoolchain/libelf/gelf_getehdr.3 b/contrib/elftoolchain/libelf/gelf_getehdr.3 index 56bdcd405646..ce27ea7f0006 100644 --- a/contrib/elftoolchain/libelf/gelf_getehdr.3 +++ b/contrib/elftoolchain/libelf/gelf_getehdr.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_getehdr.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: gelf_getehdr.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd December 16, 2006 -.Os .Dt GELF_GETEHDR 3 +.Os .Sh NAME .Nm elf32_getehdr , .Nm elf64_getehdr , diff --git a/contrib/elftoolchain/libelf/gelf_getmove.3 b/contrib/elftoolchain/libelf/gelf_getmove.3 index 871a040ad447..64c52d9682ed 100644 --- a/contrib/elftoolchain/libelf/gelf_getmove.3 +++ b/contrib/elftoolchain/libelf/gelf_getmove.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_getmove.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: gelf_getmove.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETMOVE 3 +.Os .Sh NAME .Nm gelf_getmove , .Nm gelf_update_move diff --git a/contrib/elftoolchain/libelf/gelf_getphdr.3 b/contrib/elftoolchain/libelf/gelf_getphdr.3 index f2d38aa8316b..5ccac4aa6ff2 100644 --- a/contrib/elftoolchain/libelf/gelf_getphdr.3 +++ b/contrib/elftoolchain/libelf/gelf_getphdr.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_getphdr.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: gelf_getphdr.3 3643 2018-10-14 21:09:24Z jkoshy $ .\" .Dd October 21, 2007 -.Os .Dt GELF_GETPHDR 3 +.Os .Sh NAME .Nm elf32_getphdr , .Nm elf64_getphdr , @@ -66,7 +66,7 @@ Function will retrieve the program header table entry at index .Ar index from ELF descriptor -.Ar elf. +.Ar elf . The translated program header table entry will be written to the address pointed to be argument .Ar dst . diff --git a/contrib/elftoolchain/libelf/gelf_getrel.3 b/contrib/elftoolchain/libelf/gelf_getrel.3 index c7566e64e697..c21be0da8b46 100644 --- a/contrib/elftoolchain/libelf/gelf_getrel.3 +++ b/contrib/elftoolchain/libelf/gelf_getrel.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_getrel.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: gelf_getrel.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETREL 3 +.Os .Sh NAME .Nm gelf_getrel , .Nm gelf_update_rel diff --git a/contrib/elftoolchain/libelf/gelf_getrela.3 b/contrib/elftoolchain/libelf/gelf_getrela.3 index c77d52a4021d..946482e605ef 100644 --- a/contrib/elftoolchain/libelf/gelf_getrela.3 +++ b/contrib/elftoolchain/libelf/gelf_getrela.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_getrela.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: gelf_getrela.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETRELA 3 +.Os .Sh NAME .Nm gelf_getrela , .Nm gelf_update_rela diff --git a/contrib/elftoolchain/libelf/gelf_getshdr.3 b/contrib/elftoolchain/libelf/gelf_getshdr.3 index e92d414371d1..8bb06d6be57e 100644 --- a/contrib/elftoolchain/libelf/gelf_getshdr.3 +++ b/contrib/elftoolchain/libelf/gelf_getshdr.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_getshdr.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: gelf_getshdr.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd August 27, 2006 -.Os .Dt GELF_GETSHDR 3 +.Os .Sh NAME .Nm elf32_getshdr , .Nm elf64_getshdr , diff --git a/contrib/elftoolchain/libelf/gelf_getsym.3 b/contrib/elftoolchain/libelf/gelf_getsym.3 index 98d886f88223..a139c152d15d 100644 --- a/contrib/elftoolchain/libelf/gelf_getsym.3 +++ b/contrib/elftoolchain/libelf/gelf_getsym.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_getsym.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: gelf_getsym.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETSYM 3 +.Os .Sh NAME .Nm gelf_getsym , .Nm gelf_update_sym diff --git a/contrib/elftoolchain/libelf/gelf_getsyminfo.3 b/contrib/elftoolchain/libelf/gelf_getsyminfo.3 index a1169f80dc08..0f602c289795 100644 --- a/contrib/elftoolchain/libelf/gelf_getsyminfo.3 +++ b/contrib/elftoolchain/libelf/gelf_getsyminfo.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_getsyminfo.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: gelf_getsyminfo.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd August 29, 2006 -.Os .Dt GELF_GETSYMINFO 3 +.Os .Sh NAME .Nm gelf_getsyminfo , .Nm gelf_update_syminfo diff --git a/contrib/elftoolchain/libelf/gelf_getsymshndx.3 b/contrib/elftoolchain/libelf/gelf_getsymshndx.3 index b635aac6d514..595472a429e3 100644 --- a/contrib/elftoolchain/libelf/gelf_getsymshndx.3 +++ b/contrib/elftoolchain/libelf/gelf_getsymshndx.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_getsymshndx.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: gelf_getsymshndx.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd November 5, 2006 -.Os .Dt GELF_GETSYMSHNDX 3 +.Os .Sh NAME .Nm gelf_getsymshndx , .Nm gelf_update_symshndx diff --git a/contrib/elftoolchain/libelf/gelf_newehdr.3 b/contrib/elftoolchain/libelf/gelf_newehdr.3 index cba9de0c8fe5..38698c32e8b0 100644 --- a/contrib/elftoolchain/libelf/gelf_newehdr.3 +++ b/contrib/elftoolchain/libelf/gelf_newehdr.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_newehdr.3 3500 2016-12-04 11:08:44Z jkoshy $ +.\" $Id: gelf_newehdr.3 3643 2018-10-14 21:09:24Z jkoshy $ .\" .Dd October 22, 2007 -.Os .Dt GELF_NEWEHDR 3 +.Os .Sh NAME .Nm elf32_newehdr , .Nm elf64_newehdr , @@ -58,7 +58,8 @@ structure. Function .Fn elf64_newehdr returns a pointer to a 64 bit -.Vt Elf64_Ehdr structure. +.Vt Elf64_Ehdr +structure. .Pp When argument .Ar elfclass diff --git a/contrib/elftoolchain/libelf/gelf_newphdr.3 b/contrib/elftoolchain/libelf/gelf_newphdr.3 index 27e561d01052..a881aab4dd6e 100644 --- a/contrib/elftoolchain/libelf/gelf_newphdr.3 +++ b/contrib/elftoolchain/libelf/gelf_newphdr.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_newphdr.3 3500 2016-12-04 11:08:44Z jkoshy $ +.\" $Id: gelf_newphdr.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd October 22, 2007 -.Os .Dt GELF_NEWPHDR 3 +.Os .Sh NAME .Nm elf32_newphdr , .Nm elf64_newphdr , diff --git a/contrib/elftoolchain/libelf/gelf_update_ehdr.3 b/contrib/elftoolchain/libelf/gelf_update_ehdr.3 index f5e041d797b8..02cf51a2751e 100644 --- a/contrib/elftoolchain/libelf/gelf_update_ehdr.3 +++ b/contrib/elftoolchain/libelf/gelf_update_ehdr.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_update_ehdr.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: gelf_update_ehdr.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" .Dd August 27, 2006 -.Os .Dt GELF_UPDATE_EHDR 3 +.Os .Sh NAME .Nm gelf_update_ehdr , .Nm gelf_update_phdr , diff --git a/contrib/elftoolchain/libelf/gelf_xlate.c b/contrib/elftoolchain/libelf/gelf_xlate.c index f50181925f21..11618a4537af 100644 --- a/contrib/elftoolchain/libelf/gelf_xlate.c +++ b/contrib/elftoolchain/libelf/gelf_xlate.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006,2008 Joseph Koshy + * Copyright (c) 2006,2008,2018 Joseph Koshy * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,30 +30,34 @@ #include "_libelf.h" -ELFTC_VCSID("$Id: gelf_xlate.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: gelf_xlate.c 3632 2018-10-10 21:12:43Z jkoshy $"); Elf_Data * elf32_xlatetof(Elf_Data *dst, const Elf_Data *src, unsigned int encoding) { - return _libelf_xlate(dst, src, encoding, ELFCLASS32, ELF_TOFILE); + return _libelf_xlate(dst, src, encoding, ELFCLASS32, EM_NONE, + ELF_TOFILE); } Elf_Data * elf64_xlatetof(Elf_Data *dst, const Elf_Data *src, unsigned int encoding) { - return _libelf_xlate(dst, src, encoding, ELFCLASS64, ELF_TOFILE); + return _libelf_xlate(dst, src, encoding, ELFCLASS64, EM_NONE, + ELF_TOFILE); } Elf_Data * elf32_xlatetom(Elf_Data *dst, const Elf_Data *src, unsigned int encoding) { - return _libelf_xlate(dst, src, encoding, ELFCLASS32, ELF_TOMEMORY); + return _libelf_xlate(dst, src, encoding, ELFCLASS32, EM_NONE, + ELF_TOMEMORY); } Elf_Data * elf64_xlatetom(Elf_Data *dst, const Elf_Data *src, unsigned int encoding) { - return _libelf_xlate(dst, src, encoding, ELFCLASS64, ELF_TOMEMORY); + return _libelf_xlate(dst, src, encoding, ELFCLASS64, EM_NONE, + ELF_TOMEMORY); } Elf_Data * @@ -62,7 +66,7 @@ gelf_xlatetom(Elf *e, Elf_Data *dst, const Elf_Data *src, { if (e != NULL) return (_libelf_xlate(dst, src, encoding, e->e_class, - ELF_TOMEMORY)); + _libelf_elfmachine(e), ELF_TOMEMORY)); LIBELF_SET_ERROR(ARGUMENT, 0); return (NULL); } @@ -73,7 +77,7 @@ gelf_xlatetof(Elf *e, Elf_Data *dst, const Elf_Data *src, { if (e != NULL) return (_libelf_xlate(dst, src, encoding, e->e_class, - ELF_TOFILE)); + _libelf_elfmachine(e), ELF_TOFILE)); LIBELF_SET_ERROR(ARGUMENT, 0); return (NULL); } diff --git a/contrib/elftoolchain/libelf/gelf_xlatetof.3 b/contrib/elftoolchain/libelf/gelf_xlatetof.3 index ca90002096eb..2e5ee0fe15e0 100644 --- a/contrib/elftoolchain/libelf/gelf_xlatetof.3 +++ b/contrib/elftoolchain/libelf/gelf_xlatetof.3 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. +.\" Copyright (c) 2006,2008,2018 Joseph Koshy. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_xlatetof.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: gelf_xlatetof.3 3639 2018-10-14 14:07:02Z jkoshy $ .\" -.Dd July 24, 2006 -.Os +.Dd October 11, 2018 .Dt GELF_XLATETOF 3 +.Os .Sh NAME .Nm elf32_xlate , .Nm elf64_xlate , @@ -36,36 +36,39 @@ .Sh SYNOPSIS .In libelf.h .Ft "Elf_Data *" -.Fn elf32_xlatetof "Elf_Data *dst" "Elf_Data *src" "unsigned int encode" +.Fn elf32_xlatetof "Elf_Data *dst" "Elf_Data *src" "unsigned int file_encoding" .Ft "Elf_Data *" -.Fn elf32_xlatetom "Elf_Data *dst" "Elf_Data *src" "unsigned int encode" +.Fn elf32_xlatetom "Elf_Data *dst" "Elf_Data *src" "unsigned int file_encoding" .Ft "Elf_Data *" -.Fn elf64_xlatetof "Elf_Data *dst" "Elf_Data *src" "unsigned int encode" +.Fn elf64_xlatetof "Elf_Data *dst" "Elf_Data *src" "unsigned int file_encoding" .Ft "Elf_Data *" -.Fn elf64_xlatetom "Elf_Data *dst" "Elf_Data *src" "unsigned int encode" +.Fn elf64_xlatetom "Elf_Data *dst" "Elf_Data *src" "unsigned int file_encoding" .In gelf.h .Ft "Elf_Data *" .Fo gelf_xlatetof .Fa "Elf *elf" .Fa "Elf_Data *dst" .Fa "Elf_Data *src" -.Fa "unsigned int encode" +.Fa "unsigned int file_encoding" .Fc .Ft "Elf_Data *" .Fo gelf_xlatetom .Fa "Elf *elf" .Fa "Elf_Data *dst" .Fa "Elf_Data *src" -.Fa "unsigned int encode" +.Fa "unsigned int file_encoding" .Fc .Sh DESCRIPTION These functions translate between the file and memory representations of ELF data structures. -The in-memory representation of an ELF data structure would confirm to +The in-memory representation of an ELF data structure would conform to the byte ordering and data alignment restrictions dictated by the host processor. -A file representation of the same data structure could use a non-native byte -ordering and in addition may be laid out differently with the file. +As described in +.Xr elf 3 , +the file representation of this data structure could use a different byte +ordering from that of the host, or could use a different layout within +the file. .Pp Functions .Fn elf32_xlatetom , @@ -153,7 +156,7 @@ value of the source data descriptor. .El .Pp Argument -.Ar encode +.Ar file_encoding specifies the encoding in which the file objects are represented. It must be one of: .Bl -hang -offset indent @@ -169,14 +172,41 @@ The functions .Fn gelf_xlatetof and .Fn gelf_xlatetom -select the appropriate 32 or 64 bit translations based on the class of argument +select the appropriate translation scheme based on the properties of +argument .Ar elf . .Sh RETURN VALUES These functions return argument .Ar dst if successful, or NULL in case of an error. .Sh EXAMPLES -TODO +To translate a +.Vt GElf_Rel +structure to its LSB file representation use: +.Bd -literal -offset indent +Elf_Data dst, src; +GElf_Rel rel; +Elf *e; + +e = ...; /* See elf_begin(3). */ + +/* Set up the 'src' descriptor. */ +memset(&src, 0, sizeof src); +src.d_buf = &rel; +src.d_size = sizeof(rel); +src.d_type = ELF_T_REL; +src.d_version = EV_CURRENT; + +/* Set up the 'dst' descriptor. */ +memset(&dst, 0, sizeof dst); +dst.d_buf = filebuf; +dst.d_size = gelf_fsize(e, ELF_T_REL, 1, EV_CURRENT); +dst.d_version = EV_CURRENT; + +if (gelf_xlatetof(e, &dst, &src, ELFDATA2LSB) == NULL) { + printf("error: %s", elf_errmsg(0)); +} +.Ed .Sh ERRORS These functions may fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" diff --git a/contrib/elftoolchain/libelf/libelf_convert.m4 b/contrib/elftoolchain/libelf/libelf_convert.m4 index ec395902a182..04a838b502f3 100644 --- a/contrib/elftoolchain/libelf/libelf_convert.m4 +++ b/contrib/elftoolchain/libelf/libelf_convert.m4 @@ -30,7 +30,7 @@ #include "_libelf.h" -ELFTC_VCSID("$Id: libelf_convert.m4 3429 2016-03-12 04:12:39Z emaste $"); +ELFTC_VCSID("$Id: libelf_convert.m4 3632 2018-10-10 21:12:43Z jkoshy $"); /* WARNING: GENERATED FROM __file__. */ @@ -1070,11 +1070,17 @@ CONVERTER_NAMES(ELF_TYPE_LIST) } }; -int (*_libelf_get_translator(Elf_Type t, int direction, int elfclass)) - (unsigned char *_dst, size_t dsz, unsigned char *_src, size_t _cnt, - int _byteswap) +/* + * Return a translator function for the specified ELF section type, conversion + * direction, ELF class and ELF machine. + */ +_libelf_translator_function * +_libelf_get_translator(Elf_Type t, int direction, int elfclass, int elfmachine) { assert(elfclass == ELFCLASS32 || elfclass == ELFCLASS64); +#if 0 + assert(elfmachine >= EM_NONE && elfmachine < EM__LAST__); +#endif assert(direction == ELF_TOFILE || direction == ELF_TOMEMORY); if (t >= ELF_T_NUM || @@ -1082,6 +1088,9 @@ int (*_libelf_get_translator(Elf_Type t, int direction, int elfclass)) (direction != ELF_TOFILE && direction != ELF_TOMEMORY)) return (NULL); + /* TODO: Handle MIPS64 REL{,A} sections (ticket #559). */ + (void) elfmachine; + return ((elfclass == ELFCLASS32) ? (direction == ELF_TOFILE ? cvt[t].tof32 : cvt[t].tom32) : (direction == ELF_TOFILE ? cvt[t].tof64 : cvt[t].tom64)); diff --git a/contrib/elftoolchain/libelf/libelf_ehdr.c b/contrib/elftoolchain/libelf/libelf_ehdr.c index 6630e6eba73e..38e4e74e14d2 100644 --- a/contrib/elftoolchain/libelf/libelf_ehdr.c +++ b/contrib/elftoolchain/libelf/libelf_ehdr.c @@ -31,7 +31,7 @@ #include "_libelf.h" -ELFTC_VCSID("$Id: libelf_ehdr.c 3575 2017-09-14 02:13:36Z emaste $"); +ELFTC_VCSID("$Id: libelf_ehdr.c 3632 2018-10-10 21:12:43Z jkoshy $"); /* * Retrieve counts for sections, phdrs and the section string table index @@ -41,11 +41,10 @@ static int _libelf_load_extended(Elf *e, int ec, uint64_t shoff, uint16_t phnum, uint16_t strndx) { - Elf_Scn *scn; size_t fsz; - int (*xlator)(unsigned char *_d, size_t _dsz, unsigned char *_s, - size_t _c, int _swap); + Elf_Scn *scn; uint32_t shtype; + _libelf_translator_function *xlator; assert(STAILQ_EMPTY(&e->e_u.e_elf.e_scn)); @@ -60,7 +59,8 @@ _libelf_load_extended(Elf *e, int ec, uint64_t shoff, uint16_t phnum, if ((scn = _libelf_allocate_scn(e, (size_t) 0)) == NULL) return (0); - xlator = _libelf_get_translator(ELF_T_SHDR, ELF_TOMEMORY, ec); + xlator = _libelf_get_translator(ELF_T_SHDR, ELF_TOMEMORY, ec, + _libelf_elfmachine(e)); (*xlator)((unsigned char *) &scn->s_shdr, sizeof(scn->s_shdr), (unsigned char *) e->e_rawfile + shoff, (size_t) 1, e->e_byteorder != LIBELF_PRIVATE(byteorder)); @@ -166,7 +166,8 @@ _libelf_ehdr(Elf *e, int ec, int allocate) if (e->e_cmd == ELF_C_WRITE) return (ehdr); - xlator = _libelf_get_translator(ELF_T_EHDR, ELF_TOMEMORY, ec); + xlator = _libelf_get_translator(ELF_T_EHDR, ELF_TOMEMORY, ec, + _libelf_elfmachine(e)); (*xlator)((unsigned char*) ehdr, msz, e->e_rawfile, (size_t) 1, e->e_byteorder != LIBELF_PRIVATE(byteorder)); diff --git a/contrib/elftoolchain/libelf/libelf_elfmachine.c b/contrib/elftoolchain/libelf/libelf_elfmachine.c new file mode 100644 index 000000000000..f9c423950886 --- /dev/null +++ b/contrib/elftoolchain/libelf/libelf_elfmachine.c @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2018 Joseph Koshy + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +#include "_libelf.h" + +ELFTC_VCSID("$Id$"); + +/* + * A convenience helper that returns the ELF machine architecture for + * a ELF descriptor. + */ +int +_libelf_elfmachine(Elf *e) +{ + Elf32_Ehdr *eh32; + Elf64_Ehdr *eh64; + + if (!e) + return EM_NONE; + + assert(e->e_kind == ELF_K_ELF); + assert(e->e_class != ELFCLASSNONE); + + eh32 = NULL; + eh64 = NULL; + + switch (e->e_class) { + case ELFCLASS32: + eh32 = e->e_u.e_elf.e_ehdr.e_ehdr32; + return eh32 ? eh32->e_machine : EM_NONE; + case ELFCLASS64: + eh64 = e->e_u.e_elf.e_ehdr.e_ehdr64; + return eh64 ? eh64->e_machine : EM_NONE; + } + + return (EM_NONE); +} diff --git a/contrib/elftoolchain/libelf/libelf_phdr.c b/contrib/elftoolchain/libelf/libelf_phdr.c index ba872bbb9744..336ef3877f6f 100644 --- a/contrib/elftoolchain/libelf/libelf_phdr.c +++ b/contrib/elftoolchain/libelf/libelf_phdr.c @@ -31,7 +31,7 @@ #include "_libelf.h" -ELFTC_VCSID("$Id: libelf_phdr.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: libelf_phdr.c 3632 2018-10-10 21:12:43Z jkoshy $"); void * _libelf_getphdr(Elf *e, int ec) @@ -42,8 +42,7 @@ _libelf_getphdr(Elf *e, int ec) Elf32_Ehdr *eh32; Elf64_Ehdr *eh64; void *ehdr, *phdr; - int (*xlator)(unsigned char *_d, size_t _dsz, unsigned char *_s, - size_t _c, int _swap); + _libelf_translator_function *xlator; assert(ec == ELFCLASS32 || ec == ELFCLASS64); @@ -98,7 +97,8 @@ _libelf_getphdr(Elf *e, int ec) e->e_u.e_elf.e_phdr.e_phdr64 = phdr; - xlator = _libelf_get_translator(ELF_T_PHDR, ELF_TOMEMORY, ec); + xlator = _libelf_get_translator(ELF_T_PHDR, ELF_TOMEMORY, ec, + _libelf_elfmachine(e)); (*xlator)(phdr, phnum * msz, e->e_rawfile + phoff, phnum, e->e_byteorder != LIBELF_PRIVATE(byteorder)); diff --git a/contrib/elftoolchain/libelf/libelf_xlate.c b/contrib/elftoolchain/libelf/libelf_xlate.c index 6ee76244b83e..cfe6a0bdfdbd 100644 --- a/contrib/elftoolchain/libelf/libelf_xlate.c +++ b/contrib/elftoolchain/libelf/libelf_xlate.c @@ -29,7 +29,7 @@ #include "_libelf.h" -ELFTC_VCSID("$Id: libelf_xlate.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: libelf_xlate.c 3632 2018-10-10 21:12:43Z jkoshy $"); /* * Translate to/from the file representation of ELF objects. @@ -45,11 +45,12 @@ ELFTC_VCSID("$Id: libelf_xlate.c 3174 2015-03-27 17:13:41Z emaste $"); Elf_Data * _libelf_xlate(Elf_Data *dst, const Elf_Data *src, unsigned int encoding, - int elfclass, int direction) + int elfclass, int elfmachine, int direction) { int byteswap; size_t cnt, dsz, fsz, msz; uintptr_t sb, se, db, de; + _libelf_translator_function *xlator; if (encoding == ELFDATANONE) encoding = LIBELF_PRIVATE(byteorder); @@ -138,8 +139,9 @@ _libelf_xlate(Elf_Data *dst, const Elf_Data *src, unsigned int encoding, (db == sb && !byteswap && fsz == msz)) return (dst); /* nothing more to do */ - if (!(_libelf_get_translator(src->d_type, direction, elfclass)) - (dst->d_buf, dsz, src->d_buf, cnt, byteswap)) { + xlator = _libelf_get_translator(src->d_type, direction, elfclass, + elfmachine); + if (!xlator(dst->d_buf, dsz, src->d_buf, cnt, byteswap)) { LIBELF_SET_ERROR(DATA, 0); return (NULL); } diff --git a/contrib/elftoolchain/libelftc/elftc.3 b/contrib/elftoolchain/libelftc/elftc.3 index bbf51738bb20..08b3f5293dc0 100644 --- a/contrib/elftoolchain/libelftc/elftc.3 +++ b/contrib/elftoolchain/libelftc/elftc.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elftc.3 2818 2012-12-24 12:32:48Z jkoshy $ +.\" $Id: elftc.3 3645 2018-10-15 20:17:14Z jkoshy $ .\" .Dd December 24, 2012 -.Os .Dt ELFTC 3 +.Os .Sh NAME .Nm elftc .Nd support routines used in the Elftoolchain project @@ -46,7 +46,7 @@ manual pages for the functions listed below. .Ss Functional Grouping .Bl -tag -width indent .It "Binary Object Handling" -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn elftc_bfd_find_target Locate a binary object descriptor. .It Fn elftc_bfd_target_class @@ -59,20 +59,20 @@ Query the object format for a binary object descriptor. Query the target machine for a binary object descriptor. .El .It "C++ support" -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn elftc_demangle Decodes a symbol name encoded according to the encoding rules for the C++ language. .El .It "Programming conveniences" -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn elftc_copyfile Copies the contents of a file to another. .It Fn elftc_set_timestamp Portably set the time stamps on a file. .El .It "Project Configuration" -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn elftc_version Returns a project-wide identifier string that encodes the source revision of the source tree. diff --git a/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 b/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 index 302c319f0b83..39d72b05341f 100644 --- a/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 +++ b/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elftc_bfd_find_target.3 3516 2017-02-10 02:33:08Z emaste $ +.\" $Id: elftc_bfd_find_target.3 3645 2018-10-15 20:17:14Z jkoshy $ .\" .Dd November 30, 2011 +.Dt ELFTC_BFD_FIND_TARGET 3 .Os -.Dt ELFTC_BFD_FIND_TARGET .Sh NAME .Nm elftc_bfd_find_target , .Nm elftc_bfd_target_byteorder , diff --git a/contrib/elftoolchain/libelftc/elftc_copyfile.3 b/contrib/elftoolchain/libelftc/elftc_copyfile.3 index 45204338bac7..2e0a7dd82f69 100644 --- a/contrib/elftoolchain/libelftc/elftc_copyfile.3 +++ b/contrib/elftoolchain/libelftc/elftc_copyfile.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elftc_copyfile.3 2315 2011-12-11 09:28:55Z jkoshy $ +.\" $Id: elftc_copyfile.3 3645 2018-10-15 20:17:14Z jkoshy $ .\" .Dd December 11, 2011 -.Os .Dt ELFTC_COPYFILE 3 +.Os .Sh NAME .Nm elftc_copyfile .Nd convenience function to copy data @@ -51,23 +51,23 @@ offset at the beginning of the file. The argument .Ar ofd should contain a file descriptor opened for writing. -.Sh RETURN VALUE +.Sh RETURN VALUES .Rv -std .Sh ERRORS The function .Fn elftc_copyfile may fail with any of the errors returned by .Xr fstat 2 , -.Xr malloc 3 , -.Xr mmap 2 , -.Xr munmap 2 , -.Xr read 2 -or -.Xr write 2 . -.Sh SEE ALSO -.Xr fstat 2 , -.Xr malloc 3 , .Xr mmap 2 , .Xr munmap 2 , .Xr read 2 , -.Xr write 2 +.Xr write 2 , +or +.Xr malloc 3 . +.Sh SEE ALSO +.Xr fstat 2 , +.Xr mmap 2 , +.Xr munmap 2 , +.Xr read 2 , +.Xr write 2 , +.Xr malloc 3 diff --git a/contrib/elftoolchain/libelftc/elftc_demangle.3 b/contrib/elftoolchain/libelftc/elftc_demangle.3 index 44cf0073ca55..2b222eabbf74 100644 --- a/contrib/elftoolchain/libelftc/elftc_demangle.3 +++ b/contrib/elftoolchain/libelftc/elftc_demangle.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elftc_demangle.3 3182 2015-04-10 16:08:10Z emaste $ +.\" $Id: elftc_demangle.3 3645 2018-10-15 20:17:14Z jkoshy $ .\" .Dd August 24, 2011 -.Os .Dt ELFTC_DEMANGLE 3 +.Os .Sh NAME .Nm elftc_demangle .Nd demangle a C++ name @@ -76,7 +76,7 @@ Argument may be zero, in which case the function will attempt to guess the encoding scheme from the contents of .Ar encodedname . -.Sh RETURN VALUE +.Sh RETURN VALUES Function .Fn elftc_demangle returns 0 on success. diff --git a/contrib/elftoolchain/libelftc/elftc_reloc_type_str.3 b/contrib/elftoolchain/libelftc/elftc_reloc_type_str.3 index 5cd08a6933bd..2f4644af842b 100644 --- a/contrib/elftoolchain/libelftc/elftc_reloc_type_str.3 +++ b/contrib/elftoolchain/libelftc/elftc_reloc_type_str.3 @@ -27,8 +27,8 @@ .\" $Id$ .\" .Dd February 19, 2016 -.Os .Dt ELFTC_RELOC_TYPE_STR 3 +.Os .Sh NAME .Nm elftc_reloc_type_str .Nd return the type name for an ELF relocation @@ -52,7 +52,7 @@ specifies the machine (architecture) type. Argument .Ar type specifies the relocation value. -.Sh RETURN VALUE +.Sh RETURN VALUES Function .Fn elftc_program_version returns a pointer to a string constant, or to an internal character buffer diff --git a/contrib/elftoolchain/libelftc/elftc_set_timestamps.3 b/contrib/elftoolchain/libelftc/elftc_set_timestamps.3 index 115fe92707a3..b6d4898c2391 100644 --- a/contrib/elftoolchain/libelftc/elftc_set_timestamps.3 +++ b/contrib/elftoolchain/libelftc/elftc_set_timestamps.3 @@ -24,8 +24,8 @@ .\" $Id$ .\" .Dd December 15, 2011 -.Os .Dt ELFTC_SET_TIMESTAMPS 3 +.Os .Sh NAME .Nm elftc_set_timestamps .Nd set file timestamps @@ -81,4 +81,4 @@ if (elftc_set_timestamps(new_filename, &sb) < 0) .Xr fstat 2 , .Xr stat 2 , .Xr utime 2 , -.Xr utimes 2 . +.Xr utimes 2 diff --git a/contrib/elftoolchain/libelftc/elftc_string_table_create.3 b/contrib/elftoolchain/libelftc/elftc_string_table_create.3 index e11e73cc4a51..387ad72a3727 100644 --- a/contrib/elftoolchain/libelftc/elftc_string_table_create.3 +++ b/contrib/elftoolchain/libelftc/elftc_string_table_create.3 @@ -22,11 +22,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elftc_string_table_create.3 2866 2013-01-06 03:20:14Z jkoshy $ +.\" $Id: elftc_string_table_create.3 3645 2018-10-15 20:17:14Z jkoshy $ .\" .Dd January 5, 2013 -.Os .Dt ELFTC_STRING_TABLE_CREATE 3 +.Os .Sh NAME .Nm elftc_string_table_create , .Nm elftc_string_table_destroy , @@ -177,7 +177,6 @@ The library manages its own memory allocations. The application should not free the pointers returned by the string table functions. -.El .Sh IMPLEMENTATION NOTES The current implementation is optimized for the case where strings are added to a string table, but rarely removed from it. diff --git a/contrib/elftoolchain/libelftc/elftc_timestamp.3 b/contrib/elftoolchain/libelftc/elftc_timestamp.3 index 3c56f2fe5b9e..a62570258013 100644 --- a/contrib/elftoolchain/libelftc/elftc_timestamp.3 +++ b/contrib/elftoolchain/libelftc/elftc_timestamp.3 @@ -27,8 +27,8 @@ .\" $Id$ .\" .Dd August 24, 2016 -.Os .Dt ELFTC_TIMESTAMP 3 +.Os .Sh NAME .Nm elftc_timestamp .Nd return the current or environment-provided timestamp @@ -53,7 +53,7 @@ The .Ar timestamp argument specifies a pointer to the location where the timestamp will be stored. -.Sh RETURN VALUE +.Sh RETURN VALUES Function .Fn elftc_timestamp returns 0 on success, and -1 in the event of an error. diff --git a/contrib/elftoolchain/libelftc/elftc_version.3 b/contrib/elftoolchain/libelftc/elftc_version.3 index f7018a50d087..b61acad515cd 100644 --- a/contrib/elftoolchain/libelftc/elftc_version.3 +++ b/contrib/elftoolchain/libelftc/elftc_version.3 @@ -21,11 +21,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elftc_version.3 2828 2012-12-30 04:41:27Z jkoshy $ +.\" $Id: elftc_version.3 3645 2018-10-15 20:17:14Z jkoshy $ .\" .Dd December 30, 2012 -.Os .Dt ELFTC_VERSION 3 +.Os .Sh NAME .Nm elftc_version .Nd return a project-wide version identifier string @@ -54,7 +54,7 @@ The operating system that the tool chain was compiled for. A tree-wide version number extracted from the version control system in use. .El -.Sh RETURN VALUE +.Sh RETURN VALUES Function .Fn elftc_program_version returns a pointer to an internal character buffer. @@ -68,7 +68,9 @@ To retrieve and print the current toolchain version identifier, use: .Ed .Pp On the HEAD branch of the project's sources, when checked out using -Subversion and compiled on a NetBSD host, this would print: +Subversion and compiled on a +.Nx +host, this would print: .D1 Dq elftoolchain HEAD NetBSD svn: Ns Em REVINFO where .Em REVINFO diff --git a/contrib/elftoolchain/nm/nm.1 b/contrib/elftoolchain/nm/nm.1 index d10b8e15b8a2..3786caa8ad6e 100644 --- a/contrib/elftoolchain/nm/nm.1 +++ b/contrib/elftoolchain/nm/nm.1 @@ -22,11 +22,11 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Id: nm.1 3573 2017-09-14 02:06:31Z emaste $ +.\" $Id: nm.1 3642 2018-10-14 14:24:28Z jkoshy $ .\" .Dd September 13, 2017 -.Os .Dt NM 1 +.Os .Sh NAME .Nm nm .Nd display symbolic information in object files diff --git a/contrib/elftoolchain/readelf/readelf.1 b/contrib/elftoolchain/readelf/readelf.1 index 0741238c9261..9df20621c278 100644 --- a/contrib/elftoolchain/readelf/readelf.1 +++ b/contrib/elftoolchain/readelf/readelf.1 @@ -22,11 +22,11 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Id: readelf.1 3486 2016-08-22 14:10:05Z emaste $ +.\" $Id: readelf.1 3642 2018-10-14 14:24:28Z jkoshy $ .\" .Dd September 13, 2012 -.Os .Dt READELF 1 +.Os .Sh NAME .Nm readelf .Nd display information about ELF objects diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c index b60279b83260..5c202ca87b3f 100644 --- a/contrib/elftoolchain/readelf/readelf.c +++ b/contrib/elftoolchain/readelf/readelf.c @@ -47,7 +47,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: readelf.c 3580 2017-09-15 23:29:59Z emaste $"); +ELFTC_VCSID("$Id: readelf.c 3649 2018-11-24 03:26:23Z emaste $"); /* Backwards compatability for older FreeBSD releases. */ #ifndef STB_GNU_UNIQUE diff --git a/contrib/elftoolchain/strings/strings.c b/contrib/elftoolchain/strings/strings.c index cea2b0656de8..b78956c0310b 100644 --- a/contrib/elftoolchain/strings/strings.c +++ b/contrib/elftoolchain/strings/strings.c @@ -46,7 +46,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: strings.c 3571 2017-09-14 02:04:50Z emaste $"); +ELFTC_VCSID("$Id: strings.c 3648 2018-11-22 23:26:43Z emaste $"); enum radix_style { RADIX_DECIMAL, diff --git a/lib/libelf/Makefile b/lib/libelf/Makefile index 0fa80f5a0c49..76a2fddd5df2 100644 --- a/lib/libelf/Makefile +++ b/lib/libelf/Makefile @@ -60,6 +60,7 @@ SRCS= elf.c \ libelf_checksum.c \ libelf_data.c \ libelf_ehdr.c \ + libelf_elfmachine.c \ libelf_extended.c \ libelf_memory.c \ libelf_open.c \ diff --git a/lib/libelftc/elftc_version.c b/lib/libelftc/elftc_version.c index 0ef999d63cd2..43aeb950892f 100644 --- a/lib/libelftc/elftc_version.c +++ b/lib/libelftc/elftc_version.c @@ -6,5 +6,5 @@ const char * elftc_version(void) { - return "elftoolchain r3614M"; + return "elftoolchain r3668M"; }