diff options
author | Ed Maste <emaste@FreeBSD.org> | 2015-05-14 17:48:57 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2015-05-14 17:48:57 +0000 |
commit | d400e40862bdee2fea9afc4b27b3391807a9050c (patch) | |
tree | 7f2977438f192e551b9f0b35dc1d0465526a2704 | |
parent | 84d41a2986852c0d7d820f95b41c1db1cc818027 (diff) |
Import ELF Tool Chain revision 3197vendor/elftoolchain/elftoolchain-r3197
Notes
Notes:
svn path=/vendor/elftoolchain/dist/; revision=282911
svn path=/vendor/elftoolchain/elftoolchain-r3197/; revision=282913; tag=vendor/elftoolchain/elftoolchain-r3197
55 files changed, 225 insertions, 144 deletions
@@ -15,6 +15,7 @@ operating systems. ----------------- -------- ----------------------- `DragonFly BSD`_ 2.10.1 i386 FreeBSD_ v8.2 amd64 & i386 + FreeBSD_ v10.1 i386 Minix_ 3.0.2 i386 NetBSD_ v5.0.2 i386 OpenBSD_ v5.0 i386 @@ -75,6 +76,22 @@ Prerequisites % sudo pkg_add -r latex-pgf +:FreeBSD 10.1: + - The core libraries and utilities should build out of the box on + a stock install of FreeBSD. + + - To build and run the test suite: + + #. The current release of the `Test Execution Toolkit`_ needs to + be downloaded and unpacked into the ``test/tet/`` directory. + + #. The ``python`` and ``py27-yaml`` packages need to be installed:: + + % sudo pkg install python py27-yaml + + - Building additional documentation is not currently supported under + FreeBSD 10.1. + :Minix 3.2.0: - The following packages are pre-requisites for building the sources on Minix 3.2.0: @@ -299,7 +316,7 @@ website`_. .. _project website: http://elftoolchain.sourceforge.net/ -.. $Id: INSTALL 3165 2015-02-20 20:52:18Z emaste $ +.. $Id: INSTALL 3193 2015-05-04 17:47:14Z jkoshy $ .. Local Variables: .. mode: rst diff --git a/addr2line/addr2line.1 b/addr2line/addr2line.1 index 98edda50fb13..f000c2911d7b 100644 --- a/addr2line/addr2line.1 +++ b/addr2line/addr2line.1 @@ -22,7 +22,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: addr2line.1 2066 2011-10-26 15:40:28Z jkoshy $ +.\" $Id: addr2line.1 3195 2015-05-12 17:22:19Z emaste $ .\" .Dd July 25, 2010 .Os @@ -99,7 +99,7 @@ Print a help message. Print a version identifier and exit. .El .Sh OUTPUT FORMAT -If the +If the .Fl f option was not specified, .Nm @@ -156,4 +156,4 @@ its source file and line number use: The .Nm utility was written by -.An "Kai Wang" Aq kaiwang27@users.sourceforge.net . +.An Kai Wang Aq Mt kaiwang27@users.sourceforge.net . diff --git a/addr2line/addr2line.c b/addr2line/addr2line.c index d6f5d73e8d7a..cfdcc745f9fb 100644 --- a/addr2line/addr2line.c +++ b/addr2line/addr2line.c @@ -39,7 +39,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: addr2line.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: addr2line.c 3197 2015-05-12 21:01:31Z emaste $"); static struct option longopts[] = { {"target" , required_argument, NULL, 'b'}, @@ -84,6 +84,44 @@ version(void) exit(0); } +/* + * Handle DWARF 4 'offset from' DW_AT_high_pc. Although we don't + * fully support DWARF 4, some compilers (like FreeBSD Clang 3.5.1) + * generate DW_AT_high_pc as an offset from DW_AT_low_pc. + * + * "If the value of the DW_AT_high_pc is of class address, it is the + * relocated address of the first location past the last instruction + * associated with the entity; if it is of class constant, the value + * is an unsigned integer offset which when added to the low PC gives + * the address of the first location past the last instruction + * associated with the entity." + * + * DWARF4 spec, section 2.17.2. + */ +static int +handle_high_pc(Dwarf_Die die, Dwarf_Unsigned lopc, Dwarf_Unsigned *hipc) +{ + Dwarf_Error de; + Dwarf_Half form; + Dwarf_Attribute at; + int ret; + + ret = dwarf_attr(die, DW_AT_high_pc, &at, &de); + if (ret == DW_DLV_ERROR) { + warnx("dwarf_attr failed: %s", dwarf_errmsg(de)); + return (ret); + } + ret = dwarf_whatform(at, &form, &de); + if (ret == DW_DLV_ERROR) { + warnx("dwarf_whatform failed: %s", dwarf_errmsg(de)); + return (ret); + } + if (dwarf_get_form_class(2, 0, 0, form) == DW_FORM_CLASS_CONSTANT) + *hipc += lopc; + + return (DW_DLV_OK); +} + static void search_func(Dwarf_Debug dbg, Dwarf_Die die, Dwarf_Addr addr, const char **rlt_func) @@ -108,6 +146,8 @@ search_func(Dwarf_Debug dbg, Dwarf_Die die, Dwarf_Addr addr, if (dwarf_attrval_unsigned(die, DW_AT_low_pc, &lopc, &de) || dwarf_attrval_unsigned(die, DW_AT_high_pc, &hipc, &de)) goto cont_search; + if (handle_high_pc(die, lopc, &hipc) != DW_DLV_OK) + goto cont_search; if (addr < lopc || addr >= hipc) goto cont_search; @@ -202,6 +242,8 @@ translate(Dwarf_Debug dbg, const char* addrstr) * Check if the address falls into the PC range of * this CU. */ + if (handle_high_pc(die, lopc, &hipc) != DW_DLV_OK) + continue; if (addr < lopc || addr >= hipc) continue; } @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: ar.1 2742 2012-12-10 18:47:36Z jkoshy $ +.\" $Id: ar.1 3195 2015-05-12 17:22:19Z emaste $ .\" .Dd December 10, 2012 .Os @@ -194,11 +194,11 @@ from the archive specified by argument The archive's symbol table, if present, is updated to reflect the new contents of the archive. .It Fl D -When used in combination with the +When used in combination with the .Fl r or .Fl q -option, insert 0's instead of the real mtime, uid and gid values +option, insert 0's instead of the real mtime, uid and gid values and 0644 instead of file mode from the members named by arguments .Ar . This ensures that checksums on the resulting archives are reproducible @@ -346,7 +346,7 @@ or options, .Nm gives a file-by-file description of the archive modification being -performed, which consists of three white-space seperated fields: +performed, which consists of three white-space separated fields: the option letter, a dash .Dq "-" , and the file name. @@ -554,7 +554,7 @@ using MRI librarian commands, use the following script: .Bd -literal -offset indent create ex.a * specify the output archive addmod ex1.o ex2.o * add modules -save * save pending changes +save * save pending changes end * exit the utility .Ed .Sh DIAGNOSTICS @@ -594,7 +594,7 @@ An command first appeared in AT&T UNIX Version 1. In .Fx 8.0 , -.An "Kai Wang" Aq kaiw@FreeBSD.org +.An Kai Wang Aq Mt kaiw@FreeBSD.org reimplemented .Nm using the @@ -21,7 +21,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: ar.5 2066 2011-10-26 15:40:28Z jkoshy $ +.\" $Id: ar.5 3182 2015-04-10 16:08:10Z emaste $ .\" .Dd November 28, 2010 .Os @@ -126,7 +126,7 @@ The BSD and SVR4/GNU variants use different schemes for encoding file names for members. .Bl -tag -width "SVR4/GNU" .It "BSD" -File names that are upto 16 bytes long and which do not contain +File names that are up to 16 bytes long and which do not contain embedded spaces are stored directly in the .Ar ar_name field of the archive header. @@ -164,7 +164,7 @@ ASCII .Dq "A BC D" .Pc . .It "SVR4/GNU" -File names that are upto 15 characters long are stored directly in the +File names that are up to 15 characters long are stored directly in the .Ar ar_name field of the header, terminated by a .Dq Li / @@ -237,7 +237,7 @@ the ASCII string No padding is used to separate adjacent file names. .Ss "Archive Symbol Tables" Archive symbol tables are used to speed up link editing by providing a -mapping between the program symbols defined in the archive +mapping between the program symbols defined in the archive and the corresponding archive members. Archive symbol tables are managed by the .Xr ranlib 1 @@ -72,7 +72,7 @@ #include "ar.h" -ELFTC_VCSID("$Id: ar.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: ar.c 3183 2015-04-10 16:18:42Z emaste $"); enum options { @@ -117,7 +117,7 @@ main(int argc, char **argv) /* * Act like ranlib if our name ends in "ranlib"; this - * accomodates names like "arm-freebsd7.1-ranlib", + * accommodates names like "arm-freebsd7.1-ranlib", * "bsdranlib", etc. */ len = strlen(bsdar->progname); diff --git a/ar/ranlib.1 b/ar/ranlib.1 index 0f47deaad04e..89ab4ab49cab 100644 --- a/ar/ranlib.1 +++ b/ar/ranlib.1 @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: ranlib.1 2739 2012-12-09 17:07:46Z jkoshy $ +.\" $Id: ranlib.1 3195 2015-05-12 17:22:19Z emaste $ .\" .Dd December 9, 2012 .Os @@ -77,7 +77,7 @@ command first appeared in AT&T UNIX Version 7. .Pp In .Fx 8.0 , -.An "Kai Wang" Aq kaiw@FreeBSD.org +.An Kai Wang Aq Mt kaiw@FreeBSD.org reimplemented .Nm using the diff --git a/ar/read.c b/ar/read.c index 84bb032231a7..08b3224db17e 100644 --- a/ar/read.c +++ b/ar/read.c @@ -38,7 +38,7 @@ #include "ar.h" -ELFTC_VCSID("$Id: read.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: read.c 3180 2015-04-09 15:13:57Z emaste $"); /* * Handle read modes: 'x', 't' and 'p'. @@ -181,7 +181,7 @@ ar_read_archive(struct bsdar *bsdar, int mode) continue; } /* Basic path security flags. */ - flags = ARCHIVE_EXTRACT_SECURE_SYMLINKS | \ + flags = ARCHIVE_EXTRACT_SECURE_SYMLINKS | ARCHIVE_EXTRACT_SECURE_NODOTDOT; if (bsdar->options & AR_O) flags |= ARCHIVE_EXTRACT_TIME; diff --git a/ar/write.c b/ar/write.c index 0b962d22cd82..90be5da11937 100644 --- a/ar/write.c +++ b/ar/write.c @@ -40,7 +40,7 @@ #include "ar.h" -ELFTC_VCSID("$Id: write.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: write.c 3183 2015-04-10 16:18:42Z emaste $"); #define _ARMAG_LEN 8 /* length of the magic string */ #define _ARHDR_LEN 60 /* length of the archive header */ @@ -69,7 +69,7 @@ static void write_objs(struct bsdar *bsdar); /* * Create an object from a file, and return the created object * descriptor. Return NULL if either an error occurs, or if the '-u' - * option was specifed and the member is not newer than the existing + * option was specified and the member is not newer than the existing * one in the archive. */ static struct ar_obj * @@ -426,7 +426,7 @@ ar_write_archive(struct bsdar *bsdar, int mode) if (mode == 'A') { /* * Read objects from the target archive of the - * 'ADDLIB' command. If there are members spcified in + * 'ADDLIB' command. If there are members specified in * 'argv', read those members only, otherwise the * entire archive will be read. */ @@ -447,7 +447,7 @@ ar_write_archive(struct bsdar *bsdar, int mode) /* * If we cannot find the position specified by the - * user, sliently insert objects at the tail of the + * user, silently insert objects at the tail of the * list. */ if (pos == NULL) diff --git a/brandelf/brandelf.1 b/brandelf/brandelf.1 index 5913360d87bd..1c2e485e44e1 100644 --- a/brandelf/brandelf.1 +++ b/brandelf/brandelf.1 @@ -26,7 +26,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD: src/usr.bin/brandelf/brandelf.1,v 1.17 2007/03/09 14:36:18 ru Exp $ -.\" $Id: brandelf.1 3101 2014-10-27 22:24:40Z jkoshy $ +.\" $Id: brandelf.1 3195 2015-05-12 17:22:19Z emaste $ .\" .Dd October 27, 2014 .Dt BRANDELF 1 @@ -148,4 +148,4 @@ manual page first appeared in .Fx 2.2 . .Sh AUTHORS This manual page was written by -.An John-Mark Gurney Aq gurney_j@efn.org . +.An John-Mark Gurney Aq Mt gurney_j@efn.org . diff --git a/common/native-elf-format b/common/native-elf-format index 34d84bf28967..d36ab53806de 100755 --- a/common/native-elf-format +++ b/common/native-elf-format @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: native-elf-format 3167 2015-02-24 19:10:08Z emaste $ +# $Id: native-elf-format 3186 2015-04-16 22:16:40Z emaste $ # # Find the native ELF format for a host platform by compiling a # test object and examining the resulting object. @@ -33,7 +33,7 @@ $1 ~ "Data:" { $1 ~ "Machine:" { if (match($0, "Intel.*386")) { elfarch = "EM_386"; - } else if (match($0, ".*X86-64")) { + } else if (match($0, ".*[xX]86-64")) { elfarch = "EM_X86_64"; } else { elfarch = "unknown"; diff --git a/cxxfilt/c++filt.1 b/cxxfilt/c++filt.1 index 0a123c773c33..b191b44e8215 100644 --- a/cxxfilt/c++filt.1 +++ b/cxxfilt/c++filt.1 @@ -22,7 +22,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: c++filt.1 2175 2011-11-16 05:51:49Z jkoshy $ +.\" $Id: c++filt.1 3195 2015-05-12 17:22:19Z emaste $ .\" .Dd August 24, 2011 .Os @@ -106,4 +106,4 @@ and exit. The .Nm utility was written by -.An "Kai Wang" Aq kaiwang27@users.sourceforge.net . +.An Kai Wang Aq Mt kaiwang27@users.sourceforge.net . diff --git a/elfcopy/elfcopy.1 b/elfcopy/elfcopy.1 index ce8f120196ac..4889570ebc8e 100644 --- a/elfcopy/elfcopy.1 +++ b/elfcopy/elfcopy.1 @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elfcopy.1 3173 2015-03-27 16:46:13Z emaste $ +.\" $Id: elfcopy.1 3195 2015-05-12 17:22:19Z emaste $ .\" .Dd March 27, 2015 .Os @@ -330,4 +330,4 @@ Do not copy symbols that are not needed for relocation processing. .Sh HISTORY .Nm has been implemented by -.An "Kai Wang" Aq kaiwang27@users.sourceforge.net . +.An Kai Wang Aq Mt kaiwang27@users.sourceforge.net . diff --git a/elfcopy/sections.c b/elfcopy/sections.c index 077bb74b0f53..7c43a3577f2f 100644 --- a/elfcopy/sections.c +++ b/elfcopy/sections.c @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: sections.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: sections.c 3185 2015-04-11 08:56:34Z kaiwang27 $"); static void add_gnu_debuglink(struct elfcopy *ecp); static uint32_t calc_crc32(const char *p, size_t len, uint32_t crc); @@ -1223,6 +1223,14 @@ update_shdr(struct elfcopy *ecp, int update_link) osh.sh_info != 0) osh.sh_info = ecp->secndx[osh.sh_info]; + /* + * sh_info of SHT_GROUP section needs to point to the correct + * string in the symbol table. + */ + if (s->type == SHT_GROUP && (ecp->flags & SYMTAB_EXIST) && + (ecp->flags & SYMTAB_INTACT) == 0) + osh.sh_info = ecp->symndx[osh.sh_info]; + if (!gelf_update_shdr(s->os, &osh)) errx(EXIT_FAILURE, "gelf_update_shdr() failed: %s", elf_errmsg(-1)); diff --git a/elfcopy/segments.c b/elfcopy/segments.c index 3ed6d93bbcd1..1e271a6f4347 100644 --- a/elfcopy/segments.c +++ b/elfcopy/segments.c @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: segments.c 3177 2015-03-30 18:19:41Z emaste $"); +ELFTC_VCSID("$Id: segments.c 3196 2015-05-12 17:33:48Z emaste $"); static void insert_to_inseg_list(struct segment *seg, struct section *sec); @@ -442,7 +442,7 @@ copy_phdr(struct elfcopy *ecp) s = seg->v_sec[i]; seg->msz = s->vma + s->sz - seg->addr; if (s->type != SHT_NOBITS) - seg->fsz = seg->msz; + seg->fsz = s->off + s->sz - seg->off; } } diff --git a/elfcopy/symbols.c b/elfcopy/symbols.c index 49bb23988657..4a7d38a10812 100644 --- a/elfcopy/symbols.c +++ b/elfcopy/symbols.c @@ -33,7 +33,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: symbols.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: symbols.c 3191 2015-05-04 17:07:01Z jkoshy $"); /* Symbol table buffer structure. */ struct symbuf { @@ -1090,7 +1090,7 @@ str_hash(const char *s) { uint32_t hash; - for (hash = 2166136261; *s; s++) + for (hash = 2166136261UL; *s; s++) hash = (hash ^ *s) * 16777619; return (hash & (STHASHSIZE - 1)); diff --git a/elfdump/elfdump.1 b/elfdump/elfdump.1 index 80b2c244dc06..eae7262900a8 100644 --- a/elfdump/elfdump.1 +++ b/elfdump/elfdump.1 @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD: src/usr.bin/elfdump/elfdump.1,v 1.6 2005/01/18 13:43:48 ru Exp $ -.\" $Id: elfdump.1 2069 2011-10-26 15:53:48Z jkoshy $ +.\" $Id: elfdump.1 3195 2015-05-12 17:22:19Z emaste $ .\" .Dd August 25, 2011 .Dt ELFDUMP 1 @@ -141,14 +141,14 @@ The .Nm utility was written by -.An Jake Burkholder Aq jake@FreeBSD.org . +.An Jake Burkholder Aq Mt jake@FreeBSD.org . Later it was rewritten based on the libelf library. This manual page was written by -.An David O'Brien Aq obrien@FreeBSD.org . +.An David O'Brien Aq Mt obrien@FreeBSD.org . .Pp -.An Kai Wang Aq kaiw@FreeBSD.org +.An Kai Wang Aq Mt kaiw@FreeBSD.org rewrote it using the .Lb libelf and implemented additional functionality. diff --git a/elfdump/elfdump.c b/elfdump/elfdump.c index 93420fed936c..aee56b1ccfc7 100644 --- a/elfdump/elfdump.c +++ b/elfdump/elfdump.c @@ -50,7 +50,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: elfdump.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: elfdump.c 3189 2015-04-20 17:02:01Z emaste $"); #if defined(ELFTC_NEED_ELF_NOTE_DEFINITION) #include "native-elf-format.h" @@ -933,12 +933,11 @@ main(int ac, char **av) errx(EXIT_FAILURE, "ELF library initialization failed: %s", elf_errmsg(-1)); - for (i = 0; i < ac; i++) - if (av[i] != NULL) { - ed->filename = av[i]; - ed->archive = NULL; - elf_print_object(ed); - } + for (i = 0; i < ac; i++) { + ed->filename = av[i]; + ed->archive = NULL; + elf_print_object(ed); + } exit(EXIT_SUCCESS); } diff --git a/findtextrel/findtextrel.1 b/findtextrel/findtextrel.1 index ee88b8ecba00..125cc7ffbf3a 100644 --- a/findtextrel/findtextrel.1 +++ b/findtextrel/findtextrel.1 @@ -22,7 +22,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: findtextrel.1 2069 2011-10-26 15:53:48Z jkoshy $ +.\" $Id: findtextrel.1 3195 2015-05-12 17:22:19Z emaste $ .\" .Dd August 25, 2011 .Os @@ -101,4 +101,4 @@ toolset from Red Hat, Inc. This implementation of the .Nm utility was created by -.An "Kai Wang" Aq kaiwang27@users.sourceforge.net . +.An Kai Wang Aq Mt kaiwang27@users.sourceforge.net . diff --git a/isa/isa.1 b/isa/isa.1 index 2543aea8b05c..c987bdcd6621 100644 --- a/isa/isa.1 +++ b/isa/isa.1 @@ -22,7 +22,7 @@ \" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, \" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Id: isa.1 2889 2013-01-13 15:36:04Z jkoshy $ +.\" $Id: isa.1 3195 2015-05-12 17:22:19Z emaste $ .\" .Dd January 13, 2013 .Os @@ -237,8 +237,7 @@ Elftoolchain project. The .Xr isa 1 utility was written by -.An Joseph Koshy -.Aq jkoshy@users.sourceforge.net . +.An Joseph Koshy Aq Mt jkoshy@users.sourceforge.net . .Sh BUGS The .Nm diff --git a/isa/isa.5 b/isa/isa.5 index 3fe6c189316c..211d0e1f836a 100644 --- a/isa/isa.5 +++ b/isa/isa.5 @@ -22,7 +22,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Id: isa.5 2900 2013-01-16 12:27:01Z jkoshy $ +.\" $Id: isa.5 3195 2015-05-12 17:22:19Z emaste $ .\" .Dd January 16, 2013 .Os @@ -352,8 +352,7 @@ Elftoolchain project. The .Xr isa 1 utility was written by -.An Joseph Koshy -.Aq jkoshy@users.sourceforge.net . +.An Joseph Koshy Aq Mt jkoshy@users.sourceforge.net . .Sh BUGS The .Nm diff --git a/libdwarf/dwarf.3 b/libdwarf/dwarf.3 index 5363034c45ae..dbb417908094 100644 --- a/libdwarf/dwarf.3 +++ b/libdwarf/dwarf.3 @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: dwarf.3 3130 2014-12-21 20:06:29Z jkoshy $ +.\" $Id: dwarf.3 3195 2015-05-12 17:22:19Z emaste $ .\" .Dd December 21, 2014 .Os @@ -44,7 +44,7 @@ is defined by the DWARF standard, see .Xr dwarf 4 . .Pp The -.Xr DWARF 3 +.Xr DWARF 3 API has two parts: .Bl -bullet .It @@ -349,7 +349,7 @@ Retrieve a debugging information entry given an offset. .It Fn dwarf_siblingof , Fn dwarf_siblingof_b Retrieve the sibling descriptor for a debugging information entry. .It Fn dwarf_srclang -Retrive the source language attribute for a debugging information +Retrieve the source language attribute for a debugging information entry. .It Fn dwarf_tag Retrieve the tag for a debugging information entry. @@ -742,12 +742,12 @@ The DWARF standard is defined by 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 jb@FreeBSD.org +.An John Birrell Aq Mt jb@FreeBSD.org for the FreeBSD project. The implementation was subsequently revised and completed by -.An "Kai Wang" Aq kaiwang27@users.sourceforge.net . +.An Kai Wang Aq Mt kaiwang27@users.sourceforge.net . .Pp Manual pages for this implementation were written by -.An "Joseph Koshy" Aq jkoshy@users.sourceforge.net +.An Joseph Koshy Aq Mt jkoshy@users.sourceforge.net and -.An "Kai Wang" Aq kaiwang27@users.sourceforge.net . +.An Kai Wang Aq Mt kaiwang27@users.sourceforge.net . diff --git a/libdwarf/dwarf_add_line_entry.3 b/libdwarf/dwarf_add_line_entry.3 index 22377176245a..16e807512a44 100644 --- a/libdwarf/dwarf_add_line_entry.3 +++ b/libdwarf/dwarf_add_line_entry.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_add_line_entry.3 2953 2013-06-30 20:21:38Z kaiwang27 $ +.\" $Id: dwarf_add_line_entry.3 3182 2015-04-10 16:08:10Z emaste $ .\" .Dd June 30, 2013 .Os @@ -66,7 +66,8 @@ Valid source file indices are those returned by the function .Pp Argument .Ar off -specifies a relocatable program address. The ELF symbol to be used +specifies a relocatable program address. +The ELF symbol to be used for relocation is set by a prior call to the function .Xr dwarf_lne_set_address 3 . .Pp diff --git a/libdwarf/dwarf_def_macro.3 b/libdwarf/dwarf_def_macro.3 index d4849b12d1ca..daa090f29f0a 100644 --- a/libdwarf/dwarf_def_macro.3 +++ b/libdwarf/dwarf_def_macro.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_def_macro.3 2122 2011-11-09 15:35:14Z jkoshy $ +.\" $Id: dwarf_def_macro.3 3182 2015-04-10 16:08:10Z emaste $ .\" .Dd November 9, 2011 .Os @@ -72,7 +72,7 @@ Argument .Ar value should point to a NUL-terminated string containing the value of the macro. -If the macro doesn't have a value, argument +If the macro does not have a value, argument .Ar value should be set to NULL. .Pp diff --git a/libdwarf/dwarf_expand_frame_instructions.3 b/libdwarf/dwarf_expand_frame_instructions.3 index eaeb32039c30..7bcd105f030f 100644 --- a/libdwarf/dwarf_expand_frame_instructions.3 +++ b/libdwarf/dwarf_expand_frame_instructions.3 @@ -22,14 +22,14 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_expand_frame_instructions.3 2122 2011-11-09 15:35:14Z jkoshy $ +.\" $Id: dwarf_expand_frame_instructions.3 3181 2015-04-10 13:22:51Z emaste $ .\" .Dd November 9, 2011 .Os .Dt DWARF_EXPAND_FRAME_INSTRUCTIONS 3 .Sh NAME .Nm dwarf_expand_frame_instructions -.Nd expand frame instructions +.Nd expand frame instructions .Sh LIBRARY .Lb libdwarf .Sh SYNOPSIS diff --git a/libdwarf/dwarf_formblock.3 b/libdwarf/dwarf_formblock.3 index 4ae824f68e9a..1ffb6e6fec0d 100644 --- a/libdwarf/dwarf_formblock.3 +++ b/libdwarf/dwarf_formblock.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_formblock.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_formblock.3 3182 2015-04-10 16:08:10Z emaste $ .\" .Dd July 23, 2010 .Os @@ -69,7 +69,7 @@ the DWARF(3) library. The application should not attempt to free this memory area. Portable code may indicate that the memory area is to be freed by -by using +using .Xr dwarf_dealloc 3 . .Sh RETURN VALUES Function diff --git a/libdwarf/dwarf_formflag.3 b/libdwarf/dwarf_formflag.3 index 93d5902c860a..2e23b3301661 100644 --- a/libdwarf/dwarf_formflag.3 +++ b/libdwarf/dwarf_formflag.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_formflag.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_formflag.3 3181 2015-04-10 13:22:51Z emaste $ .\" .Dd June 21, 2010 .Os @@ -58,7 +58,7 @@ or If argument .Ar err is not NULL, it will be used to return an error descriptor in case -of an error. +of an error. .Sh RETURN VALUES Function .Fn dwarf_formflag diff --git a/libdwarf/dwarf_formref.3 b/libdwarf/dwarf_formref.3 index 9e3458face08..abde30cfb9e4 100644 --- a/libdwarf/dwarf_formref.3 +++ b/libdwarf/dwarf_formref.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_formref.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_formref.3 3181 2015-04-10 13:22:51Z emaste $ .\" .Dd June 21, 2010 .Os @@ -101,7 +101,7 @@ ELF section. If argument .Ar err is not NULL, it will be used to return an error descriptor in case -of an error. +of an error. .Sh RETURN VALUES These functions return .Dv DW_DLV_OK diff --git a/libdwarf/dwarf_formsig8.3 b/libdwarf/dwarf_formsig8.3 index 5445324dd7af..a76c1107d9eb 100644 --- a/libdwarf/dwarf_formsig8.3 +++ b/libdwarf/dwarf_formsig8.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_formsig8.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_formsig8.3 3181 2015-04-10 13:22:51Z emaste $ .\" .Dd July 24, 2010 .Os @@ -56,7 +56,7 @@ must be If argument .Ar err is not NULL, it will be used to return an error descriptor in case -of an error. +of an error. .Sh RETURN VALUES Function .Fn dwarf_formsig8 diff --git a/libdwarf/dwarf_formudata.3 b/libdwarf/dwarf_formudata.3 index f95fdead898c..9ed154eebb97 100644 --- a/libdwarf/dwarf_formudata.3 +++ b/libdwarf/dwarf_formudata.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_formudata.3 2073 2011-10-27 03:30:47Z jkoshy $ +.\" $Id: dwarf_formudata.3 3181 2015-04-10 13:22:51Z emaste $ .\" .Dd June 21, 2010 .Os @@ -88,7 +88,7 @@ and If argument .Ar err is not NULL, it will be used to return an error descriptor in case -of an error. +of an error. .Sh RETURN VALUES These functions return .Dv DW_DLV_OK diff --git a/libdwarf/dwarf_get_fde_info_for_all_regs.3 b/libdwarf/dwarf_get_fde_info_for_all_regs.3 index 014d138a0e23..f55d3d68a5bb 100644 --- a/libdwarf/dwarf_get_fde_info_for_all_regs.3 +++ b/libdwarf/dwarf_get_fde_info_for_all_regs.3 @@ -22,7 +22,7 @@ .\" 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 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_fde_info_for_all_regs.3 3182 2015-04-10 16:08:10Z emaste $ .\" .Dd June 4, 2011 .Os @@ -90,7 +90,8 @@ typedef struct { For each of the register rules returned, the .Va dw_offset_relevant -field is set to 1 if the register rule has a offset value. The +field is set to 1 if the register rule has a offset value. +The .Va dw_regnum field is set to the register number associated with the regsiter rule. The diff --git a/libdwarf/dwarf_get_fde_info_for_reg.3 b/libdwarf/dwarf_get_fde_info_for_reg.3 index 3d468062602c..fd05814a3630 100644 --- a/libdwarf/dwarf_get_fde_info_for_reg.3 +++ b/libdwarf/dwarf_get_fde_info_for_reg.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_fde_info_for_reg.3 2071 2011-10-27 03:20:00Z jkoshy $ +.\" $Id: dwarf_get_fde_info_for_reg.3 3181 2015-04-10 13:22:51Z emaste $ .\" .Dd June 4, 2011 .Os @@ -99,7 +99,7 @@ counter address associated with the register rule found. If argument .Ar err is not NULL, it will be used to return an error descriptor in case -of an error. +of an error. .Ss COMPATIBILITY Function .Fn dwarf_get_fde_info_for_reg diff --git a/libdwarf/dwarf_get_ranges.3 b/libdwarf/dwarf_get_ranges.3 index 37847a1a9c22..15bad4dfd7ac 100644 --- a/libdwarf/dwarf_get_ranges.3 +++ b/libdwarf/dwarf_get_ranges.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_get_ranges.3 2122 2011-11-09 15:35:14Z jkoshy $ +.\" $Id: dwarf_get_ranges.3 3182 2015-04-10 16:08:10Z emaste $ .\" .Dd November 9, 2011 .Os @@ -137,7 +137,7 @@ For this type of entry, the field .Va dwr_addr1 is the value of the largest representable address offset, and .Va dwr_addr2 -is a base address for the begining and ending address offsets of +is a base address for the beginning and ending address offsets of subsequent address range entries in the list. .It Dv DW_RANGES_END An end of list mark. diff --git a/libdwarf/dwarf_hasattr.3 b/libdwarf/dwarf_hasattr.3 index 58758482d318..659887588563 100644 --- a/libdwarf/dwarf_hasattr.3 +++ b/libdwarf/dwarf_hasattr.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_hasattr.3 3142 2015-01-29 23:11:14Z jkoshy $ +.\" $Id: dwarf_hasattr.3 3181 2015-04-10 13:22:51Z emaste $ .\" .Dd April 17, 2010 .Os @@ -64,7 +64,7 @@ If the named attribute is not present, a zero is written instead. If argument .Ar err is not NULL, it will be used to return an error descriptor in case -of an error. +of an error. .Sh RETURN VALUES On success, function .Fn dwarf_hasattr diff --git a/libdwarf/dwarf_next_cu_header.3 b/libdwarf/dwarf_next_cu_header.3 index f172322daa48..f68867d7f21e 100644 --- a/libdwarf/dwarf_next_cu_header.3 +++ b/libdwarf/dwarf_next_cu_header.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_next_cu_header.3 3128 2014-12-21 20:06:22Z jkoshy $ +.\" $Id: dwarf_next_cu_header.3 3182 2015-04-10 16:08:10Z emaste $ .\" .Dd December 21, 2014 .Os @@ -220,8 +220,7 @@ unit in the section. .Ss Iterating Through Type Units in a Debug Context When a DWARF debug context is allocated using .Xr dwarf_init 3 , -an internal pointer assoicated with the context will point to the -fisrt +an internal pointer associated with the context will point to the first .Dq \&.debug_types section found in the debug object. The first call to function diff --git a/libdwarf/dwarf_producer_init.3 b/libdwarf/dwarf_producer_init.3 index 717335e45119..b8ca6a9ce657 100644 --- a/libdwarf/dwarf_producer_init.3 +++ b/libdwarf/dwarf_producer_init.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_producer_init.3 2074 2011-10-27 03:34:33Z jkoshy $ +.\" $Id: dwarf_producer_init.3 3182 2015-04-10 16:08:10Z emaste $ .\" .Dd August 20, 2011 .Os @@ -58,7 +58,7 @@ descriptor representing a DWARF producer instance. .Pp The argument .Ar errhand -should contain the adddress of a function to be called in case of an +should contain the address of a function to be called in case of an error. If this argument is .Dv NULL , diff --git a/libdwarf/dwarf_whatattr.3 b/libdwarf/dwarf_whatattr.3 index a975d3ec7d8a..d7f6dd4e38b9 100644 --- a/libdwarf/dwarf_whatattr.3 +++ b/libdwarf/dwarf_whatattr.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_whatattr.3 3142 2015-01-29 23:11:14Z jkoshy $ +.\" $Id: dwarf_whatattr.3 3181 2015-04-10 13:22:51Z emaste $ .\" .Dd May 22, 2010 .Os @@ -51,7 +51,7 @@ and writes it to the location pointed to by argument If argument .Ar err is not NULL, it will be used to return an error descriptor in case -of an error. +of an error. .Sh RETURN VALUES On success, function .Fn dwarf_whatattr diff --git a/libelf/elf.3 b/libelf/elf.3 index 618b4f7d92ab..20cb9445535d 100644 --- a/libelf/elf.3 +++ b/libelf/elf.3 @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf.3 3142 2015-01-29 23:11:14Z jkoshy $ +.\" $Id: elf.3 3195 2015-05-12 17:22:19Z emaste $ .\" .Dd July 28, 2014 .Os @@ -555,7 +555,7 @@ flag on an ELF descriptor using .Xr elf_flagelf 3 , following which the library will use the data offsets and alignments specified by the application when laying out the file. -Application control of file layout is described further in the +Application control of file layout is described further in the .Xr elf_update 3 manual page. .Pp @@ -608,5 +608,4 @@ The current implementation of the ELF(3) API appeared in .Fx 7.0 . .Sh AUTHORS The ELF library was written by -.An "Joseph Koshy" -.Aq jkoshy@FreeBSD.org . +.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org . diff --git a/libelf/elf_begin.3 b/libelf/elf_begin.3 index 960456afbd89..e6c11b60e865 100644 --- a/libelf/elf_begin.3 +++ b/libelf/elf_begin.3 @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_begin.3 2313 2011-12-11 06:19:24Z jkoshy $ +.\" $Id: elf_begin.3 3182 2015-04-10 16:08:10Z emaste $ .\" .Dd December 11, 2011 .Os @@ -272,7 +272,7 @@ was created. .It Bq Er ELF_E_ARGUMENT An .Xr ar 1 -archive was opened with with +archive was opened with .Ar cmd set to .Dv ELF_C_RDWR . diff --git a/libelf/elf_cntl.3 b/libelf/elf_cntl.3 index 32649d1f955e..257897590db2 100644 --- a/libelf/elf_cntl.3 +++ b/libelf/elf_cntl.3 @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_cntl.3 289 2009-01-08 08:26:08Z jkoshy $ +.\" $Id: elf_cntl.3 3181 2015-04-10 13:22:51Z emaste $ .\" .Dd August 9, 2006 .Os diff --git a/libelf/elf_getdata.3 b/libelf/elf_getdata.3 index 8816a5a0694f..68b28890b4d6 100644 --- a/libelf/elf_getdata.3 +++ b/libelf/elf_getdata.3 @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elf_getdata.3 1766 2011-08-22 06:01:03Z jkoshy $ +.\" $Id: elf_getdata.3 3181 2015-04-10 13:22:51Z emaste $ .\" .Dd January 26, 2011 .Os @@ -174,7 +174,7 @@ These functions return a valid pointer to a data descriptor if successful, or NULL if an error occurs. .Sh ERRORS These functions may fail with the following errors: -.Bl -tag -width "[ELF_E_RESOURCE]" +.Bl -tag -width "[ELF_E_RESOURCE]" .It Bq Er ELF_E_ARGUMENT Either of the arguments .Ar scn diff --git a/libelf/elf_open.3 b/libelf/elf_open.3 index dad969e2a202..3dd1e36a03f4 100644 --- a/libelf/elf_open.3 +++ b/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 2512 2012-05-31 06:15:57Z jkoshy $ +.\" $Id: elf_open.3 3181 2015-04-10 13:22:51Z emaste $ .\" .Dd May 31, 2012 .Os -.Dt ELF_OPEN 3 +.Dt ELF_OPEN 3 .Sh NAME .Nm elf_open .Nd open ELF objects and ar(1) archives diff --git a/libelf/elf_update.c b/libelf/elf_update.c index 70a7c2e21e25..6cc109daafcc 100644 --- a/libelf/elf_update.c +++ b/libelf/elf_update.c @@ -41,7 +41,7 @@ #include <sys/mman.h> #endif -ELFTC_VCSID("$Id: elf_update.c 3013 2014-03-23 06:16:59Z jkoshy $"); +ELFTC_VCSID("$Id: elf_update.c 3190 2015-05-04 15:23:08Z jkoshy $"); /* * Layout strategy: @@ -271,8 +271,10 @@ _libelf_compute_section_extents(Elf *e, Elf_Scn *s, off_t rc) * offsets and alignment for sanity. */ if (e->e_flags & ELF_F_LAYOUT) { - if (scn_alignment > sh_align || sh_offset % sh_align || - sh_size < scn_size) { + if (scn_alignment > sh_align || + sh_offset % sh_align || + sh_size < scn_size || + sh_offset % _libelf_falign(elftype, ec)) { LIBELF_SET_ERROR(LAYOUT, 0); return (0); } diff --git a/libelf/gelf.3 b/libelf/gelf.3 index a5d68cefc4ab..d00d5b330980 100644 --- a/libelf/gelf.3 +++ b/libelf/gelf.3 @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: gelf.3 3195 2015-05-12 17:22:19Z emaste $ .\" .Dd September 1, 2006 .Os @@ -197,5 +197,4 @@ This implementation of the API first appeared in .Fx 7.0 . .Sh AUTHORS The GElf API was implemented by -.An "Joseph Koshy" -.Aq jkoshy@FreeBSD.org . +.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org . diff --git a/libelftc/elftc_demangle.3 b/libelftc/elftc_demangle.3 index bbe67e52df0d..44cf0073ca55 100644 --- a/libelftc/elftc_demangle.3 +++ b/libelftc/elftc_demangle.3 @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elftc_demangle.3 2065 2011-10-26 15:24:47Z jkoshy $ +.\" $Id: elftc_demangle.3 3182 2015-04-10 16:08:10Z emaste $ .\" .Dd August 24, 2011 .Os @@ -88,7 +88,7 @@ To decode a name that uses an unknown encoding style use: .Bd -literal -offset indent char buffer[1024]; const char *funcname; - + funcname = ...; /* points to string to be demangled */ if (elftc_demangle(funcname, buffer, sizeof(buffer), 0) == 0) printf("Demangled name: %\\n", buffer); diff --git a/libelftc/elftc_symbol_table_create.3 b/libelftc/elftc_symbol_table_create.3 index 3ff2c3530201..76f90e9c643d 100644 --- a/libelftc/elftc_symbol_table_create.3 +++ b/libelftc/elftc_symbol_table_create.3 @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elftc_symbol_table_create.3 2825 2012-12-29 14:25:33Z jkoshy $ +.\" $Id: elftc_symbol_table_create.3 3182 2015-04-10 16:08:10Z emaste $ .\" .Dd December 29, 2012 .Os @@ -224,7 +224,7 @@ should point to a location that will be updated with one of the following values: .Bl -tag -width indent -compact -offset indent .It Dv ELFTC_INSERT_ERROR -An error occured during insertion of the symbol. +An error occurred during insertion of the symbol. .It Dv ELFTC_INSERT_EXISTING The name in argument .Ar symbolname diff --git a/libelftc/libelftc_dem_gnu3.c b/libelftc/libelftc_dem_gnu3.c index 05a6302816c9..1cdb0e7d4d29 100644 --- a/libelftc/libelftc_dem_gnu3.c +++ b/libelftc/libelftc_dem_gnu3.c @@ -36,7 +36,7 @@ #include "_libelftc.h" -ELFTC_VCSID("$Id: libelftc_dem_gnu3.c 3123 2014-12-21 05:46:19Z kaiwang27 $"); +ELFTC_VCSID("$Id: libelftc_dem_gnu3.c 3194 2015-05-05 17:55:16Z emaste $"); /** * @file cpp_demangle.c @@ -316,7 +316,7 @@ cpp_demangle_push_fp(struct cpp_demangle_data *ddata, rtn = 0; if ((len = strlen(f)) > 0) - rtn = cpp_demangle_push_str(ddata, f, len); + rtn = cpp_demangle_push_str(ddata, f, len); free(f); @@ -22,7 +22,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: nm.1 3145 2015-02-15 18:04:37Z emaste $ +.\" $Id: nm.1 3195 2015-05-12 17:22:19Z emaste $ .\" .Dd February 15, 2015 .Os @@ -335,4 +335,4 @@ were specified. The .Nm utility and this manual page were written by -.An Hyogeol Lee Aq hyogeollee@gmail.com . +.An Hyogeol Lee Aq Mt hyogeollee@gmail.com . diff --git a/readelf/readelf.1 b/readelf/readelf.1 index 8419d95fbce8..a71e85f24c8f 100644 --- a/readelf/readelf.1 +++ b/readelf/readelf.1 @@ -22,7 +22,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: readelf.1 3059 2014-06-02 00:42:32Z kaiwang27 $ +.\" $Id: readelf.1 3195 2015-05-12 17:22:19Z emaste $ .\" .Dd September 13, 2012 .Os @@ -194,4 +194,4 @@ separate lines. The .Nm utility was written by -.An "Kai Wang" Aq kaiwang27@users.sourceforge.net . +.An Kai Wang Aq Mt kaiwang27@users.sourceforge.net . diff --git a/readelf/readelf.c b/readelf/readelf.c index bca228cec135..29bc38955040 100644 --- a/readelf/readelf.c +++ b/readelf/readelf.c @@ -46,7 +46,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: readelf.c 3178 2015-03-30 18:29:13Z emaste $"); +ELFTC_VCSID("$Id: readelf.c 3189 2015-04-20 17:02:01Z emaste $"); /* * readelf(1) options. @@ -2673,7 +2673,7 @@ dump_phdr(struct readelf *re) { const char *rawfile; GElf_Phdr phdr; - size_t phnum; + size_t phnum, size; int i, j; #define PH_HDR "Type", "Offset", "VirtAddr", "PhysAddr", "FileSiz", \ @@ -2726,10 +2726,14 @@ dump_phdr(struct readelf *re) " 0x%16.16jx 0x%16.16jx %c%c%c" " %#jx\n", PH_CT); if (phdr.p_type == PT_INTERP) { - if ((rawfile = elf_rawfile(re->elf, NULL)) == NULL) { + if ((rawfile = elf_rawfile(re->elf, &size)) == NULL) { warnx("elf_rawfile failed: %s", elf_errmsg(-1)); continue; } + if (phdr.p_offset >= size) { + warnx("invalid program header offset"); + continue; + } printf(" [Requesting program interpreter: %s]\n", rawfile + phdr.p_offset); } @@ -4378,13 +4382,22 @@ dump_mips_options(struct readelf *re, struct section *s) p = d->d_buf; pe = p + d->d_size; while (p < pe) { + if (pe - p < 8) { + warnx("Truncated MIPS option header"); + return; + } kind = re->dw_decode(&p, 1); size = re->dw_decode(&p, 1); sndx = re->dw_decode(&p, 2); info = re->dw_decode(&p, 4); + if (size < 8 || size - 8 > pe - p) { + warnx("Malformed MIPS option header"); + return; + } + size -= 8; switch (kind) { case ODK_REGINFO: - dump_mips_odk_reginfo(re, p, size - 8); + dump_mips_odk_reginfo(re, p, size); break; case ODK_EXCEPTIONS: printf(" EXCEPTIONS FPU_MIN: %#x\n", @@ -4435,7 +4448,7 @@ dump_mips_options(struct readelf *re, struct section *s) default: break; } - p += size - 8; + p += size; } } @@ -7458,11 +7471,10 @@ main(int argc, char **argv) errx(EXIT_FAILURE, "ELF library initialization failed: %s", elf_errmsg(-1)); - for (i = 0; i < argc; i++) - if (argv[i] != NULL) { - re->filename = argv[i]; - dump_object(re); - } + for (i = 0; i < argc; i++) { + re->filename = argv[i]; + dump_object(re); + } exit(EXIT_SUCCESS); } diff --git a/size/size.1 b/size/size.1 index 70f3bfdcdf05..97f76c250d86 100644 --- a/size/size.1 +++ b/size/size.1 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: size.1 2043 2011-10-23 14:49:16Z jkoshy $ +.\" $Id: size.1 3195 2015-05-12 17:22:19Z emaste $ .\" .Dd August 25, 2011 .Dt SIZE 1 @@ -252,6 +252,6 @@ utility first appeared in The .Nm utility was re-written by -.An S. Sam Arun Raj Aq samarunraj@gmail.com +.An S. Sam Arun Raj Aq Mt samarunraj@gmail.com This manual page was written by -.An S. Sam Arun Raj Aq samarunraj@gmail.com +.An S. Sam Arun Raj Aq Mt samarunraj@gmail.com diff --git a/size/size.c b/size/size.c index 8380f750ded2..1d91d500146b 100644 --- a/size/size.c +++ b/size/size.c @@ -38,7 +38,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: size.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: size.c 3183 2015-04-10 16:18:42Z emaste $"); #define BUF_SIZE 1024 #define ELF_ALIGN(val,x) (((val)+(x)-1) & ~((x)-1)) @@ -600,7 +600,7 @@ handle_elf(char const *name) arhdr->ar_name); continue; } - /* Core dumps are handled seperately */ + /* Core dumps are handled separately */ if (elfhdr.e_shnum == 0 && elfhdr.e_type == ET_CORE) { exit_code = handle_core(name, elf, &elfhdr); (void) elf_end(elf); diff --git a/strings/strings.1 b/strings/strings.1 index d6816494e886..15ad7a7f1eb3 100644 --- a/strings/strings.1 +++ b/strings/strings.1 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: strings.1 2352 2011-12-19 11:21:10Z jkoshy $ +.\" $Id: strings.1 3195 2015-05-12 17:22:19Z emaste $ .\" .Dd December 19, 2011 .Dt STRINGS 1 @@ -157,6 +157,6 @@ when i386-only a.out format was dropped in favor of ELF. The .Nm utility was re-written by -.An S.Sam Arun Raj Aq samarunraj@gmail.com . +.An S.Sam Arun Raj Aq Mt samarunraj@gmail.com . This manual page was written by -.An S.Sam Arun Raj Aq samarunraj@gmail.com . +.An S.Sam Arun Raj Aq Mt samarunraj@gmail.com . diff --git a/test/ar/plugin/Makefile b/test/ar/plugin/Makefile index 36e33a35687c..f9644aea89f0 100644 --- a/test/ar/plugin/Makefile +++ b/test/ar/plugin/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile 3025 2014-04-18 16:20:25Z jkoshy $ +# $Id: Makefile 3192 2015-05-04 17:20:15Z jkoshy $ PLUGINS= ardiff teraser @@ -9,7 +9,9 @@ ${PLUGINS}: ${MAKE} -f Makefile.${plugin} .endfor -clean cleandepend depend: +test: .PHONY + +clean cleandepend depend: .PHONY .for plugin in ${PLUGINS} ${MAKE} -f Makefile.${plugin} ${.TARGET} .endfor diff --git a/test/elfcopy/plugin/Makefile b/test/elfcopy/plugin/Makefile index 36e33a35687c..f9644aea89f0 100644 --- a/test/elfcopy/plugin/Makefile +++ b/test/elfcopy/plugin/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile 3025 2014-04-18 16:20:25Z jkoshy $ +# $Id: Makefile 3192 2015-05-04 17:20:15Z jkoshy $ PLUGINS= ardiff teraser @@ -9,7 +9,9 @@ ${PLUGINS}: ${MAKE} -f Makefile.${plugin} .endfor -clean cleandepend depend: +test: .PHONY + +clean cleandepend depend: .PHONY .for plugin in ${PLUGINS} ${MAKE} -f Makefile.${plugin} ${.TARGET} .endfor |