Module Name: src Committed By: jkoshy Date: Mon Mar 8 20:55:06 UTC 2021
Modified Files: src/external/bsd/elftoolchain/dist/libelf: elf.3 elf_begin.3 elf_cntl.3 elf_end.3 elf_errmsg.3 elf_fill.3 elf_flagdata.3 elf_getarhdr.3 elf_getarsym.3 elf_getbase.3 elf_getdata.3 elf_getident.3 elf_getphdrnum.3 elf_getphnum.3 elf_getscn.3 elf_getshdrnum.3 elf_getshdrstrndx.3 elf_getshnum.3 elf_getshstrndx.3 elf_hash.3 elf_kind.3 elf_memory.3 elf_next.3 elf_open.3 elf_rand.3 elf_rawfile.3 elf_strptr.3 elf_update.3 elf_version.3 gelf.3 gelf_checksum.3 gelf_fsize.3 gelf_getcap.3 gelf_getclass.3 gelf_getdyn.3 gelf_getehdr.3 gelf_getmove.3 gelf_getphdr.3 gelf_getrel.3 gelf_getrela.3 gelf_getshdr.3 gelf_getsym.3 gelf_getsyminfo.3 gelf_getsymshndx.3 gelf_newehdr.3 gelf_newphdr.3 gelf_update_ehdr.3 gelf_xlatetof.3 Log Message: Update libelf's manual pages to upstream revision [r3928]. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/bsd/elftoolchain/dist/libelf/elf.3 cvs rdiff -u -r1.3 -r1.4 \ src/external/bsd/elftoolchain/dist/libelf/elf_begin.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_cntl.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_end.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_errmsg.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_fill.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_flagdata.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_getarhdr.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_getarsym.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_getbase.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_getdata.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_getident.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_getphdrnum.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_getphnum.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_getscn.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_getshdrnum.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_getshdrstrndx.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_getshnum.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_getshstrndx.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_hash.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_kind.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_memory.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_next.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_open.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_rand.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_rawfile.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_strptr.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_update.3 \ src/external/bsd/elftoolchain/dist/libelf/elf_version.3 \ src/external/bsd/elftoolchain/dist/libelf/gelf.3 \ src/external/bsd/elftoolchain/dist/libelf/gelf_checksum.3 \ src/external/bsd/elftoolchain/dist/libelf/gelf_fsize.3 \ src/external/bsd/elftoolchain/dist/libelf/gelf_getcap.3 \ src/external/bsd/elftoolchain/dist/libelf/gelf_getclass.3 \ src/external/bsd/elftoolchain/dist/libelf/gelf_getdyn.3 \ src/external/bsd/elftoolchain/dist/libelf/gelf_getehdr.3 \ src/external/bsd/elftoolchain/dist/libelf/gelf_getmove.3 \ src/external/bsd/elftoolchain/dist/libelf/gelf_getphdr.3 \ src/external/bsd/elftoolchain/dist/libelf/gelf_getrel.3 \ src/external/bsd/elftoolchain/dist/libelf/gelf_getrela.3 \ src/external/bsd/elftoolchain/dist/libelf/gelf_getshdr.3 \ src/external/bsd/elftoolchain/dist/libelf/gelf_getsym.3 \ src/external/bsd/elftoolchain/dist/libelf/gelf_getsyminfo.3 \ src/external/bsd/elftoolchain/dist/libelf/gelf_getsymshndx.3 \ src/external/bsd/elftoolchain/dist/libelf/gelf_newehdr.3 \ src/external/bsd/elftoolchain/dist/libelf/gelf_newphdr.3 \ src/external/bsd/elftoolchain/dist/libelf/gelf_update_ehdr.3 \ src/external/bsd/elftoolchain/dist/libelf/gelf_xlatetof.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/bsd/elftoolchain/dist/libelf/elf.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf.3:1.4 src/external/bsd/elftoolchain/dist/libelf/elf.3:1.5 --- src/external/bsd/elftoolchain/dist/libelf/elf.3:1.4 Thu Apr 28 07:06:11 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf.3 Mon Mar 8 20:55:06 2021 @@ -1,6 +1,6 @@ -.\" $NetBSD: elf.3,v 1.4 2016/04/28 07:06:11 wiz Exp $ +.\" $NetBSD: elf.3,v 1.5 2021/03/08 20:55:06 jkoshy Exp $ .\" -.\" Copyright (c) 2006-2008,2011 Joseph Koshy. All rights reserved. +.\" Copyright (c) 2006-2008,2011,2019 Joseph Koshy. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,11 +23,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 3927 2021-03-07 17:22:22Z jkoshy .\" -.Dd July 28, 2014 -.Os +.Dd March 7, 2021 .Dt ELF 3 +.Os .Sh NAME .Nm elf .Nd API for manipulating ELF objects @@ -52,7 +52,7 @@ section numbering. This manual page serves to provide an overview of the functionality in the ELF library. Further information may found in the manual pages for individual -.Nm +.Xr ELF 3 functions that comprise the library. .Ss ELF Concepts As described in @@ -93,7 +93,7 @@ This version number determines the layou of an ELF file and the semantics associated with these. .Ss Data Representation And Translation The -.Nm +.Xr ELF 3 library distinguishes between .Dq native representations of ELF data structures and their @@ -111,16 +111,19 @@ and follow different constraints on obje constraints. .Pp Accordingly, the -.Nm +.Xr ELF 3 library offers translation facilities .Xr ( elf32_xlatetof 3 , .Xr elf32_xlatetom 3 , .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: @@ -157,7 +160,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. @@ -239,7 +242,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 @@ -266,36 +268,43 @@ The operating version for the data in th .El .Pp .Vt Elf_Data -descriptors are usually associated with +descriptors are usually used in conjunction with .Vt Elf_Scn descriptors. -Existing data descriptors associated with an ELF section may be -structures are retrieved using the -.Fn elf_getdata -and -.Fn elf_rawdata -functions. -The -.Fn elf_newdata -function may be used to attach new data descriptors to an ELF section. .It Vt Elf_Scn .Vt Elf_Scn -descriptors represent a section in an ELF object. +descriptors represent sections in an ELF object. +These descriptors are opaque and contain no application modifiable +fields. .Pp -They are retrieved using the +The +.Vt Elf_Scn +descriptor for a specific section in an ELF object can be +retrieved using the .Fn elf_getscn function. -An application may iterate through the existing sections of an ELF -object using the +The sections contained in an ELF object can be traversed using the .Fn elf_nextscn function. -New sections may be allocated using the +New sections are allocated using the .Fn elf_newscn function. .Pp The -.Vt Elf_Scn -descriptor is opaque and contains no application modifiable fields. +.Vt Elf_Data +descriptors associated with a given section can be retrieved +using the +.Fn elf_getdata +function. +New data descriptors can be added to a section +descriptor using the +.Fn elf_newdata +function. +The untranslated +.Dq file +representation of data in a section can be retrieved using the +.Fn elf_rawdata +function. .El .Ss Supported Elf Types The following ELF datatypes are supported by the library. @@ -411,7 +420,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 . @@ -421,7 +430,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 @@ -438,7 +447,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 @@ -471,7 +480,7 @@ Allocate an Executable Header in an ELF 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. @@ -480,14 +489,14 @@ Translate an ELF data structure from its 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 @@ -531,9 +540,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 @@ -567,7 +578,7 @@ set by function .Ss Error Handling In case an error is encountered, these library functions set an internal error number and signal the presence of the error by -returning an special return value. +returning a special return value. The application can check the current error number by calling .Xr elf_errno 3 . @@ -603,10 +614,14 @@ library will reclaim the space used by t 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. -This implementation first appeared in +The original +.Nm +API was developed for +.At V . +The current implementation of the API appeared in .Fx 7.0 and .Nx 6.0 . Index: src/external/bsd/elftoolchain/dist/libelf/elf_begin.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_begin.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_begin.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_begin.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_begin.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_begin.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_begin.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008-2011 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z 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 @@ -75,7 +75,8 @@ can have the following values: .It ELF_C_NULL Causes .Fn elf_begin -to return NULL. +to return +.Dv NULL . Arguments .Ar fd and @@ -93,7 +94,9 @@ archives and for ELF objects. .Pp If argument .Ar elf -is NULL, the library will allocate a new ELF descriptor for the file +is +.Dv NULL , +the library will allocate a new ELF descriptor for the file being processed. The argument .Ar fd @@ -101,7 +104,9 @@ should have been opened for reading. .Pp If argument .Ar elf -is not NULL, and references a regular ELF file previously opened with +is not +.Dv NULL , +and references a regular ELF file previously opened with .Fn elf_begin , then the activation count for the descriptor referenced by argument .Ar elf @@ -113,7 +118,9 @@ should match that used to open the descr .Pp If argument .Ar elf -is not NULL, and references a descriptor for an +is not +.Dv NULL , +and references a descriptor for an .Xr ar 1 archive opened earlier with .Fn elf_begin , @@ -127,7 +134,9 @@ should match that used to open the archi .Pp If argument .Ar elf -is not NULL, and references an +is not +.Dv NULL , +and references an .Xr ar 1 archive opened earlier with .Fn elf_memory , @@ -145,7 +154,9 @@ Argument should have been opened for reading and writing. If argument .Ar elf -is NULL, the library will allocate a new ELF descriptor for +is +.Dv NULL , +the library will allocate a new ELF descriptor for the file being processed. If the argument .Ar elf @@ -203,7 +214,8 @@ The symbol table of the archive may be r using .Xr elf_getarsym 3 . .Sh RETURN VALUES -The function returns a pointer to a ELF descriptor if successful, or NULL +The function returns a pointer to a ELF descriptor if successful, or +.Dv NULL if an error occurred. .Sh EXAMPLES To iterate through the members of an Index: src/external/bsd/elftoolchain/dist/libelf/elf_cntl.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_cntl.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_cntl.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_cntl.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_cntl.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_cntl.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_cntl.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" .Dd August 9, 2006 -.Os .Dt ELF_CNTL 3 +.Os .Sh NAME .Nm elf_cntl .Nd control an elf file descriptor @@ -93,7 +93,8 @@ is a descriptor for an archive member. .It Bq Er ELF_E_ARGUMENT Argument .Ar elf -was NULL. +was +.Dv NULL . .It Bq Er ELF_E_ARGUMENT Argument .Ar cmd Index: src/external/bsd/elftoolchain/dist/libelf/elf_end.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_end.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_end.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_end.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_end.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_end.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_end.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" .Dd June 29, 2006 -.Os .Dt ELF_END 3 +.Os .Sh NAME .Nm elf_end .Nd release an ELF descriptor @@ -47,7 +47,9 @@ This descriptor must have been allocated .Xr elf_begin 3 or .Xr elf_memory 3 . -For programming convenience, a NULL value is permitted for argument +For programming convenience, a +.Dv NULL +value is permitted for argument .Ar elf . .Pp A call to @@ -70,7 +72,8 @@ returns the current value of the ELF des .Ar elf Ap s activation count, or zero if argument .Ar elf -was NULL. +was +.Dv NULL . .Sh SEE ALSO .Xr elf 3 , .Xr elf_begin 3 , Index: src/external/bsd/elftoolchain/dist/libelf/elf_errmsg.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_errmsg.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_errmsg.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_errmsg.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_errmsg.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_errmsg.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_errmsg.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" .Dd June 11, 2006 -.Os .Dt ELF_ERRMSG 3 +.Os .Sh NAME .Nm elf_errmsg , .Nm elf_errno @@ -64,7 +64,9 @@ A zero value for argument retrieves the most recent error encountered by the ELF library. An argument value of -1 behaves identically, except that -it guarantees a non-NULL return from +it guarantees a +.No non- Ns Dv NULL +return from .Fn elf_errmsg . .Sh RETURN VALUES Function @@ -77,7 +79,9 @@ Function returns a pointer to library local storage for non-zero values of argument .Ar error . -With a zero argument, the function will return a NULL pointer if no +With a zero argument, the function will return a +.Dv NULL +pointer if no error had been encountered by the library, or will return a pointer to library local storage containing an appropriate message otherwise. .Sh EXAMPLES Index: src/external/bsd/elftoolchain/dist/libelf/elf_fill.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_fill.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_fill.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_fill.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_fill.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_fill.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_fill.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 Index: src/external/bsd/elftoolchain/dist/libelf/elf_flagdata.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_flagdata.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_flagdata.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_flagdata.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_flagdata.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_flagdata.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_flagdata.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006-2008,2011 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" Id: elf_flagdata.3 2884 2013-01-11 02:03:46Z jkoshy +.\" Id: elf_flagdata.3 3928 2021-03-07 19:47:55Z jkoshy .\" -.Dd December 3, 2011 -.Os +.Dd June 12, 2019 .Dt ELF_FLAGDATA 3 +.Os .Sh NAME .Nm elf_flagarhdr , .Nm elf_flagdata , @@ -36,7 +36,7 @@ .Nm elf_flagphdr , .Nm elf_flagscn , .Nm elf_flagshdr -.Nd manipulate flags associated with ELF(3) data structures +.Nd manipulate flags associated with ELF data structures .Sh LIBRARY .Lb libelf .Sh SYNOPSIS @@ -67,7 +67,9 @@ and .Ar scn denote the data structures whose flags need to be changed. These values should have been returned by prior calls to -functions in the ELF(3) API set: +functions in the +.Xr elf 3 +API set: .Bl -bullet -compact .It Argument @@ -98,8 +100,9 @@ should have been returned by a prior cal or .Xr elf_nextscn 3 . .El -These values are allowed to be NULL to simplify error handling in -application code. +These values are allowed to be +.Dv NULL +to simplify error handling in application code. .Pp Argument .Ar cmd @@ -177,7 +180,9 @@ function and the .Dv ELF_F_ARCHIVE and .Dv ELF_F_ARCHIVE_SYSV -flags are an extension to the ELF(3) API. +flags are an extension to the +.Xr elf 3 +API. .Sh ERRORS These functions may fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" @@ -210,16 +215,13 @@ was called without a program header bein .Xr elf 3 , .Xr elf32_newehdr 3 , .Xr elf32_newphdr 3 , -.Xr elf32_newshdr 3 , .Xr elf64_newehdr 3 , .Xr elf64_newphdr 3 , -.Xr elf64_newshdr 3 , .Xr elf_newdata 3 , .Xr elf_update 3 , .Xr gelf 3 , .Xr gelf_newehdr 3 , .Xr gelf_newphdr 3 , -.Xr gelf_newshdr 3 , .Xr gelf_update_dyn 3 , .Xr gelf_update_move 3 , .Xr gelf_update_rel 3 , Index: src/external/bsd/elftoolchain/dist/libelf/elf_getarhdr.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_getarhdr.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_getarhdr.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_getarhdr.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_getarhdr.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_getarhdr.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_getarhdr.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z 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 @@ -75,7 +75,9 @@ The size of the member in bytes. .Sh RETURN VALUES This function returns a valid pointer to an .Vt Elf_Arhdr -structure if successful, or NULL if an error is encountered. +structure if successful, or +.Dv NULL +if an error is encountered. .Sh ERRORS Function .Fn elf_getarhdr @@ -84,7 +86,8 @@ may fail with the following errors: .It Bq Er ELF_E_ARGUMENT Argument .Ar elf -was NULL. +was +.Dv NULL . .It Bq Er ELF_E_ARGUMENT Argument .Ar elf Index: src/external/bsd/elftoolchain/dist/libelf/elf_getarsym.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_getarsym.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_getarsym.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_getarsym.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_getarsym.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_getarsym.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_getarsym.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" .Dd August 15, 2006 -.Os .Dt ELF_GETARSYM 3 +.Os .Sh NAME .Nm elf_getarsym .Nd retrieve the symbol table of an archive @@ -76,7 +76,9 @@ name, as computed by .Xr elf_hash 3 . .El .Pp -The last entry of the returned array will have a NULL value for member +The last entry of the returned array will have a +.Dv NULL +value for member .Va as_name , a zero value for member .Va as_off @@ -94,7 +96,8 @@ Function .Fn elf_getarsym returns a pointer to an array of .Vt Elf_Arsym -structures if successful, or a NULL +structures if successful, or a +.Dv NULL pointer if an error was encountered. .Pp If argument @@ -114,7 +117,8 @@ may fail with the following errors: .It Bq Er ELF_E_ARGUMENT Argument .Ar elf -was NULL. +was +.Dv NULL . .It Bq Er ELF_E_ARGUMENT Argument .Ar elf Index: src/external/bsd/elftoolchain/dist/libelf/elf_getbase.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_getbase.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_getbase.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_getbase.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_getbase.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_getbase.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_getbase.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008,2010 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z 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 @@ -63,7 +63,8 @@ may fail with the following errors: .It Bq Er ELF_E_ARGUMENT Argument .Ar elf -was NULL. +was +.Dv NULL . .El .Sh SEE ALSO .Xr elf 3 , Index: src/external/bsd/elftoolchain/dist/libelf/elf_getdata.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_getdata.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_getdata.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_getdata.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_getdata.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_getdata.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_getdata.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008,2010-2011 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" -.Dd January 26, 2011 -.Os +.Dd April 22, 2019 .Dt ELF_GETDATA 3 +.Os .Sh NAME .Nm elf_getdata , .Nm elf_newdata , @@ -85,7 +85,7 @@ The new data descriptor will be initiali .It Va d_align Set to 1. .It Va d_buf -Initialized to. +Initialized to .Dv NULL . .It Va d_off Set to (off_t) -1. @@ -158,7 +158,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 @@ -234,7 +234,12 @@ is incorrect. .It Bq Er ELF_E_UNIMPL The section type associated with section .Ar scn -is currently unsupported by the library. +is not supported. +.It Bq Er ELF_E_VERSION +Section +.Ar scn +was associated with an ELF object with an unsupported +version. .El .Sh SEE ALSO .Xr elf 3 , Index: src/external/bsd/elftoolchain/dist/libelf/elf_getident.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_getident.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_getident.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_getident.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_getident.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_getident.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_getident.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" .Dd July 3, 2006 -.Os .Dt ELF_GETIDENT 3 +.Os .Sh NAME .Nm elf_getident .Nd return the initial bytes of a file @@ -52,15 +52,20 @@ This location is set to zero on errors. .Sh RETURN VALUES Function .Fn elf_getident -will return a non-NULL pointer to the initial bytes of the file if -successful, or NULL if an error condition is detected. +will return a +.No non- Ns Dv NULL +pointer to the initial bytes of the file if successful, or +.Dv NULL +if an error condition is detected. .Sh ERRORS Function .Fn elf_getident can fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" .It Bq Er ELF_E_ARGUMENT -A NULL value was passed in for argument +A +.Dv NULL +value was passed in for argument .Ar elf . .It Bq Er ELF_E_SEQUENCE ELF descriptor Index: src/external/bsd/elftoolchain/dist/libelf/elf_getphdrnum.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_getphdrnum.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_getphdrnum.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_getphdrnum.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_getphdrnum.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_getphdrnum.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_getphdrnum.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z 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 @@ -47,18 +47,19 @@ and stores it into the location pointed .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 -A NULL value was passed in for argument +A +.Dv NULL +value was passed in for argument .Ar elf . .It Bq Er ELF_E_ARGUMENT Argument Index: src/external/bsd/elftoolchain/dist/libelf/elf_getphnum.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_getphnum.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_getphnum.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_getphnum.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_getphnum.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_getphnum.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_getphnum.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z 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 @@ -52,7 +52,6 @@ and stores it into the location pointed .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 @@ -64,7 +63,9 @@ Function can fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" .It Bq Er ELF_E_ARGUMENT -A NULL value was passed in for argument +A +.Dv NULL +value was passed in for argument .Ar elf . .It Bq Er ELF_E_ARGUMENT Argument Index: src/external/bsd/elftoolchain/dist/libelf/elf_getscn.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_getscn.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_getscn.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_getscn.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_getscn.3 Mon Mar 8 20:55:06 2021 @@ -1,6 +1,6 @@ -.\" $NetBSD: elf_getscn.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_getscn.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" -.\" 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 @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" -.Dd October 22, 2007 -.Os +.Dd September 24, 2018 .Dt ELF_GETSCN 3 +.Os .Sh NAME .Nm elf_getscn , .Nm elf_ndxscn , @@ -88,13 +88,21 @@ 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 -pointer to the section descriptor at index 1. +is allowed to be +.Dv NULL , +in which case this function will return a pointer to the section +descriptor at index 1. If no further sections are present, function .Fn elf_nextscn -will return a NULL pointer. +will return a +.Dv NULL +pointer. .Sh RETURN VALUES Functions .Fn elf_getscn , @@ -102,7 +110,8 @@ Functions and .Fn elf_nextscn return a valid pointer to a section descriptor if successful, or -NULL if an error occurs. +.Dv NULL +if an error occurs. .Pp Function .Fn elf_ndxscn @@ -117,7 +126,8 @@ Arguments .Ar elf or .Ar scn -were NULL. +were +.Dv NULL . .It Bq Er ELF_E_ARGUMENT Argument .Ar index Index: src/external/bsd/elftoolchain/dist/libelf/elf_getshdrnum.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_getshdrnum.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_getshdrnum.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_getshdrnum.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_getshdrnum.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_getshdrnum.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_getshdrnum.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z 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 @@ -47,7 +47,6 @@ and stores it into the location pointed .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 @@ -58,7 +57,9 @@ Function can fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" .It Bq Er ELF_E_ARGUMENT -A NULL value was passed in for argument +A +.Dv NULL +value was passed in for argument .Ar elf . .It Bq Er ELF_E_ARGUMENT Argument Index: src/external/bsd/elftoolchain/dist/libelf/elf_getshdrstrndx.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_getshdrstrndx.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_getshdrstrndx.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_getshdrstrndx.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_getshdrstrndx.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_getshdrstrndx.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_getshdrstrndx.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z 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 @@ -48,14 +48,15 @@ and stores it into the location pointed .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 These functions can fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" .It Bq Er ELF_E_ARGUMENT -A NULL value was passed in for argument +A +.Dv NULL +value was passed in for argument .Ar elf . .It Bq Er ELF_E_ARGUMENT Argument Index: src/external/bsd/elftoolchain/dist/libelf/elf_getshnum.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_getshnum.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_getshnum.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_getshnum.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_getshnum.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_getshnum.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_getshnum.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z 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 @@ -52,7 +52,6 @@ and stores it into the location pointed .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 @@ -64,7 +63,9 @@ Function can fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" .It Bq Er ELF_E_ARGUMENT -A NULL value was passed in for argument +A +.Dv NULL +value was passed in for argument .Ar elf . .It Bq Er ELF_E_ARGUMENT Argument Index: src/external/bsd/elftoolchain/dist/libelf/elf_getshstrndx.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_getshstrndx.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_getshstrndx.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_getshstrndx.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_getshstrndx.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_getshstrndx.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_getshstrndx.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" -.Dd August 5, 2009 -.Os +.Dd July 25, 2018 .Dt ELF_GETSHSTRNDX 3 +.Os .Sh NAME .Nm elf_getshstrndx , .Nm elf_setshstrndx @@ -43,17 +43,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 @@ -62,7 +63,6 @@ sets the index of the section name strin .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. @@ -70,7 +70,9 @@ of an error. These functions can fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" .It Bq Er ELF_E_ARGUMENT -A NULL value was passed in for argument +A +.Dv NULL +value was passed in for argument .Ar elf . .It Bq Er ELF_E_ARGUMENT Argument Index: src/external/bsd/elftoolchain/dist/libelf/elf_hash.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_hash.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_hash.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_hash.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_hash.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_hash.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_hash.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 Index: src/external/bsd/elftoolchain/dist/libelf/elf_kind.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_kind.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_kind.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_kind.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_kind.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_kind.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_kind.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" .Dd June 1, 2006 -.Os .Dt ELF_KIND 3 +.Os .Sh NAME .Nm elf_kind .Nd determine ELF file type @@ -44,7 +44,8 @@ function identifies the kind of file ass .Ar elf . The argument .Ar elf -is allowed to be NULL. +is allowed to be +.Dv NULL . .Sh RETURN VALUES The .Fn elf_kind @@ -61,7 +62,9 @@ is an ELF file. .It Dv ELF_K_NONE The argument .Ar elf -was NULL, or the ELF library could not determine the type of the file +was +.Dv NULL , +or the ELF library could not determine the type of the file associated with argument .Ar elf , or an error occurred when processing. Index: src/external/bsd/elftoolchain/dist/libelf/elf_memory.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_memory.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_memory.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_memory.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_memory.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_memory.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_memory.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z 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 @@ -59,7 +59,9 @@ with a command argument value of .Sh RETURN VALUES Function .Fn elf_memory -returns a pointer to a new ELF descriptor if successful, or NULL if an +returns a pointer to a new ELF descriptor if successful, or +.Dv NULL +if an error occurred. .Pp The return value may be queried for the file type using @@ -90,7 +92,9 @@ Function can fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" .It Bq Er ELF_E_ARGUMENT -A NULL value was used for argument +A +.Dv NULL +value was used for argument .Ar image or the value of argument .Ar sz Index: src/external/bsd/elftoolchain/dist/libelf/elf_next.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_next.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_next.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_next.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_next.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_next.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_next.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3698 2019-02-28 06:34:42Z jkoshy .\" -.Dd June 17, 2006 -.Os +.Dd February 27, 2019 .Dt ELF_NEXT 3 +.Os .Sh NAME .Nm elf_next .Nd provide sequential access to the next archive member @@ -90,6 +90,9 @@ Argument was not associated with a containing .Xr ar 1 archive. +.It Bq Er ELF_E_ARGUMENT +An error was encountered while parsing the archive containing argument +.Ar elf . .El .Sh SEE ALSO .Xr elf 3 , Index: src/external/bsd/elftoolchain/dist/libelf/elf_open.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_open.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_open.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_open.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_open.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_open.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_open.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2012 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" -.Dd May 31, 2012 -.Os +.Dd June 12, 2019 .Dt ELF_OPEN 3 +.Os .Sh NAME .Nm elf_open .Nd open ELF objects and ar(1) archives @@ -45,7 +45,9 @@ The functions .Fn elf_open and .Fn elf_openmemory -are extensions to the ELF(3) API, for the internal use of the +are extensions to the +.Xr elf 3 +API, for the internal use of the Elftoolchain project. Portable applications should not use these functions. .Pp @@ -69,8 +71,14 @@ archive contained in the memory area poi 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 +.Dv NULL +if an error occurred. .Sh COMPATIBILITY -These functions are non-standard extensions to the ELF(3) API set. +These functions are non-standard extensions to the +.Xr elf 3 +API set. .Pp The behavior of these functions differs from their counterparts .Xr elf_begin 3 @@ -81,9 +89,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]" @@ -96,7 +101,8 @@ The argument .Ar sz was zero, or the argument .Ar image -was NULL. +was +.Dv NULL . .It Bq Er ELF_E_IO The file descriptor in argument .Ar fd Index: src/external/bsd/elftoolchain/dist/libelf/elf_rand.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_rand.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_rand.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_rand.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_rand.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_rand.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_rand.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 Index: src/external/bsd/elftoolchain/dist/libelf/elf_rawfile.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_rawfile.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_rawfile.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_rawfile.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_rawfile.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_rawfile.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_rawfile.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" .Dd July 3, 2006 -.Os .Dt ELF_RAWFILE 3 +.Os .Sh NAME .Nm elf_rawfile .Nd return uninterpreted contents of an ELF file @@ -52,7 +52,9 @@ encountered. .Sh RETURN VALUES Function .Fn elf_rawfile -returns a valid pointer if successful or NULL if an error occurs. +returns a valid pointer if successful or +.Dv NULL +if an error occurs. .Sh ERRORS Function .Fn elf_rawfile @@ -61,7 +63,8 @@ may fail with the following errors: .It Bq Er ELF_E_ARGUMENT Argument .Ar elf -was NULL. +was +.Dv NULL . .It Bq Er ELF_E_SEQUENCE Argument .Ar elf Index: src/external/bsd/elftoolchain/dist/libelf/elf_strptr.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_strptr.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_strptr.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_strptr.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_strptr.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_strptr.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_strptr.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z 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 @@ -59,14 +59,16 @@ table. .Sh RETURN VALUES Function .Fn elf_strptr -returns a valid pointer on success or NULL in case an error was -encountered. +returns a valid pointer on success or +.Dv NULL +in case an error was encountered. .Sh ERRORS .Bl -tag -width "[ELF_E_RESOURCE]" .It Bq Er ELF_E_ARGUMENT Argument .Ar elf -was NULL +was +.Dv NULL . .It Bq Er ELF_E_ARGUMENT Argument .Ar elf Index: src/external/bsd/elftoolchain/dist/libelf/elf_update.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_update.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_update.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_update.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_update.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_update.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_update.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006-2011 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3734 2019-04-22 14:10:49Z jkoshy .\" -.Dd August 14, 2011 -.Os +.Dd April 22, 2019 .Dt ELF_UPDATE 3 +.Os .Sh NAME .Nm elf_update .Nd update an ELF descriptor @@ -347,6 +347,10 @@ operation was requested after a prior ca disassociated the ELF descriptor .Ar elf from its underlying file. +.It Bq Er ELF_E_UNIMPL +Argument +.Ar elf +contained a section with an unsupported ELF type. .It Bq Er ELF_E_VERSION Argument .Ar elf Index: src/external/bsd/elftoolchain/dist/libelf/elf_version.3 diff -u src/external/bsd/elftoolchain/dist/libelf/elf_version.3:1.3 src/external/bsd/elftoolchain/dist/libelf/elf_version.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/elf_version.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/elf_version.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: elf_version.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: elf_version.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 Index: src/external/bsd/elftoolchain/dist/libelf/gelf.3 diff -u src/external/bsd/elftoolchain/dist/libelf/gelf.3:1.3 src/external/bsd/elftoolchain/dist/libelf/gelf.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/gelf.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/gelf.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: gelf.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: gelf.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,13 +23,13 @@ .\" 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 3743 2019-06-12 19:36:30Z jkoshy .\" -.Dd September 1, 2006 -.Os +.Dd June 12, 2019 .Dt GELF 3 +.Os .Sh NAME -.Nm GElf +.Nm gelf .Nd class-independent API for ELF manipulation .Sh LIBRARY .Lb libelf @@ -117,7 +117,7 @@ routines will signal an error if a GElf 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_* @@ -127,16 +127,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. @@ -145,7 +145,7 @@ Translate from the file representation o native representation. .El .It "Retrieving ELF Data" -.Bl -tag -compact +.Bl -tag -compact -width indent .It Fn gelf_getdyn Retrieve an ELF .Sy .dynamic @@ -164,7 +164,7 @@ Retrieve an ELF Section Header Table ent 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 @@ -194,7 +194,10 @@ Copy back an ELF symbol table entry. .Xr elf 3 , .Xr elf 5 .Sh HISTORY -The GELF(3) API first appeared in System V Release 4. +The +.Nm +API first appeared in +.At V.4 . This implementation of the API first appeared in .Fx 7.0 . .Sh AUTHORS Index: src/external/bsd/elftoolchain/dist/libelf/gelf_checksum.3 diff -u src/external/bsd/elftoolchain/dist/libelf/gelf_checksum.3:1.3 src/external/bsd/elftoolchain/dist/libelf/gelf_checksum.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/gelf_checksum.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/gelf_checksum.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: gelf_checksum.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: gelf_checksum.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" .Dd August 29, 2006 -.Os .Dt GELF_CHECKSUM 3 +.Os .Sh NAME .Nm elf32_checksum , .Nm elf64_checksum , @@ -81,7 +81,8 @@ These functions may fail with the follow .It Bq Er ELF_E_ARGUMENT Argument .Ar elf -was NULL. +was +.Dv NULL . .It Bq Er ELF_E_ARGUMENT Argument .Ar elf Index: src/external/bsd/elftoolchain/dist/libelf/gelf_fsize.3 diff -u src/external/bsd/elftoolchain/dist/libelf/gelf_fsize.3:1.3 src/external/bsd/elftoolchain/dist/libelf/gelf_fsize.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/gelf_fsize.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/gelf_fsize.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: gelf_fsize.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: gelf_fsize.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" .Dd February 5, 2008 -.Os .Dt GELF_FSIZE 3 +.Os .Sh NAME .Nm gelf_fsize , .Nm elf32_fsize , @@ -74,7 +74,9 @@ These functions may fail with: .It Bq Er ELF_E_ARGUMENT Argument .Ar elf -was NULL in a call to +was +.Dv NULL +in a call to .Fn gelf_fsize . .It Bq Er ELF_E_ARGUMENT ELF descriptor Index: src/external/bsd/elftoolchain/dist/libelf/gelf_getcap.3 diff -u src/external/bsd/elftoolchain/dist/libelf/gelf_getcap.3:1.3 src/external/bsd/elftoolchain/dist/libelf/gelf_getcap.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/gelf_getcap.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/gelf_getcap.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: gelf_getcap.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: gelf_getcap.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" -.Dd August 29, 2006 -.Os +.Dd April 22, 2019 .Dt GELF_GETCAP 3 +.Os .Sh NAME .Nm gelf_getcap , .Nm gelf_update_cap @@ -90,7 +90,9 @@ Function .Fn gelf_getcap returns the value of argument .Ar cap -if successful, or NULL in case of an error. +if successful, or +.Dv NULL +in case of an error. Function .Fn gelf_update_cap returns a non-zero value if successful, or zero in case of an error. @@ -102,7 +104,8 @@ Arguments .Ar data or .Ar cap -were NULL. +were +.Dv NULL . .It Bq Er ELF_E_ARGUMENT Argument .Ar ndx @@ -115,6 +118,12 @@ was not associated with a section of typ .Dv SHT_SUNW_cap . .It Bq Er ELF_E_RANGE A value was not representable in the target type. +.It Bq Er ELF_E_VERSION +The +.Vt Elf_Data +descriptor denoted by argument +.Ar data +is associated with an ELF object with an unsupported version. .El .Sh SEE ALSO .Xr elf 3 , Index: src/external/bsd/elftoolchain/dist/libelf/gelf_getclass.3 diff -u src/external/bsd/elftoolchain/dist/libelf/gelf_getclass.3:1.3 src/external/bsd/elftoolchain/dist/libelf/gelf_getclass.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/gelf_getclass.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/gelf_getclass.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: gelf_getclass.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: gelf_getclass.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 Index: src/external/bsd/elftoolchain/dist/libelf/gelf_getdyn.3 diff -u src/external/bsd/elftoolchain/dist/libelf/gelf_getdyn.3:1.3 src/external/bsd/elftoolchain/dist/libelf/gelf_getdyn.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/gelf_getdyn.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/gelf_getdyn.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: gelf_getdyn.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: gelf_getdyn.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" -.Dd August 29, 2006 -.Os +.Dd April 22, 2019 .Dt GELF_GETDYN 3 +.Os .Sh NAME .Nm gelf_getdyn , .Nm gelf_update_dyn @@ -92,7 +92,9 @@ Function .Fn gelf_getdyn returns the value of argument .Ar dyn -if successful, or NULL in case of an error. +if successful, or +.Dv NULL +in case of an error. Function .Fn gelf_update_dyn returns a non-zero value if successful, or zero in case of an error. @@ -104,7 +106,8 @@ Arguments .Ar data or .Ar dyn -were NULL. +were +.Dv NULL . .It Bq Er ELF_E_ARGUMENT Argument .Ar ndx @@ -117,6 +120,13 @@ was not associated with a section of typ .Dv SHT_DYNAMIC . .It Bq Er ELF_E_RANGE A value was not representable in the target type. +.It Bq Er ELF_E_VERSION +The +.Vt Elf_Data +descriptor denoted by argument +.Ar data +is associated with an ELF object with an unsupported version. +.El .El .Sh SEE ALSO .Xr elf 3 , Index: src/external/bsd/elftoolchain/dist/libelf/gelf_getehdr.3 diff -u src/external/bsd/elftoolchain/dist/libelf/gelf_getehdr.3:1.3 src/external/bsd/elftoolchain/dist/libelf/gelf_getehdr.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/gelf_getehdr.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/gelf_getehdr.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: gelf_getehdr.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: gelf_getehdr.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" .Dd December 16, 2006 -.Os .Dt GELF_GETEHDR 3 +.Os .Sh NAME .Nm elf32_getehdr , .Nm elf64_getehdr , @@ -75,7 +75,9 @@ if successful or in case of failure. .Sh RETURN VALUES These functions return a pointer to a translated header descriptor -if successful, or NULL on failure. +if successful, or +.Dv NULL +on failure. .Sh ERRORS These functions can fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" Index: src/external/bsd/elftoolchain/dist/libelf/gelf_getmove.3 diff -u src/external/bsd/elftoolchain/dist/libelf/gelf_getmove.3:1.3 src/external/bsd/elftoolchain/dist/libelf/gelf_getmove.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/gelf_getmove.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/gelf_getmove.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: gelf_getmove.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: gelf_getmove.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" -.Dd August 29, 2006 -.Os +.Dd April 22, 2019 .Dt GELF_GETMOVE 3 +.Os .Sh NAME .Nm gelf_getmove , .Nm gelf_update_move @@ -90,7 +90,9 @@ Function .Fn gelf_getmove returns the value of argument .Ar move -if successful, or NULL in case of an error. +if successful, or +.Dv NULL +in case of an error. Function .Fn gelf_update_move returns a non-zero value if successful, or zero in case of an error. @@ -102,7 +104,8 @@ Arguments .Ar data or .Ar move -were NULL. +were +.Dv NULL . .It Bq Er ELF_E_ARGUMENT Argument .Ar ndx @@ -114,6 +117,12 @@ Data descriptor was not associated with a section containing move information. .It Bq Er ELF_E_RANGE A value was not representable in the target type. +.It Bq Er ELF_E_VERSION +The +.Vt Elf_Data +descriptor denoted by argument +.Ar data +is associated with an ELF object with an unsupported version. .El .Sh SEE ALSO .Xr elf 3 , Index: src/external/bsd/elftoolchain/dist/libelf/gelf_getphdr.3 diff -u src/external/bsd/elftoolchain/dist/libelf/gelf_getphdr.3:1.3 src/external/bsd/elftoolchain/dist/libelf/gelf_getphdr.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/gelf_getphdr.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/gelf_getphdr.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: gelf_getphdr.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: gelf_getphdr.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006-2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" .Dd October 21, 2007 -.Os .Dt GELF_GETPHDR 3 +.Os .Sh NAME .Nm elf32_getphdr , .Nm elf64_getphdr , @@ -68,7 +68,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 . @@ -84,15 +84,17 @@ interface need to use the API to copy modifications to a program header entry back to the underlying ELF descriptor. .Sh RETURN VALUES -The functions a valid pointer if successful, or NULL in case an error -was encountered. +The functions a valid pointer if successful, or +.Dv NULL +in case an error was encountered. .Sh ERRORS These functions may fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" .It Bq Er ELF_E_ARGUMENT Argument .Ar elf -was NULL. +was +.Dv NULL . .It Bq Er ELF_E_ARGUMENT Argument .Ar elf @@ -100,7 +102,8 @@ was not a descriptor for an ELF object. .It Bq Er ELF_E_ARGUMENT Argument .Ar dst -was NULL. +was +.Dv NULL . .It Bq Er ELF_E_ARGUMENT Index .Ar index Index: src/external/bsd/elftoolchain/dist/libelf/gelf_getrel.3 diff -u src/external/bsd/elftoolchain/dist/libelf/gelf_getrel.3:1.3 src/external/bsd/elftoolchain/dist/libelf/gelf_getrel.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/gelf_getrel.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/gelf_getrel.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: gelf_getrel.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: gelf_getrel.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" -.Dd August 29, 2006 -.Os +.Dd April 22, 2019 .Dt GELF_GETREL 3 +.Os .Sh NAME .Nm gelf_getrel , .Nm gelf_update_rel @@ -90,7 +90,9 @@ Function .Fn gelf_getrel returns the value of argument .Ar rel -if successful, or NULL in case of an error. +if successful, or +.Dv NULL +in case of an error. Function .Fn gelf_update_rel returns a non-zero value if successful, or zero in case of an error. @@ -102,7 +104,8 @@ Arguments .Ar data or .Ar rel -were NULL. +were +.Dv NULL . .It Bq Er ELF_E_ARGUMENT Argument .Ar ndx @@ -115,6 +118,12 @@ was not associated with a section of typ .Dv SHT_REL . .It Bq Er ELF_E_RANGE A value was not representable in the target type. +.It Bq Er ELF_E_VERSION +The +.Vt Elf_Data +descriptor denoted by argument +.Ar data +is associated with an ELF object with an unsupported version. .El .Sh SEE ALSO .Xr elf 3 , Index: src/external/bsd/elftoolchain/dist/libelf/gelf_getrela.3 diff -u src/external/bsd/elftoolchain/dist/libelf/gelf_getrela.3:1.3 src/external/bsd/elftoolchain/dist/libelf/gelf_getrela.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/gelf_getrela.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/gelf_getrela.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: gelf_getrela.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: gelf_getrela.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" -.Dd August 29, 2006 -.Os +.Dd April 22, 2019 .Dt GELF_GETRELA 3 +.Os .Sh NAME .Nm gelf_getrela , .Nm gelf_update_rela @@ -90,7 +90,9 @@ Function .Fn gelf_getrela returns the value of argument .Ar rela -if successful, or NULL in case of an error. +if successful, or +.Dv NULL +in case of an error. Function .Fn gelf_update_rela returns a non-zero value if successful, or zero in case of an error. @@ -102,7 +104,8 @@ Arguments .Ar data or .Ar rela -were NULL. +were +.Dv NULL . .It Bq Er ELF_E_ARGUMENT Argument .Ar ndx @@ -115,6 +118,12 @@ was not associated with a section of typ .Dv SHT_RELA . .It Bq Er ELF_E_RANGE A value was not representable in the target type. +.It Bq Er ELF_E_VERSION +The +.Vt Elf_Data +descriptor denoted by argument +.Ar data +is associated with an ELF object with an unsupported version. .El .Sh SEE ALSO .Xr elf 3 , Index: src/external/bsd/elftoolchain/dist/libelf/gelf_getshdr.3 diff -u src/external/bsd/elftoolchain/dist/libelf/gelf_getshdr.3:1.3 src/external/bsd/elftoolchain/dist/libelf/gelf_getshdr.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/gelf_getshdr.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/gelf_getshdr.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: gelf_getshdr.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: gelf_getshdr.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" .Dd August 27, 2006 -.Os .Dt GELF_GETSHDR 3 +.Os .Sh NAME .Nm elf32_getshdr , .Nm elf64_getshdr , @@ -85,13 +85,17 @@ Functions and .Fn elf64_getshdr return a valid pointer to the appropriate section header on success -or NULL if an error was encountered. +or +.Dv NULL +if an error was encountered. .Pp Function .Fn gelf_getshdr returns argument .Ar dst -if successful, or NULL if an error was encountered. +if successful, or +.Dv NULL +if an error was encountered. .Sh ERRORS These functions may fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" @@ -100,7 +104,8 @@ Arguments .Ar scn or .Ar shdr -were NULL. +were +.Dv NULL . .It Bq Er ELF_E_ARGUMENT Argument .Ar scn Index: src/external/bsd/elftoolchain/dist/libelf/gelf_getsym.3 diff -u src/external/bsd/elftoolchain/dist/libelf/gelf_getsym.3:1.3 src/external/bsd/elftoolchain/dist/libelf/gelf_getsym.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/gelf_getsym.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/gelf_getsym.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: gelf_getsym.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: gelf_getsym.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" -.Dd August 29, 2006 -.Os +.Dd April 22, 2019 .Dt GELF_GETSYM 3 +.Os .Sh NAME .Nm gelf_getsym , .Nm gelf_update_sym @@ -93,7 +93,9 @@ Function .Fn gelf_getsym returns the value of argument .Ar sym -if successful, or NULL in case of an error. +if successful, or +.Dv NULL +in case of an error. Function .Fn gelf_update_sym returns a non-zero value if successful, or zero in case of an error. @@ -105,7 +107,8 @@ Arguments .Ar data or .Ar sym -were NULL. +were +.Dv NULL . .It Bq Er ELF_E_ARGUMENT Argument .Ar ndx @@ -117,6 +120,12 @@ Data descriptor was not associated with a section containing symbol information. .It Bq Er ELF_E_RANGE A value was not representable in the target type. +.It Bq Er ELF_E_VERSION +The +.Vt Elf_Data +descriptor denoted by argument +.Ar data +is associated with an ELF object with an unsupported version. .El .Sh SEE ALSO .Xr elf 3 , Index: src/external/bsd/elftoolchain/dist/libelf/gelf_getsyminfo.3 diff -u src/external/bsd/elftoolchain/dist/libelf/gelf_getsyminfo.3:1.3 src/external/bsd/elftoolchain/dist/libelf/gelf_getsyminfo.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/gelf_getsyminfo.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/gelf_getsyminfo.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: gelf_getsyminfo.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: gelf_getsyminfo.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" -.Dd August 29, 2006 -.Os +.Dd April 22, 2019 .Dt GELF_GETSYMINFO 3 +.Os .Sh NAME .Nm gelf_getsyminfo , .Nm gelf_update_syminfo @@ -85,7 +85,9 @@ Function .Fn gelf_getsyminfo returns the value of argument .Ar syminfo -if successful, or NULL in case of an error. +if successful, or +.Dv NULL +in case of an error. Function .Fn gelf_update_syminfo returns a non-zero value if successful, or zero in case of an error. @@ -97,7 +99,8 @@ Arguments .Ar data or .Ar syminfo -were NULL. +were +.Dv NULL . .It Bq Er ELF_E_ARGUMENT Argument .Ar ndx @@ -107,6 +110,12 @@ descriptor. Data descriptor .Ar data was not associated with a section containing symbol information. +.It Bq Er ELF_E_VERSION +The +.Vt Elf_Data +descriptor denoted by argument +.Ar data +is associated with an ELF object with an unsupported version. .El .Sh SEE ALSO .Xr elf 3 , Index: src/external/bsd/elftoolchain/dist/libelf/gelf_getsymshndx.3 diff -u src/external/bsd/elftoolchain/dist/libelf/gelf_getsymshndx.3:1.3 src/external/bsd/elftoolchain/dist/libelf/gelf_getsymshndx.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/gelf_getsymshndx.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/gelf_getsymshndx.3 Mon Mar 8 20:55:06 2021 @@ -1,6 +1,6 @@ -.\" $NetBSD: gelf_getsymshndx.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: gelf_getsymshndx.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" -.\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. +.\" Copyright (c) 2006,2008,2020 Joseph Koshy. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" -.Dd November 5, 2006 -.Os +.Dd September 26, 2020 .Dt GELF_GETSYMSHNDX 3 +.Os .Sh NAME .Nm gelf_getsymshndx , .Nm gelf_update_symshndx @@ -90,17 +90,36 @@ retrieves symbol information at index .Ar ndx from the data descriptor specified by argument .Ar symdata -and stores in class-independent form in argument +and stores it in class-independent form in argument .Ar sym . -In addition it retrieves the extended section index for the -symbol from data buffer +Additionally: +.Bl -bullet +.It +If the arguments +.Ad xndxdata +and +.Ar xndxptr +are both not +.Dv NULL , +it retrieves the extended section index for the +symbol from the data buffer pointed to by the +argument .Ar xndxdata and stores it into the location pointed to by argument .Ar xndxptr . +.It +Otherwise, if the argument +.Ar xndxptr +is not +.Dv NULL , +a value of zero is stored into the location pointed to by +argument +.Ar xndxptr . +.El .Pp Function .Fn gelf_update_symshndx -updates the underlying symbol table entry in data +updates the underlying symbol table entry in the data descriptor .Ar symdata with the information in argument @@ -115,7 +134,9 @@ Function .Fn gelf_getsymshndx returns the value of argument .Ar sym -if successful, or NULL in case of an error. +if successful, or +.Dv NULL +in case of an error. .Pp Function .Fn gelf_update_symshndx @@ -130,7 +151,8 @@ Arguments .Ar xndxptr or .Ar sym -were NULL. +were +.Dv NULL . .It Bq Er ELF_E_ARGUMENT Argument .Ar ndx @@ -154,6 +176,14 @@ Data descriptor and .Ar xndxdata were associated with different ELF objects. +.It Bq Er ELF_E_VERSION +The +.Vt Elf_Data +descriptors denoted by arguments +.Ar symdata +and +.Ar xndxdata +are associated with an ELF object with an unsupported version. .El .Sh SEE ALSO .Xr elf 3 , Index: src/external/bsd/elftoolchain/dist/libelf/gelf_newehdr.3 diff -u src/external/bsd/elftoolchain/dist/libelf/gelf_newehdr.3:1.3 src/external/bsd/elftoolchain/dist/libelf/gelf_newehdr.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/gelf_newehdr.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/gelf_newehdr.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: gelf_newehdr.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: gelf_newehdr.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006-2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" Id: gelf_newehdr.3 189 2008-07-20 10:38:08Z jkoshy +.\" Id: gelf_newehdr.3 3928 2021-03-07 19:47:55Z jkoshy .\" -.Dd October 22, 2007 -.Os +.Dd June 12, 2019 .Dt GELF_NEWEHDR 3 +.Os .Sh NAME .Nm elf32_newehdr , .Nm elf64_newehdr , @@ -60,7 +60,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 @@ -128,7 +129,20 @@ flag on ELF descriptor .Ar elf . .Sh RETURN VALUES These functions return a pointer to a translated header descriptor -if successful, or NULL on failure. +if successful, or +.Dv NULL +on failure. +.Sh COMPATIBILITY +The +.Fn gelf_newehdr +function uses a type of +.Ft "void *" +for its returned value. +This differs from some other implementations of the +.Xr elf 3 +API, which use an +.Ft "unsigned long" +return type. .Sh ERRORS These functions can fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" Index: src/external/bsd/elftoolchain/dist/libelf/gelf_newphdr.3 diff -u src/external/bsd/elftoolchain/dist/libelf/gelf_newphdr.3:1.3 src/external/bsd/elftoolchain/dist/libelf/gelf_newphdr.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/gelf_newphdr.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/gelf_newphdr.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: gelf_newphdr.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: gelf_newphdr.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006-2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,11 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" Id: gelf_newphdr.3 189 2008-07-20 10:38:08Z jkoshy +.\" Id: gelf_newphdr.3 3928 2021-03-07 19:47:55Z jkoshy .\" -.Dd October 22, 2007 -.Os +.Dd June 12, 2019 .Dt GELF_NEWPHDR 3 +.Os .Sh NAME .Nm elf32_newphdr , .Nm elf64_newphdr , @@ -97,15 +97,28 @@ on the same descriptor .Ar elf will no longer be valid. .Sh RETURN VALUES -The functions a valid pointer if successful, or NULL in case an error -was encountered. +The functions a valid pointer if successful, or +.Dv NULL +in case an error was encountered. +.Sh COMPATIBILITY +The +.Fn gelf_newphdr +function uses a type of +.Ft "void *" +for its returned value. +This differs from some other implementations of the +.Xr elf 3 +API, which use an +.Ft "unsigned long" +return type. .Sh ERRORS These functions may fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" .It Bq Er ELF_E_ARGUMENT Argument .Ar elf -was NULL. +was +.Dv NULL . .It Bq Er ELF_E_ARGUMENT Argument .Ar elf Index: src/external/bsd/elftoolchain/dist/libelf/gelf_update_ehdr.3 diff -u src/external/bsd/elftoolchain/dist/libelf/gelf_update_ehdr.3:1.3 src/external/bsd/elftoolchain/dist/libelf/gelf_update_ehdr.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/gelf_update_ehdr.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/gelf_update_ehdr.3 Mon Mar 8 20:55:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: gelf_update_ehdr.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: gelf_update_ehdr.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" .\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" .Dd August 27, 2006 -.Os .Dt GELF_UPDATE_EHDR 3 +.Os .Sh NAME .Nm gelf_update_ehdr , .Nm gelf_update_phdr , @@ -90,7 +90,8 @@ Arguments .Ar scn , or .Ar shdr -were NULL. +were +.Dv NULL . .It Bq Er ELF_E_ARGUMENT Argument .Ar elf Index: src/external/bsd/elftoolchain/dist/libelf/gelf_xlatetof.3 diff -u src/external/bsd/elftoolchain/dist/libelf/gelf_xlatetof.3:1.3 src/external/bsd/elftoolchain/dist/libelf/gelf_xlatetof.3:1.4 --- src/external/bsd/elftoolchain/dist/libelf/gelf_xlatetof.3:1.3 Sat Feb 20 02:43:42 2016 +++ src/external/bsd/elftoolchain/dist/libelf/gelf_xlatetof.3 Mon Mar 8 20:55:06 2021 @@ -1,6 +1,6 @@ -.\" $NetBSD: gelf_xlatetof.3,v 1.3 2016/02/20 02:43:42 christos Exp $ +.\" $NetBSD: gelf_xlatetof.3,v 1.4 2021/03/08 20:55:06 jkoshy Exp $ .\" -.\" 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 @@ -23,11 +23,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 3928 2021-03-07 19:47:55Z jkoshy .\" -.Dd July 24, 2006 -.Os +.Dd October 11, 2018 .Dt GELF_XLATETOF 3 +.Os .Sh NAME .Nm elf32_xlate , .Nm elf64_xlate , @@ -38,36 +38,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 , @@ -155,7 +158,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 @@ -171,14 +174,43 @@ 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. +if successful, or +.Dv 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]" @@ -188,7 +220,8 @@ One of arguments .Ar dst or .Ar elf -was NULL. +was +.Dv NULL . .It Bq Er ELF_E_ARGUMENT Arguments .Ar src