[Bug tools/27041] eu-addr2line to support eu-stack -b format (address with {build-id})

2020-12-12 Thread fche at redhat dot com via Elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=27041

Frank Ch. Eigler  changed:

   What|Removed |Added

 CC||fche at redhat dot com

--- Comment #1 from Frank Ch. Eigler  ---
by the way, are you aware of "eu-stack -v ...", which does the addr2line
resolution internally?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Re: [PATCH] libdwelf: fix spelling typos in strings returned by dwelf_elf_e_machine_string

2020-12-12 Thread Mark Wielaard
On Sat, Dec 12, 2020 at 04:06:00AM +0300, Dmitry V. Levin wrote:
> embeded -> embedded
> Semicondutor -> Semiconductor

Thank. Pushed.


Re: [PATCH] src: fix spelling typos in argp help text and error diagnostics

2020-12-12 Thread Mark Wielaard
On Sat, Dec 12, 2020 at 04:27:37AM +0300, Dmitry V. Levin wrote:
> Since all these help text strings are marked for translation, apply the fixes
> to translation strings as well, this helps to avoid translations becoming 
> fuzzy.
> 
> lenght -> length
> occured -> occurred
> endianess -> endianness
> reversable -> reversible

Thanks. Pushed.


[Bug tools/27041] eu-addr2line to support eu-stack -b format (address with {build-id})

2020-12-12 Thread vt at altlinux dot org via Elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=27041

--- Comment #2 from Vitaly Chikunov  ---
Frank, yes, but point is to teach eu-addr2line. For example, user quickly saves
`eu-stack -b` (without the need of installing -debuginfo or accessing
debuginfod) and report it upstream.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[PATCH 00/12] Fix spelling typos in comments, tests, and text files

2020-12-12 Thread Dmitry V. Levin
This is the least significant part of all spelling fixes, most users
won't notice any difference at all, but it still makes sense to use
correct spelling.

Dmitry V. Levin (12):
  debuginfod: fix spelling typos in error diagnostics and comments
  backends: fix spelling typos in comments
  config: fix spelling typos in comments and %changelog
  libasm: fix spelling typos in comments
  libcpu: fix spelling typos in comments
  libdw: fix spelling typos in comments and ChangeLog
  libdwelf: fix spelling typos in comments
  libdwfl: fix spelling typos in comments and ChangeLog
  libelf: fix spelling typos in comments
  src: fix spelling typos in comments and ChangeLog
  tests: fix spelling typos in error diagnostics and comments
  Fix spelling typos in NEWS, NOTES, TODO, and in comments of
configure.ac

 ChangeLog |  7 +++
 NEWS  | 18 +-
 NOTES |  4 ++--
 TODO  |  2 +-
 backends/ChangeLog|  6 ++
 backends/aarch64_retval.c |  2 +-
 backends/ppc_cfi.c|  2 +-
 config/10-default-yama-scope.conf |  2 +-
 config/ChangeLog  |  6 ++
 config/elfutils.spec.in   | 12 ++--
 config/upload-release.sh  |  2 +-
 configure.ac  |  6 +++---
 debuginfod/ChangeLog  |  7 +++
 debuginfod/debuginfod-client.c|  4 ++--
 debuginfod/debuginfod.cxx |  6 +++---
 libasm/ChangeLog  |  5 +
 libasm/asm_begin.c|  2 +-
 libasm/asm_end.c  |  2 +-
 libcpu/ChangeLog  |  5 +
 libcpu/bpf_disasm.c   |  2 +-
 libcpu/i386_disasm.c  |  2 +-
 libdw/ChangeLog   | 11 ++-
 libdw/dwarf.h |  2 +-
 libdw/dwarf_begin_elf.c   |  2 +-
 libdw/dwarf_getlocation.c |  4 ++--
 libdw/dwarf_getsrclines.c |  2 +-
 libdw/libdw.h | 10 +-
 libdw/libdwP.h|  4 ++--
 libdwelf/ChangeLog|  3 +++
 libdwelf/dwelf_strtab.c   |  2 +-
 libdwelf/libdwelf.h   |  4 ++--
 libdwfl/ChangeLog | 13 ++---
 libdwfl/dwfl_module_getdwarf.c|  4 ++--
 libdwfl/dwfl_report_elf.c |  2 +-
 libdwfl/libdwfl.h |  8 
 libdwfl/linux-pid-attach.c|  2 +-
 libebl/ChangeLog  |  2 +-
 libelf/ChangeLog  | 11 +++
 libelf/common.h   |  2 +-
 libelf/elf32_checksum.c   |  2 +-
 libelf/elf_begin.c|  4 ++--
 libelf/elf_compress.c |  2 +-
 libelf/elf_compress_gnu.c |  2 +-
 libelf/gelf.h |  2 +-
 libelf/libelf.h   |  2 +-
 libelf/libelfP.h  |  2 +-
 src/ChangeLog | 14 --
 src/ar.c  |  4 ++--
 src/elfclassify.c |  6 +++---
 src/elfcompress.c |  2 +-
 src/elflint.c |  6 +++---
 src/readelf.c |  6 +++---
 src/size.c|  2 +-
 src/strings.c |  2 +-
 src/strip.c   |  2 +-
 tests/ChangeLog   | 11 +++
 tests/dwarf-die-addr-die.c|  2 +-
 tests/dwfl-bug-fd-leak.c  |  2 +-
 tests/elfstrmerge.c   |  4 ++--
 tests/run-lfs-symbols.sh  |  2 +-
 tests/run-readelf-line.sh |  2 +-
 tests/run-stack-demangled-test.sh |  2 +-
 tests/sectiondump.c   |  6 +++---
 tests/varlocs.c   |  2 +-
 64 files changed, 186 insertions(+), 99 deletions(-)


-- 
ldv


[PATCH 01/12] debuginfod: fix spelling typos in error diagnostics and comments

2020-12-12 Thread Dmitry V. Levin
Initalize -> Initialize
Unsucessful -> Unsuccessful
expession -> expression
incompatiblity -> incompatibility

Signed-off-by: Dmitry V. Levin 
---
 debuginfod/ChangeLog   | 7 +++
 debuginfod/debuginfod-client.c | 4 ++--
 debuginfod/debuginfod.cxx  | 6 +++---
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog
index 0a7e458f..379af287 100644
--- a/debuginfod/ChangeLog
+++ b/debuginfod/ChangeLog
@@ -1,3 +1,10 @@
+2020-12-12  Dmitry V. Levin  
+
+   * debuginfod-client.c (debuginfod_query_server): Fix spelling typos in
+   comments.
+   * debuginfod.cxx: Likewise.
+   (parse_opt): Fix spelling typos in error diagnostics.
+
 2020-12-08  Dmitry V. Levin  
 
* Makefile.am [LIBDEBUGINFOD]: Create libdebuginfod.so.1 first, turn
diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c
index a99f3c14..de26af5b 100644
--- a/debuginfod/debuginfod-client.c
+++ b/debuginfod/debuginfod-client.c
@@ -751,7 +751,7 @@ debuginfod_query_server (debuginfod_client *c,
 
   /* thereafter, goto out1 on error.  */
 
-  /* Initalize handle_data with default values. */
+  /* Initialize handle_data with default values. */
   for (int i = 0; i < num_urls; i++)
 {
   data[i].handle = NULL;
@@ -954,7 +954,7 @@ debuginfod_query_server (debuginfod_client *c,
 
   if (msg->data.result != CURLE_OK)
 {
-  /* Unsucessful query, determine error code.  */
+  /* Unsuccessful query, determine error code.  */
   switch (msg->data.result)
 {
 case CURLE_COULDNT_RESOLVE_HOST: rc = -EHOSTUNREACH; break; // 
no NXDOMAIN
diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx
index 41698787..9a697186 100644
--- a/debuginfod/debuginfod.cxx
+++ b/debuginfod/debuginfod.cxx
@@ -125,7 +125,7 @@ string_endswith(const string& haystack, const string& 
needle)
 }
 
 
-// Roll this identifier for every sqlite schema incompatiblity.
+// Roll this identifier for every sqlite schema incompatibility.
 #define BUILDIDS "buildids9"
 
 #if SQLITE_VERSION_NUMBER >= 3008000
@@ -521,13 +521,13 @@ parse_opt (int key, char *arg,
   regfree (&file_include_regex);
   rc = regcomp (&file_include_regex, arg, REG_EXTENDED|REG_NOSUB);
   if (rc != 0)
-argp_failure(state, 1, EINVAL, "regular expession");
+argp_failure(state, 1, EINVAL, "regular expression");
   break;
 case 'X':
   regfree (&file_exclude_regex);
   rc = regcomp (&file_exclude_regex, arg, REG_EXTENDED|REG_NOSUB);
   if (rc != 0)
-argp_failure(state, 1, EINVAL, "regular expession");
+argp_failure(state, 1, EINVAL, "regular expression");
   break;
 case ARGP_KEY_FDCACHE_FDS:
   fdcache_fds = atol (arg);
-- 
ldv


[PATCH 02/12] backends: fix spelling typos in comments

2020-12-12 Thread Dmitry V. Levin
adress -> address
sigle -> single

Signed-off-by: Dmitry V. Levin 
---
 backends/ChangeLog| 6 ++
 backends/aarch64_retval.c | 2 +-
 backends/ppc_cfi.c| 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/backends/ChangeLog b/backends/ChangeLog
index e88dedf9..f22cd57f 100644
--- a/backends/ChangeLog
+++ b/backends/ChangeLog
@@ -1,3 +1,9 @@
+2020-12-12  Dmitry V. Levin  
+
+   * aarch64_retval.c (aarch64_return_value_location): Fix spelling typo
+   in comment.
+   * ppc_cfi.c (ppc_abi_cfi): Likewise.
+
 2020-11-17  Mark Wielard  
 
* x86_64_symbol.c (x86_64_check_reloc_target_type): New function.
diff --git a/backends/aarch64_retval.c b/backends/aarch64_retval.c
index 1308340b..72d4e8a3 100644
--- a/backends/aarch64_retval.c
+++ b/backends/aarch64_retval.c
@@ -332,7 +332,7 @@ aarch64_return_value_location (Dwarf_Die *functypedie, 
const Dwarf_Op **locp)
  switch (size)
{
case 2: /* half */
-   case 4: /* sigle */
+   case 4: /* single */
case 8: /* double */
case 16: /* quad */
  return pass_in_simd (locp);
diff --git a/backends/ppc_cfi.c b/backends/ppc_cfi.c
index 55169aef..b4700360 100644
--- a/backends/ppc_cfi.c
+++ b/backends/ppc_cfi.c
@@ -42,7 +42,7 @@ ppc_abi_cfi (Ebl *ebl __attribute__ ((unused)), Dwarf_CIE 
*abi_info)
 {
   /* This instruction is provided in every CIE.  It is not repeated here:
 DW_CFA_def_cfa, ULEB128_7 (1), ULEB128_7 (0)  */
-  /* r1 is assumed to be restored from cfa adress,
+  /* r1 is assumed to be restored from cfa address,
 r1 acts as a stack frame pointer.  */
   DW_CFA_val_offset, ULEB128_7 (1), ULEB128_7 (0),
   /* lr is not callee-saved but it needs to be preserved as it is pre-set
-- 
ldv


[PATCH 03/12] config: fix spelling typos in comments and %changelog

2020-12-12 Thread Dmitry V. Levin
directoy -> directory
fo -> for
funtions -> functions
ist -> is
mutliple -> multiple
priviliges -> privileges
reenable -> re-enable

Signed-off-by: Dmitry V. Levin 
---
 config/10-default-yama-scope.conf |  2 +-
 config/ChangeLog  |  6 ++
 config/elfutils.spec.in   | 12 ++--
 config/upload-release.sh  |  2 +-
 4 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/config/10-default-yama-scope.conf 
b/config/10-default-yama-scope.conf
index ba78ebd5..4df20903 100644
--- a/config/10-default-yama-scope.conf
+++ b/config/10-default-yama-scope.conf
@@ -17,7 +17,7 @@
 # domains. A different way to restrict ptrace is to set the selinux
 # deny_ptrace boolean. Both mechanisms will break some programs relying
 # on the ptrace system call and might force users to elevate their
-# priviliges to root to do their work.
+# privileges to root to do their work.
 #
 # For more information see Documentation/security/Yama.txt in the kernel
 # sources. Which also describes the defaults when CONFIG_SECURITY_YAMA
diff --git a/config/ChangeLog b/config/ChangeLog
index e4da0ebc..f0305985 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,9 @@
+2020-12-12  Dmitry V. Levin  
+
+   * 10-default-yama-scope.conf: Fix spelling typo in comment.
+   * upload-release.sh: Likewise.
+   * elfutils.spec.in: Fix spelling typos in %changelog.
+
 2020-11-04  Dmitry V. Levin  
 
* profile.sh.in, profile.csh.in: Do not define $DEBUGINFOD_URLS unless
diff --git a/config/elfutils.spec.in b/config/elfutils.spec.in
index c01b5f88..a8b63517 100644
--- a/config/elfutils.spec.in
+++ b/config/elfutils.spec.in
@@ -421,7 +421,7 @@ exit 0
 CVE-2019-7664, CVE-2019-7665.
 
 * Wed Nov 14 2018 Mark Wielaard  0.175-1
-- readelf: Handle mutliple .debug_macro sections.
+- readelf: Handle multiple .debug_macro sections.
   Recognize and parse GNU Property notes, NT_VERSION notes and
   GNU Build Attribute ELF Notes.
 - strip: Handle SHT_GROUP correctly.
@@ -780,7 +780,7 @@ exit 0
 
 * Mon Feb 16 2009 Ulrich Drepper  0.140-1
 - libelf: Fix regression in creation of section header
-- libdwfl: Less strict behavior if DWARF reader ist just used to
+- libdwfl: Less strict behavior if DWARF reader is just used to
   display data
 
 * Thu Jan 22 2009 Ulrich Drepper  0.139-1
@@ -839,8 +839,8 @@ ET_REL
 * Mon Oct 15 2007 Ulrich Drepper  0.130-1
 - readelf: -p option can take an argument like -x for one section,
 or no argument (as before) for all SHF_STRINGS sections;
-new option --archive-index (or -c); improved -n output fo
-r core files, on many machines
+new option --archive-index (or -c); improved -n output for
+core files, on many machines
 - libelf: new function elf_getdata_rawchunk, replaces gelf_rawchunk;
new functions gelf_getnote, gelf_getauxv, gelf_update_auxv
 - readelf, elflint: handle SHT_NOTE sections without requiring phdrs
@@ -1006,7 +1006,7 @@ symbols.
 - readelf: improve DWARF output format
 
 * Mon Apr  4 2005 Ulrich Drepper  0.106-1
-- libdw: Updated dwarf.h from DWARF3 speclibdw: add new funtions dwarf_f
+- libdw: Updated dwarf.h from DWARF3 speclibdw: add new functions dwarf_f
 unc_entrypc, dwarf_func_file, dwarf_func_line,dwarf_func_col, dwarf_ge
 tsrc_file
 
@@ -1104,7 +1104,7 @@ tsrc_file
 * Wed Jan 22 2003 Jakub Jelinek  0.72-4
 - fix arguments to gelf_getsymshndx and elf_getshstrndx
 - fix other warnings
-- reenable checks on s390x
+- re-enable checks on s390x
 
 * Sat Jan 11 2003 Karsten Hopp  0.72-3
 - temporarily disable checks on s390x, until someone has
diff --git a/config/upload-release.sh b/config/upload-release.sh
index 18c91c0e..ba43aa1f 100755
--- a/config/upload-release.sh
+++ b/config/upload-release.sh
@@ -20,7 +20,7 @@ echo Make sure the git repo is tagged, signed and pushed
 echo git tag -s -m \"elfutils $VERSION release\" elfutils-$VERSION
 echo git push --tags
 
-# Create a temporary directoy and make sure it is cleaned up.
+# Create a temporary directory and make sure it is cleaned up.
 tempdir=$(mktemp -d) || exit
 trap "rm -rf -- ${tempdir}" EXIT
 
-- 
ldv


[PATCH 04/12] libasm: fix spelling typos in comments

2020-12-12 Thread Dmitry V. Levin
endianess -> endianness
setion -> section

Signed-off-by: Dmitry V. Levin 
---
 libasm/ChangeLog   | 5 +
 libasm/asm_begin.c | 2 +-
 libasm/asm_end.c   | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libasm/ChangeLog b/libasm/ChangeLog
index 6268b26c..78f1baa4 100644
--- a/libasm/ChangeLog
+++ b/libasm/ChangeLog
@@ -1,3 +1,8 @@
+2020-12-12  Dmitry V. Levin  
+
+   * asm_begin.c (prepare_binary_output): Fix spelling typo in comment.
+   * asm_end.c (binary_end): Likewise.
+
 2020-12-11  Dmitry V. Levin  
 
* Makefile.am (GCC_INCLUDE): Remove.
diff --git a/libasm/asm_begin.c b/libasm/asm_begin.c
index 6248786c..1df2d4ea 100644
--- a/libasm/asm_begin.c
+++ b/libasm/asm_begin.c
@@ -98,7 +98,7 @@ prepare_binary_output (AsmCtx_t *result, Ebl *ebl)
   /* Set the ELF version.  */
   ehdr->e_version = EV_CURRENT;
 
-  /* Use the machine, class, and endianess values from the Ebl descriptor.  */
+  /* Use the machine, class, and endianness values from the Ebl descriptor.  */
   ehdr->e_machine = ebl_get_elfmachine (ebl);
   ehdr->e_ident[EI_CLASS] = class;
   ehdr->e_ident[EI_DATA] = ebl_get_elfdata (ebl);
diff --git a/libasm/asm_end.c b/libasm/asm_end.c
index 3b8582fd..077d2aa5 100644
--- a/libasm/asm_end.c
+++ b/libasm/asm_end.c
@@ -257,7 +257,7 @@ binary_end (AsmCtx_t *ctx)
xndxdata->d_off = 0;
  }
 
-   /* Store the real section index in the extended setion
+   /* Store the real section index in the extended section
   index table.  */
assert ((size_t) ptr < ctx->nsymbol_tab + 1);
xshndx[ptr] = ndx;
-- 
ldv


[PATCH 05/12] libcpu: fix spelling typos in comments

2020-12-12 Thread Dmitry V. Levin
layed -> laid
adressing -> addressing

Signed-off-by: Dmitry V. Levin 
---
 libcpu/ChangeLog | 5 +
 libcpu/bpf_disasm.c  | 2 +-
 libcpu/i386_disasm.c | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libcpu/ChangeLog b/libcpu/ChangeLog
index a342b7f6..000105bf 100644
--- a/libcpu/ChangeLog
+++ b/libcpu/ChangeLog
@@ -1,3 +1,8 @@
+2020-12-12  Dmitry V. Levin  
+
+   * bpf_disasm.c (bswap_bpf_insn): Fix spelling typo in comment.
+   * i386_disasm.c (i386_disasm): Likewise.
+
 2020-05-09  Mark Wielaard  
 
* i386_parse.y (new_bitfield): Call free newp on error.
diff --git a/libcpu/bpf_disasm.c b/libcpu/bpf_disasm.c
index 3d92d014..62643c81 100644
--- a/libcpu/bpf_disasm.c
+++ b/libcpu/bpf_disasm.c
@@ -74,7 +74,7 @@ static void
 bswap_bpf_insn (struct bpf_insn *p)
 {
   /* Note that the dst_reg and src_reg fields are 4-bit bitfields.
- That means these two nibbles are (typically) layed out in the
+ That means these two nibbles are (typically) laid out in the
  opposite order between big- and little-endian hosts.  This is
  not required by any standard, but does happen to be true for
  at least ppc, s390, arm and mips as big-endian hosts.  */
diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c
index 32df8cd0..fd7340cc 100644
--- a/libcpu/i386_disasm.c
+++ b/libcpu/i386_disasm.c
@@ -588,7 +588,7 @@ i386_disasm (Ebl *ebl __attribute__((unused)),
}
 
  /* We have a match.  First determine how many bytes are
-needed for the adressing mode.  */
+needed for the addressing mode.  */
  param_start = codep;
  if (instrtab[cnt].modrm)
{
-- 
ldv


[PATCH 06/12] libdw: fix spelling typos in comments and ChangeLog

2020-12-12 Thread Dmitry V. Levin
Retieve -> Retrieve
apporiate -> appropriate
distinquish -> distinguish
dynamicly -> dynamically
indeces -> indices
lenght -> length
minium -> minimum
occured -> occurred
setion -> section
unknow -> unknown

Signed-off-by: Dmitry V. Levin 
---
 libdw/ChangeLog   | 11 ++-
 libdw/dwarf.h |  2 +-
 libdw/dwarf_begin_elf.c   |  2 +-
 libdw/dwarf_getlocation.c |  4 ++--
 libdw/dwarf_getsrclines.c |  2 +-
 libdw/libdw.h | 10 +-
 libdw/libdwP.h|  4 ++--
 7 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 2d552544..ab568f55 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,12 @@
+2020-12-12  Dmitry V. Levin  
+
+   * dwarf.h: Fix spelling typo in comment.
+   * dwarf_begin_elf.c (dwarf_begin_elf): Likewise.
+   * dwarf_getlocation.c (attr_ok, __libdw_intern_expression): Likewise.
+   * dwarf_getsrclines.c (read_srclines): Likewise.
+   * libdw.h: Fix spelling typos in comments.
+   * libdwP.h: Likewise.
+
 2020-12-09  Dmitry V. Levin  
 
* Makefile.am (noinst_PROGRAMS): Rename to noinst_DATA.
@@ -180,7 +189,7 @@
 2019-02-02  Mark Wielaard  
 
* dwarf_nextcu.c (__libdw_next_unit): Define bytes_end.
-   Check there are enough bytes to read extended lenght, version
+   Check there are enough bytes to read extended length, version
and unit.
 
 2019-01-20  Mark Wielaard  
diff --git a/libdw/dwarf.h b/libdw/dwarf.h
index 98b10437..19a4be96 100644
--- a/libdw/dwarf.h
+++ b/libdw/dwarf.h
@@ -1014,7 +1014,7 @@ enum
 /* Section 7.2.2 of the DWARF3 specification defines a range of escape
codes that can appear in the length field of certain DWARF structures.
 
-   These defines enumerate the minium and maximum values of this range.
+   These defines enumerate the minimum and maximum values of this range.
Currently only the maximum value is used (to indicate that 64-bit
values are going to be used in the dwarf data that accompanies the
structure).  The other values are reserved.
diff --git a/libdw/dwarf_begin_elf.c b/libdw/dwarf_begin_elf.c
index 474ed138..757ac4fa 100644
--- a/libdw/dwarf_begin_elf.c
+++ b/libdw/dwarf_begin_elf.c
@@ -457,7 +457,7 @@ dwarf_begin_elf (Elf *elf, Dwarf_Cmd cmd, Elf_Scn *scngrp)
}
 
   /* If the caller provides a section group we get the DWARF
-sections only from this setion group.  Otherwise we search
+sections only from this section group.  Otherwise we search
 for the first section with the required name.  Further
 sections with the name are ignored.  The DWARF specification
 does not really say this is allowed.  */
diff --git a/libdw/dwarf_getlocation.c b/libdw/dwarf_getlocation.c
index f2bad5a9..4e582db2 100644
--- a/libdw/dwarf_getlocation.c
+++ b/libdw/dwarf_getlocation.c
@@ -50,7 +50,7 @@ attr_ok (Dwarf_Attribute *attr)
 
   /* Otherwise must be one of the attributes listed below.  Older
  DWARF versions might have encoded the exprloc as block, and we
- cannot easily distinquish attributes in the loclist class because
+ cannot easily distinguish attributes in the loclist class because
  the same forms are used for different classes.  */
   switch (attr->code)
 {
@@ -388,7 +388,7 @@ __libdw_intern_expression (Dwarf *dbg, bool 
other_byte_order,
invalid:
  __libdw_seterrno (DWARF_E_INVALID_DWARF);
returnmem:
- /* Free any dynamicly allocated loclists, if any.  */
+ /* Free any dynamically allocated loclists, if any.  */
  while (n > MAX_STACK_LOCS)
{
  struct loclist *loc = loclist;
diff --git a/libdw/dwarf_getsrclines.c b/libdw/dwarf_getsrclines.c
index 75ec9c79..d6a581ad 100644
--- a/libdw/dwarf_getsrclines.c
+++ b/libdw/dwarf_getsrclines.c
@@ -757,7 +757,7 @@ read_srclines (Dwarf *dbg,
 
case DW_LNE_set_address:
  /* The value is an address.  The size is defined as
-apporiate for the target machine.  We use the
+appropriate for the target machine.  We use the
 address size field from the CU header.  */
  state.op_index = 0;
  if (unlikely (lineendp - linep < (uint8_t) address_size))
diff --git a/libdw/libdw.h b/libdw/libdw.h
index f63cab1b..77174d28 100644
--- a/libdw/libdw.h
+++ b/libdw/libdw.h
@@ -243,7 +243,7 @@ extern Dwarf *dwarf_begin_elf (Elf *elf, Dwarf_Cmd cmd, 
Elf_Scn *scngrp);
 /* Retrieve ELF descriptor used for DWARF access.  */
 extern Elf *dwarf_getelf (Dwarf *dwarf);
 
-/* Retieve DWARF descriptor used for a Dwarf_Die or Dwarf_Attribute.
+/* Retrieve DWARF descriptor used for a Dwarf_Die or Dwarf_Attribute.
A Dwarf_Die or a Dwarf_Attribute is associated with a particular
Dwarf_CU handle.  This function returns the DWARF descriptor for
that Dwarf_CU.  */
@@ -429,7 +429,7 @@ extern int dwarf_siblingof 

[PATCH 07/12] libdwelf: fix spelling typos in comments

2020-12-12 Thread Dmitry V. Levin
algorith -> algorithm
occured -> occurred

Signed-off-by: Dmitry V. Levin 
---
 libdwelf/ChangeLog  | 3 +++
 libdwelf/dwelf_strtab.c | 2 +-
 libdwelf/libdwelf.h | 4 ++--
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/libdwelf/ChangeLog b/libdwelf/ChangeLog
index 9d05390c..a0ff9f4f 100644
--- a/libdwelf/ChangeLog
+++ b/libdwelf/ChangeLog
@@ -1,5 +1,8 @@
 2020-12-12  Dmitry V. Levin  
 
+   * libdwelf.h: Fix spelling typos in comments.
+   * dwelf_strtab.c (newstring): Likewise.
+
* dwelf_elf_e_machine_string.c (dwelf_elf_e_machine_string): Fix
spelling typos in returned strings.
 
diff --git a/libdwelf/dwelf_strtab.c b/libdwelf/dwelf_strtab.c
index 01e091c8..c6ae7cdf 100644
--- a/libdwelf/dwelf_strtab.c
+++ b/libdwelf/dwelf_strtab.c
@@ -183,7 +183,7 @@ newstring (Dwelf_Strtab *st, const char *str, size_t len)
 
 
 /* XXX This function should definitely be rewritten to use a balancing
-   tree algorith (AVL, red-black trees).  For now a simple, correct
+   tree algorithm (AVL, red-black trees).  For now a simple, correct
implementation is enough.  */
 static Dwelf_Strent **
 searchstring (Dwelf_Strent **sep, Dwelf_Strent *newstr)
diff --git a/libdwelf/libdwelf.h b/libdwelf/libdwelf.h
index dbb8f08c..263ca60e 100644
--- a/libdwelf/libdwelf.h
+++ b/libdwelf/libdwelf.h
@@ -44,7 +44,7 @@ extern "C" {
 /* Returns the name and the CRC32 of the separate debug file from the
.gnu_debuglink section if found in the ELF.  Return NULL if the ELF
file didn't have a .gnu_debuglink section, had malformed data in the
-   section or some other error occured.  */
+   section or some other error occurred.  */
 extern const char *dwelf_elf_gnu_debuglink (Elf *elf, GElf_Word *crc);
 
 /* Returns the name and build ID from the .gnu_debugaltlink section if
@@ -69,7 +69,7 @@ extern ssize_t dwelf_elf_gnu_build_id (Elf *elf, const void 
**build_idp);
section.  The section name should start with .zdebug (but this
isn't checked by this function).  If the section isn't compressed
(the section data doesn't start with ZLIB) -1 is returned. If an
-   error occured -1 is returned and elf_errno is set.  */
+   error occurred -1 is returned and elf_errno is set.  */
 extern ssize_t dwelf_scn_gnu_compressed_size (Elf_Scn *scn);
 
 /* ELF/DWARF string table handling.  */
-- 
ldv


[PATCH 08/12] libdwfl: fix spelling typos in comments and ChangeLog

2020-12-12 Thread Dmitry V. Levin
adresses -> addresses
boundery -> boundary
explictly -> explicitly
fo -> for
layed -> laid
partical -> particular
setion -> section
substract -> subtract
wil -> will

Signed-off-by: Dmitry V. Levin 
---
 libdwfl/ChangeLog  | 13 ++---
 libdwfl/dwfl_module_getdwarf.c |  4 ++--
 libdwfl/dwfl_report_elf.c  |  2 +-
 libdwfl/libdwfl.h  |  8 
 libdwfl/linux-pid-attach.c |  2 +-
 5 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index c7f81acd..fc64eafd 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,10 @@
+2020-12-12  Dmitry V. Levin  
+
+   * libdwfl.h: Fix spelling typos in comments.
+   * dwfl_module_getdwarf.c (open_elf, find_symtab): Likewise.
+   * dwfl_report_elf.c (__libdwfl_elf_address_range): Likewise.
+   * linux-pid-attach.c (read_cached_memory): Likewise.
+
 2020-12-07  Timm Bäder  
 
* link_map.c (report_r_debug): Pull read_addrs() function into
@@ -816,7 +823,7 @@
* link_map.c (check32): Use read_4ubyte_unaligned_noncvt to read
type and value.
(read_addrs): Use read_(4|8)ubyte_unaligned_noncvt or to read
-   adresses.
+   addresses.
 
 2015-05-30  Mark Wielaard  
 
@@ -1738,7 +1745,7 @@
 
 2013-01-23  Mark Wielaard  
 
-   * dwfl_module_getdwarf.c (find_aux_sym): Don't substract one
+   * dwfl_module_getdwarf.c (find_aux_sym): Don't subtract one
from aux_syments by default.
(find_symtab): Also succeed when only aux_symdata is found.
When no symtab is found always try to load auxiliary table.
@@ -1746,7 +1753,7 @@
tables have symbols.
* dwfl_module_getsym.c (dwfl_module_getsym): Only skip auxiliary
zero entry when both tables have symbols.
-   * dwfl_module_addrsym.c (dwfl_module_addrsym): Only substract
+   * dwfl_module_addrsym.c (dwfl_module_addrsym): Only subtract
one from first_global when both tables have symbols.
 
 2013-01-16  Mark Wielaard  
diff --git a/libdwfl/dwfl_module_getdwarf.c b/libdwfl/dwfl_module_getdwarf.c
index 56e61054..2f3dd0dd 100644
--- a/libdwfl/dwfl_module_getdwarf.c
+++ b/libdwfl/dwfl_module_getdwarf.c
@@ -145,7 +145,7 @@ open_elf (Dwfl_Module *mod, struct dwfl_file *file)
}
 }
 
-  /* We only want to set the module e_type explictly once, derived from
+  /* We only want to set the module e_type explicitly once, derived from
  the main ELF file.  (It might be changed for the kernel, because
  that is special - see below.)  open_elf is always called first for
  the main ELF file, because both find_dw and find_symtab call
@@ -1141,7 +1141,7 @@ find_symtab (Dwfl_Module *mod)
 
   /* Cache the data; MOD->syments and MOD->first_global were set
  above.  If any of the sections is compressed, uncompress it
- first.  Only the string data setion could theoretically be
+ first.  Only the string data section could theoretically be
  compressed GNU style (as .zdebug_str).  Everything else only ELF
  gabi style (SHF_COMPRESSED).  */
 
diff --git a/libdwfl/dwfl_report_elf.c b/libdwfl/dwfl_report_elf.c
index 3fc9384a..9da86698 100644
--- a/libdwfl/dwfl_report_elf.c
+++ b/libdwfl/dwfl_report_elf.c
@@ -85,7 +85,7 @@ __libdwfl_elf_address_range (Elf *elf, GElf_Addr base, bool 
add_p_vaddr,
  const GElf_Addr next = (end + align - 1) & -align;
  if (shdr->sh_addr == 0
  /* Once we've started doing layout we have to do it all,
-unless we just layed out the first section at 0 when
+unless we just laid out the first section at 0 when
 it already was at 0.  */
  || (bias == 0 && end > start && end != next))
{
diff --git a/libdwfl/libdwfl.h b/libdwfl/libdwfl.h
index d5fa06d4..f98f1d52 100644
--- a/libdwfl/libdwfl.h
+++ b/libdwfl/libdwfl.h
@@ -42,7 +42,7 @@ typedef struct Dwfl_Module Dwfl_Module;
 typedef struct Dwfl_Line Dwfl_Line;
 
 /* This holds information common for all the frames of one backtrace for
-   a partical thread/task/TID.  Several threads belong to one Dwfl.  */
+   a particular thread/task/TID.  Several threads belong to one Dwfl.  */
 typedef struct Dwfl_Thread Dwfl_Thread;
 
 /* This holds everything we know about the state of the frame at a particular
@@ -471,7 +471,7 @@ extern const char *dwfl_module_addrname (Dwfl_Module *mod, 
GElf_Addr address);
 
 /* Find the symbol associated with ADDRESS.  Return its name or NULL
when nothing was found.  If the architecture uses function
-   descriptors, and symbol st_value points to one, ADDRESS wil be
+   descriptors, and symbol st_value points to one, ADDRESS will be
matched against either the adjusted st_value or the associated
function entry value as described in dwfl_module_getsym_info.  If
OFFSET is not NULL it will be filled in with the difference from
@@ -556,7 +556,7 @@ extern Dwarf_Die *dwfl_modu

[PATCH 09/12] libelf: fix spelling typos in comments

2020-12-12 Thread Dmitry V. Levin
Auxialiary -> Auxiliary
constucted -> constructed
desriptor -> descriptor
endianess -> endianness
responsibilty -> responsibility
sufficent -> sufficient

elf.h comes from glibc and therefore is excluded.

Signed-off-by: Dmitry V. Levin 
---
 libelf/ChangeLog  | 11 +++
 libelf/common.h   |  2 +-
 libelf/elf32_checksum.c   |  2 +-
 libelf/elf_begin.c|  4 ++--
 libelf/elf_compress.c |  2 +-
 libelf/elf_compress_gnu.c |  2 +-
 libelf/gelf.h |  2 +-
 libelf/libelf.h   |  2 +-
 libelf/libelfP.h  |  2 +-
 9 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/libelf/ChangeLog b/libelf/ChangeLog
index 38c0162a..41727fbd 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -1,3 +1,14 @@
+2020-12-12  Dmitry V. Levin  
+
+   * common.h: Fix spelling typo in comment.
+   * gelf.h: Likewise.
+   * libelf.h: Likewise.
+   * libelfP.h: Likewise.
+   * elf32_checksum.c (elfw2): Likewise.
+   * elf_begin.c (dup_elf, write_file): Likewise.
+   * elf_compress.c (__libelf_compress): Likewise.
+   * elf_compress_gnu.c (elf_compress_gnu): Likewise.
+
 2020-12-11  Dmitry V. Levin  
 
* Makefile.am (GCC_INCLUDE): Remove.
diff --git a/libelf/common.h b/libelf/common.h
index b0175f60..e41c717d 100644
--- a/libelf/common.h
+++ b/libelf/common.h
@@ -133,7 +133,7 @@ libelf_release_all (Elf *elf)
 }
 
 
-/* Macro to convert endianess in place.  It determines the function it
+/* Macro to convert endianness in place.  It determines the function it
has to use itself.  */
 #define CONVERT(Var) \
   (Var) = (sizeof (Var) == 1 \
diff --git a/libelf/elf32_checksum.c b/libelf/elf32_checksum.c
index f9dfccb2..c5f27bbe 100644
--- a/libelf/elf32_checksum.c
+++ b/libelf/elf32_checksum.c
@@ -115,7 +115,7 @@ elfw2(LIBELFBITS,checksum) (Elf *elf)
 
   /* To compute the checksum we need to get to the data.  For
 repeatable results we must use the external format.  The data
-we get with 'elf'getdata' might be changed for endianess
+we get with 'elf'getdata' might be changed for endianness
 reasons.  Therefore we use 'elf_rawdata' if possible.  But
 this function can fail if the data was constructed by the
 program.  In this case we have to use 'elf_getdata' and
diff --git a/libelf/elf_begin.c b/libelf/elf_begin.c
index 8107a103..43828c9a 100644
--- a/libelf/elf_begin.c
+++ b/libelf/elf_begin.c
@@ -1040,7 +1040,7 @@ dup_elf (int fildes, Elf_Cmd cmd, Elf *ref)
 }
 
   /* This is an archive.  We must create a descriptor for the archive
- member the internal pointer of the archive file desriptor is
+ member the internal pointer of the archive file descriptor is
  pointing to.  First read the header of the next member if this
  has not happened already.  */
   if (ref->state.ar.elf_ar_hdr.ar_name == NULL
@@ -1064,7 +1064,7 @@ dup_elf (int fildes, Elf_Cmd cmd, Elf *ref)
 }
 
 
-/* Return desriptor for empty file ready for writing.  */
+/* Return descriptor for empty file ready for writing.  */
 static struct Elf *
 write_file (int fd, Elf_Cmd cmd)
 {
diff --git a/libelf/elf_compress.c b/libelf/elf_compress.c
index 9d6f15c0..df0144e8 100644
--- a/libelf/elf_compress.c
+++ b/libelf/elf_compress.c
@@ -124,7 +124,7 @@ __libelf_compress (Elf_Scn *scn, size_t hsize, int ei_data,
   int flush = Z_NO_FLUSH;
   do
 {
-  /* Convert to raw if different endianess.  */
+  /* Convert to raw if different endianness.  */
   cdata = *data;
   bool convert = ei_data != MY_ELFDATA && data->d_size > 0;
   if (convert)
diff --git a/libelf/elf_compress_gnu.c b/libelf/elf_compress_gnu.c
index 7aed4640..3d2977e7 100644
--- a/libelf/elf_compress_gnu.c
+++ b/libelf/elf_compress_gnu.c
@@ -143,7 +143,7 @@ elf_compress_gnu (Elf_Scn *scn, int inflate, unsigned int 
flags)
 }
   else if (inflate == 0)
 {
-  /* In theory the user could have constucted a compressed section
+  /* In theory the user could have constructed a compressed section
 by hand.  And in practice they do. For example when copying
 a section from one file to another using elf_newdata. So we
 have to use elf_getdata (not elf_rawdata).  */
diff --git a/libelf/gelf.h b/libelf/gelf.h
index 06198803..7a3c87aa 100644
--- a/libelf/gelf.h
+++ b/libelf/gelf.h
@@ -95,7 +95,7 @@ typedef Elf64_Dyn GElf_Dyn;
 /* Version definition sections.  */
 typedef Elf64_Verdef GElf_Verdef;
 
-/* Auxialiary version information.  */
+/* Auxiliary version information.  */
 typedef Elf64_Verdaux GElf_Verdaux;
 
 /* Version dependency section.  */
diff --git a/libelf/libelf.h b/libelf/libelf.h
index 1ff11c95..a139e733 100644
--- a/libelf/libelf.h
+++ b/libelf/libelf.h
@@ -376,7 +376,7 @@ extern Elf64_Chdr *elf64_getchdr (Elf_Scn *__scn);
It is always an error to call these functions on SHT_NOBITS
sections or if the section has the SHF_ALLOC f

[PATCH 10/12] src: fix spelling typos in comments and ChangeLog

2020-12-12 Thread Dmitry V. Levin
Indeces -> Indices
adress -> address
affort -> afford
dont' -> don't
futher -> further
higest -> highest
indeces -> indices
interate -> iterate
occured -> occurred
overlow -> overflow
sectin -> section
succesful -> successful
teminated -> terminated

Signed-off-by: Dmitry V. Levin 
---
 src/ChangeLog | 14 --
 src/ar.c  |  4 ++--
 src/elfclassify.c |  6 +++---
 src/elfcompress.c |  2 +-
 src/elflint.c |  6 +++---
 src/readelf.c |  6 +++---
 src/size.c|  2 +-
 src/strings.c |  2 +-
 src/strip.c   |  2 +-
 9 files changed, 27 insertions(+), 17 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 0349f5c7..f5a02a36 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,15 @@
 2020-12-12  Dmitry V. Levin  
 
+   * ar.c (write_member, do_oper_insert): Fix spelling typo in comment.
+   * elfclassify.c (issue, elf_issue, is_unstripped): Likewise.
+   * elfcompress.c (process_file): Likewise.
+   * elflint.c (be_quiet, check_gnu_hash): Likewise.
+   * readelf.c (print_phdr, handle_gnu_hash,
+   dwarf_locexpr_opcode_string): Likewise.
+   * size.c (totals_class): Likewise.
+   * strings.c (read_elf): Likewise.
+   * strip.c (handle_elf): Likewise.
+
* readelf.c (print_debug_addr_section): Fix spelling typo in error
diagnostics.
* strip.c (options): Fix spelling typos in argp help text.
@@ -2798,7 +2808,7 @@
(show_symbols_posix): Likewise.
(show_symbols): Adjust calls to show_symbols_bsd and
show_symbols_posix.
-   (show_symbols_sysv): Avoid printing adress and size for undefined
+   (show_symbols_sysv): Avoid printing address and size for undefined
symbols.  Don't print initial special entry and section entries.
 
 2011-10-02  Ulrich Drepper  
@@ -3634,7 +3644,7 @@
 
* elflint.c (check_group): Check that signature symbol for section
group is not an empty string.
-   * ldgeneric.c: Remove magic assignment of indeces in the dynsym
+   * ldgeneric.c: Remove magic assignment of indices in the dynsym
section.  Start implementation of --hash-style.
* i386_ld.c: Likewise.
* ld.c: Recognize --hash-style.
diff --git a/src/ar.c b/src/ar.c
index 7d33d814..1a8e0d6e 100644
--- a/src/ar.c
+++ b/src/ar.c
@@ -848,7 +848,7 @@ write_member (struct armem *memb, off_t *startp, off_t 
*lenp, Elf *elf,
  off_t end_off, int newfd)
 {
   struct ar_hdr arhdr;
-  /* The ar_name is not actually zero teminated, but we need that for
+  /* The ar_name is not actually zero terminated, but we need that for
  snprintf.  Also if the name is too long, then the string starts
  with '/' plus an index off number (decimal).  */
   char tmpbuf[sizeof (arhdr.ar_name) + 2];
@@ -1458,7 +1458,7 @@ do_oper_insert (int oper, const char *arfname, char 
**argv, int argc,
 
  /* Create the header.  */
  struct ar_hdr arhdr;
- /* The ar_name is not actually zero teminated, but we
+ /* The ar_name is not actually zero terminated, but we
 need that for snprintf.  Also if the name is too
 long, then the string starts with '/' plus an index
 off number (decimal).  */
diff --git a/src/elfclassify.c b/src/elfclassify.c
index 624bb861..ae626bb1 100644
--- a/src/elfclassify.c
+++ b/src/elfclassify.c
@@ -51,7 +51,7 @@ static int file_fd = -1;
 /* Set by issue or elf_issue.  */
 static bool issue_found;
 
-/* Non-fatal issue occured while processing the current_path.  */
+/* Non-fatal issue occurred while processing the current_path.  */
 static void
 issue (int e, const char *msg)
 {
@@ -65,7 +65,7 @@ issue (int e, const char *msg)
   issue_found = true;
 }
 
-/* Non-fatal issue occured while processing the current ELF.  */
+/* Non-fatal issue occurred while processing the current ELF.  */
 static void
 elf_issue (const char *msg)
 {
@@ -464,7 +464,7 @@ is_loadable (void)
 }
 
 /* Return true if the file is an ELF file which has a symbol table or
-   .debug_* sections (and thus can be stripped futher).  */
+   .debug_* sections (and thus can be stripped further).  */
 static bool
 is_unstripped (void)
 {
diff --git a/src/elfcompress.c b/src/elfcompress.c
index 6ba6af41..1b5b1e36 100644
--- a/src/elfcompress.c
+++ b/src/elfcompress.c
@@ -345,7 +345,7 @@ process_file (const char *fname)
   return cleanup (-1);
 }
 
-  /* We dont' handle ar files (or anything else), we probably should.  */
+  /* We don't handle ar files (or anything else), we probably should.  */
   Elf_Kind kind = elf_kind (elf);
   if (kind != ELF_K_ELF)
 {
diff --git a/src/elflint.c b/src/elflint.c
index ef3e3732..6e219ced 100644
--- a/src/elflint.c
+++ b/src/elflint.c
@@ -107,7 +107,7 @@ static unsigned int error_count;
 /* True if we should perform very strict testing.  */
 static bool be_strict;
 
-/* True if no message is to be printed if the run is succesful.  */
+/* True

[PATCH 11/12] tests: fix spelling typos in error diagnostics and comments

2020-12-12 Thread Dmitry V. Levin
Cannnot -> Cannot
decriptors -> descriptors
experssions -> expressions
explit -> explicit
falg -> flag
irrelevent -> irrelevant
mininum -> minimum
outselves -> ourselves
proces -> process
versio -> version

Signed-off-by: Dmitry V. Levin 
---
 tests/ChangeLog   | 11 +++
 tests/dwarf-die-addr-die.c|  2 +-
 tests/dwfl-bug-fd-leak.c  |  2 +-
 tests/elfstrmerge.c   |  4 ++--
 tests/run-lfs-symbols.sh  |  2 +-
 tests/run-readelf-line.sh |  2 +-
 tests/run-stack-demangled-test.sh |  2 +-
 tests/sectiondump.c   |  6 +++---
 tests/varlocs.c   |  2 +-
 9 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/tests/ChangeLog b/tests/ChangeLog
index a3813ddc..2c83f690 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,14 @@
+2020-12-12  Dmitry V. Levin  
+
+   * dwarf-die-addr-die.c (main): Fix spelling typo in error diagnostics.
+   * run-lfs-symbols.sh: Likewise.
+   * elfstrmerge.c (main): Fix spelling typos in comments.
+   * dwfl-bug-fd-leak.c: Likewise.
+   * run-readelf-line.sh: Likewise.
+   * run-stack-demangled-test.sh: Likewise.
+   * sectiondump.c (main): Likewise.
+   * varlocs.c (handle_die): Likewise.
+
 2020-12-11  Dmitry V. Levin  
 
* configure.ac: Remove.
diff --git a/tests/dwarf-die-addr-die.c b/tests/dwarf-die-addr-die.c
index 7899988f..24bfbeb7 100644
--- a/tests/dwarf-die-addr-die.c
+++ b/tests/dwarf-die-addr-die.c
@@ -164,7 +164,7 @@ main (int argc, char *argv[])
   int fd = open (name, O_RDONLY);
   if (fd < 0)
 {
-  printf ("Cannnot open '%s': %s\n", name, strerror (errno));
+  printf ("Cannot open '%s': %s\n", name, strerror (errno));
   return -1;
 }
 
diff --git a/tests/dwfl-bug-fd-leak.c b/tests/dwfl-bug-fd-leak.c
index b0913361..7554d6ec 100644
--- a/tests/dwfl-bug-fd-leak.c
+++ b/tests/dwfl-bug-fd-leak.c
@@ -1,4 +1,4 @@
-/* Test program for libdwfl file decriptors leakage.
+/* Test program for libdwfl file descriptors leakage.
Copyright (C) 2007, 2008 Red Hat, Inc.
This file is part of elfutils.
 
diff --git a/tests/elfstrmerge.c b/tests/elfstrmerge.c
index ba0d68df..abbdf3fd 100644
--- a/tests/elfstrmerge.c
+++ b/tests/elfstrmerge.c
@@ -332,7 +332,7 @@ main (int argc, char **argv)
 if (unlikely (secndx == 0 || secndx == shdrstrndx || secndx >= shdrnum))
   {
/* Don't use fail... too specialized messages.  Call release
-  outselves and then error.  Ignores midx if widx is
+  ourselves and then error.  Ignores midx if widx is
   zero.  */
release ();
if (widx == 0)
@@ -543,7 +543,7 @@ main (int argc, char **argv)
  {
new_data_buf (newdata);
/* A section group contains Elf32_Words. The first
-  word is a falg value, the rest of the words are
+  word is a flag value, the rest of the words are
   indexes of the sections belonging to the group.  */
Elf32_Word *group = (Elf32_Word *) data->d_buf;
Elf32_Word *newgroup = (Elf32_Word *) newdata->d_buf;
diff --git a/tests/run-lfs-symbols.sh b/tests/run-lfs-symbols.sh
index 7398e7f4..762a5d96 100755
--- a/tests/run-lfs-symbols.sh
+++ b/tests/run-lfs-symbols.sh
@@ -18,7 +18,7 @@
 . $srcdir/test-subr.sh
 
 if ! grep -q -F '#define _FILE_OFFSET_BITS' ${abs_top_builddir}/config.h; then
-  echo "LFS testing is irrelevent on this system"
+  echo "LFS testing is irrelevant on this system"
   exit 77
 fi
 
diff --git a/tests/run-readelf-line.sh b/tests/run-readelf-line.sh
index a95e6aa9..eef50e9d 100755
--- a/tests/run-readelf-line.sh
+++ b/tests/run-readelf-line.sh
@@ -262,7 +262,7 @@ DWARF section [30] '.debug_line' at offset 0x15f6:
 
 EOF
 
-# A .debug_line table with mininum instruction length > 1.
+# A .debug_line table with minimum instruction length > 1.
 #
 # = hello.c
 # #include 
diff --git a/tests/run-stack-demangled-test.sh 
b/tests/run-stack-demangled-test.sh
index c26918f9..ac5bc617 100755
--- a/tests/run-stack-demangled-test.sh
+++ b/tests/run-stack-demangled-test.sh
@@ -24,7 +24,7 @@ fi
 
 # See run-stack-d-test.sh and run-stack-i-test.sh
 # Same tests, now with demangler support, no -r, and without -d.
-# Only change in output is an explit fu(int) instead of _Z2fui.
+# Only change in output is an explicit fu(int) instead of _Z2fui.
 
 testfiles testfiledwarfinlines testfiledwarfinlines.core
 
diff --git a/tests/sectiondump.c b/tests/sectiondump.c
index f33484f9..661e6440 100644
--- a/tests/sectiondump.c
+++ b/tests/sectiondump.c
@@ -49,7 +49,7 @@ main (int argc, char *argv[])
   if (fd == -1)
 error (EXIT_FAILURE, errno, "cannot open input file `%s'", argv[1]);
 
-  /* Set the library versio we expect.  */
+  /* Set the library version we expect.  */
   elf_version (EV_CURRENT);
 
   /* Create the ELF descriptor.  */
@@ -58,7 +58,7 @@ main (int argc, char *argv[])
 error (

[PATCH 12/12] Fix spelling typos in NEWS, NOTES, TODO, and in comments of configure.ac

2020-12-12 Thread Dmitry V. Levin
accidently -> accidentally
approriate -> appropriate
depencies -> dependencies
endianess -> endianness
funtions -> functions
indeces -> indices
indentified -> identified
ist -> is
mutliple -> multiple
nessesary -> necessary
optimze -> optimize
severly -> severely
suport -> support
tranformation -> transformation

Signed-off-by: Dmitry V. Levin 
---
 ChangeLog|  7 +++
 NEWS | 18 +-
 NOTES|  4 ++--
 TODO |  2 +-
 configure.ac |  6 +++---
 libebl/ChangeLog |  2 +-
 6 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 92efa22f..2b2f7437 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-12-12  Dmitry V. Levin  
+
+   * configure.ac: Fix spelling typos in comments.
+   * NEWS: Fix spelling typos.
+   * NOTES: Likewise.
+   * TODO: Likewise.
+
 2020-12-11  Dmitry V. Levin  
 
* configure.ac (AM_CONDITIONAL): Remove HAVE_LIBASM and STANDALONE.
diff --git a/NEWS b/NEWS
index 4e94f1c1..caf20dd4 100644
--- a/NEWS
+++ b/NEWS
@@ -128,7 +128,7 @@ Fixes CVE-2019-7146, CVE-2019-7148, CVE-2019-7149, 
CVE-2019-7150,
 
 Version 0.175
 
-readelf: Handle mutliple .debug_macro sections.
+readelf: Handle multiple .debug_macro sections.
  Recognize and parse GNU Property notes, NT_VERSION notes
  and GNU Build Attribute ELF Notes.
 
@@ -629,7 +629,7 @@ Version 0.140:
 
 libelf: Fix regression in creation of section header
 
-libdwfl: Less strict behavior if DWARF reader ist just used to display data
+libdwfl: Less strict behavior if DWARF reader is just used to display data
 
 Version 0.139:
 
@@ -939,7 +939,7 @@ strip: support Linux kernel modules
 Version 0.106:
 
 libdw: Updated dwarf.h from DWARF3 spec
-libdw: add new funtions dwarf_func_entrypc, dwarf_func_file, dwarf_func_line,
+libdw: add new functions dwarf_func_entrypc, dwarf_func_file, dwarf_func_line,
 dwarf_func_col, dwarf_getsrc_file
 
 Version 0.105:
@@ -1049,7 +1049,7 @@ libelf: change to GPL from OSL1 for now.
 Version 0.90:
 
 libebl: Recognize a few more section types and dynamic tags and return
-approriate strings.
+appropriate strings.
 
 Version 0.89:
 
@@ -1151,11 +1151,11 @@ Version 0.73:
 
 Version 0.72:
 
-libelf: and yet more fun with endian tranformation at output time.
+libelf: and yet more fun with endian transformation at output time.
 
 Version 0.71:
 
-libelf: more fun with endian tranformation at output time.  Add test for it.
+libelf: more fun with endian transformation at output time.  Add test for it.
 
 Version 0.70:
 
@@ -1166,7 +1166,7 @@ libelf: add unlikely in some more places.
 
 Version 0.69:
 
-libelf: fix output routines to handle case where section indeces and
+libelf: fix output routines to handle case where section indices and
 ordre in the output file don't match correctly.  Patch by Jakub.
 
 elflint: fix test of note section content for 64-bit platforms and files
@@ -1341,7 +1341,7 @@ General: fix a few problem gcc 3.1 had with the code.
 
 libelf: implement {gelf,elf32,elf64}_checksum
 
-libelf: optimze DSO: fewer relocations, fewer PLTs
+libelf: optimize DSO: fewer relocations, fewer PLTs
 
 add msg_tst test
 
@@ -1586,7 +1586,7 @@ Version 0.16:
 
 more work on assigning input sections to output sections.
 
-Add gelf_xlatetof and gelf_xlatetom which were accidently left out.
+Add gelf_xlatetof and gelf_xlatetom which were accidentally left out.
 
 Fix memory handling of section headers.
 
diff --git a/NOTES b/NOTES
index 2a5c23bf..deae6435 100644
--- a/NOTES
+++ b/NOTES
@@ -55,7 +55,7 @@ Some notes:
 
 
 - the old linker supported extern "C++", extern "java" in version scripts.
-  I believe this implementation is severly broken and needs a redesign
+  I believe this implementation is severely broken and needs a redesign
   (how do wildcards work with these languages*?).  Therefore it is left
   out for now.
 
@@ -91,5 +91,5 @@ Some notes:
   Sections created in output files follow the naming of special section
   from the gABI.
 
-  In no place is a section solely indentified by its name.  Internal
+  In no place is a section solely identified by its name.  Internal
   references always use the section index.
diff --git a/TODO b/TODO
index ad10a5ee..5ed5e215 100644
--- a/TODO
+++ b/TODO
@@ -135,7 +135,7 @@ Time-stamp: <2009-02-05 22:08:01 drepper>
 
check whether any relocation is for a merge-able section
 
-   check TLS relocation depencies
+   check TLS relocation dependencies
 
Check content of .eh_frame_hdr, .eh_frame, .gcc_except_table
 
diff --git a/configure.ac b/configure.ac
index ed11d249..9e29f169 100644
--- a/configure.ac
+++ b/configure.ac
@@ -240,7 +240,7 @@ LDFLAGS="$save_LDFLAGS"])
 AS_IF([test "x$ac_cv_tls" != xyes],
   AC_MSG_ERROR([__thread support required]))
 
-dnl Before 4.9 gcc doesn't ship stdatomic.h, but the nessesary atomics are
+dnl Before 4.9 gcc doesn't ship stdatomic.h, but the necessary atomics are
 dnl available by (at least) 4

Buildbot failure in Wildebeest Builder on whole buildset

2020-12-12 Thread buildbot
The Buildbot has detected a failed build on builder whole buildset while 
building elfutils.
Full details are available at:
https://builder.wildebeest.org/buildbot/#builders/11/builds/611

Buildbot URL: https://builder.wildebeest.org/buildbot/

Worker for this Build: fedora-ppc64le

Build Reason: 
Blamelist: Dmitry V. Levin 

BUILD FAILED: failed test (failure)

Sincerely,
 -The Buildbot



Re: [PATCH 00/12] Fix spelling typos in comments, tests, and text files

2020-12-12 Thread Mark Wielaard
Hi Dmitry,

On Sat, 2020-12-12 at 19:49 +0300, Dmitry V. Levin wrote:
> This is the least significant part of all spelling fixes, most users
> won't notice any difference at all, but it still makes sense to use
> correct spelling.
> 
> Dmitry V. Levin (12):
>   debuginfod: fix spelling typos in error diagnostics and comments
>   backends: fix spelling typos in comments
>   config: fix spelling typos in comments and %changelog
>   libasm: fix spelling typos in comments
>   libcpu: fix spelling typos in comments
>   libdw: fix spelling typos in comments and ChangeLog
>   libdwelf: fix spelling typos in comments
>   libdwfl: fix spelling typos in comments and ChangeLog
>   libelf: fix spelling typos in comments
>   src: fix spelling typos in comments and ChangeLog
>   tests: fix spelling typos in error diagnostics and comments
>   Fix spelling typos in NEWS, NOTES, TODO, and in comments of
> configure.ac

Wow thanks. All changes look correct. I wouldn't have bothered with the
ChangeLog entry updates. But given you already did the work lets just
include them. All 12 patches pushed.

I saw you also fixed the spelling issues in elf.h. I'll sync it from
glibc again and add support for SHF_GNU_RETAIN.

Cheers,

Mark


Re: Buildbot failure in Wildebeest Builder on whole buildset

2020-12-12 Thread Mark Wielaard
On Sat, Dec 12, 2020 at 05:11:48PM +, build...@builder.wildebeest.org wrote:
> The Buildbot has detected a failed build on builder whole buildset while 
> building elfutils.
> Full details are available at:
> https://builder.wildebeest.org/buildbot/#builders/11/builds/611
> 
> Buildbot URL: https://builder.wildebeest.org/buildbot/
> 
> Worker for this Build: fedora-ppc64le
> 
> Build Reason: 
> Blamelist: Dmitry V. Levin 
> 
> BUILD FAILED: failed test (failure)

That is odd. The patch was just a spelling fix. It only failed on
ppc64le. I cannot replicate it. And there have been 12 successful
builds after it.

Lets assume it was a random failure and nothing serious.

Cheers,

Mark


[PATCH 1/2] libelf: Sync elf.h from glibc.

2020-12-12 Thread Mark Wielaard
Adds SHF_GNU_RETAIN.

Signed-off-by: Mark Wielaard 
---
 libelf/ChangeLog |  4 
 libelf/elf.h | 13 +++--
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/libelf/ChangeLog b/libelf/ChangeLog
index 41727fbd..2d8bbe5d 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -1,3 +1,7 @@
+2020-12-12  Mark Wielaard  
+
+   * elf.h: Update from glibc.
+
 2020-12-12  Dmitry V. Levin  
 
* common.h: Fix spelling typo in comment.
diff --git a/libelf/elf.h b/libelf/elf.h
index 6439c1a4..8e3e618f 100644
--- a/libelf/elf.h
+++ b/libelf/elf.h
@@ -318,7 +318,7 @@ typedef struct
/* reserved 184 */
 #define EM_AVR32   185 /* Amtel 32-bit microprocessor */
 #define EM_STM8186 /* STMicroelectronics STM8 */
-#define EM_TILE64  187 /* Tileta TILE64 */
+#define EM_TILE64  187 /* Tilera TILE64 */
 #define EM_TILEPRO 188 /* Tilera TILEPro */
 #define EM_MICROBLAZE  189 /* Xilinx MicroBlaze */
 #define EM_CUDA190 /* NVIDIA CUDA */
@@ -441,7 +441,7 @@ typedef struct
 #define SHT_FINI_ARRAY   15/* Array of destructors */
 #define SHT_PREINIT_ARRAY 16   /* Array of pre-constructors */
 #define SHT_GROUP17/* Section group */
-#define SHT_SYMTAB_SHNDX  18   /* Extended section indeces */
+#define SHT_SYMTAB_SHNDX  18   /* Extended section indices */
 #defineSHT_NUM   19/* Number of defined types.  */
 #define SHT_LOOS 0x6000/* Start OS-specific.  */
 #define SHT_GNU_ATTRIBUTES 0x6ff5  /* Object attributes.  */
@@ -478,6 +478,7 @@ typedef struct
 #define SHF_COMPRESSED  (1 << 11)  /* Section with compressed data. */
 #define SHF_MASKOS  0x0ff0 /* OS-specific.  */
 #define SHF_MASKPROC0xf000 /* Processor-specific */
+#define SHF_GNU_RETAIN  (1 << 21)  /* Not to be GCed by linker.  */
 #define SHF_ORDERED (1 << 30)  /* Special ordering requirement
   (Solaris).  */
 #define SHF_EXCLUDE (1U << 31) /* Section is excluded unless
@@ -1046,7 +1047,7 @@ typedef struct
 #defineVER_NDX_LORESERVE   0xff00  /* Beginning of reserved 
entries.  */
 #defineVER_NDX_ELIMINATE   0xff01  /* Symbol is to be eliminated.  
*/
 
-/* Auxialiary version information.  */
+/* Auxiliary version information.  */
 
 typedef struct
 {
@@ -2139,9 +2140,9 @@ enum
 #define EFA_PARISC_1_1 0x0210 /* PA-RISC 1.1 big-endian.  */
 #define EFA_PARISC_2_0 0x0214 /* PA-RISC 2.0 big-endian.  */
 
-/* Additional section indeces.  */
+/* Additional section indices.  */
 
-#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tenatively declared
+#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tentatively declared
  symbols in ANSI C.  */
 #define SHN_PARISC_HUGE_COMMON 0xff01 /* Common blocks in huge model.  */
 
@@ -3970,7 +3971,7 @@ enum
 #define R_METAG_RELBRANCH  4
 #define R_METAG_GETSETOFF  5
 
-/* Backward compatability */
+/* Backward compatibility */
 #define R_METAG_REG32OP1   6
 #define R_METAG_REG32OP2   7
 #define R_METAG_REG32OP3   8
-- 
2.20.1



[PATCH 2/2] Handle SHF_GNU_RETAIN in eu-readelf and eu-elflint.

2020-12-12 Thread Mark Wielaard
readelf -S now shows 'R' when SHF_GNU_RETAIN is set.
elflint accepts SHF_GNU_RETAIN when set on section in --gnu mode.

Signed-off-by: Mark Wielaard 
---
 src/ChangeLog   |   5 
 src/elflint.c   |   3 +++
 src/readelf.c   |   2 ++
 tests/ChangeLog |   7 ++
 tests/Makefile.am   |   2 ++
 tests/run-retain.sh |  44 
 tests/testfile-retain.o.bz2 | Bin 0 -> 261 bytes
 7 files changed, 63 insertions(+)
 create mode 100755 tests/run-retain.sh
 create mode 100644 tests/testfile-retain.o.bz2

diff --git a/src/ChangeLog b/src/ChangeLog
index f5a02a36..e6ff981f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2020-12-12  Mark Wielaard  
+
+   * elflint.c (check_sections): Handle SHF_GNU_RETAIN.
+   * readelf.c (print_shdr): Likewise.
+
 2020-12-12  Dmitry V. Levin  
 
* ar.c (write_member, do_oper_insert): Fix spelling typo in comment.
diff --git a/src/elflint.c b/src/elflint.c
index 6e219ced..6ca1879e 100644
--- a/src/elflint.c
+++ b/src/elflint.c
@@ -3935,6 +3935,9 @@ section [%2zu] '%s': size not multiple of entry size\n"),
   cnt, section_name (ebl, cnt), sh_flags & SHF_MASKPROC);
  sh_flags &= ~(GElf_Xword) SHF_MASKPROC;
}
+ if (sh_flags & SHF_MASKOS)
+   if (gnuld)
+ sh_flags &= ~(GElf_Xword) SHF_GNU_RETAIN;
  if (sh_flags != 0)
ERROR (gettext ("section [%2zu] '%s' contains unknown flag(s)"
" %#" PRIx64 "\n"),
diff --git a/src/readelf.c b/src/readelf.c
index f51b41d7..dbb0c73f 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -1298,6 +1298,8 @@ There are %zd section headers, starting at offset %#" 
PRIx64 ":\n\
*cp++ = 'O';
   if (shdr->sh_flags & SHF_EXCLUDE)
*cp++ = 'E';
+  if (shdr->sh_flags & SHF_GNU_RETAIN)
+   *cp++ = 'R';
   *cp = '\0';
 
   const char *sname;
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 2c83f690..cb6d5f8b 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,10 @@
+2020-12-12  Mark Wielaard  
+
+   * testfile-retain.o.bz2: New test file.
+   * run-retain.sh: New test.
+   * Makefile.am (TESTS): Add run-retain.sh.
+   (EXTRA_DIST): Add run-retain.sh and testfile-retain.o.bz2
+
 2020-12-12  Dmitry V. Levin  
 
* dwarf-die-addr-die.c (main): Fix spelling typo in error diagnostics.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3cca2251..502becff 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -125,6 +125,7 @@ TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile 
test-nlist \
run-readelf-aranges.sh run-readelf-line.sh run-readelf-z.sh \
run-readelf-frames.sh \
run-readelf-n.sh \
+   run-retain.sh \
run-native-test.sh run-bug1-test.sh \
run-debuglink.sh run-debugaltlink.sh run-buildid.sh \
dwfl-bug-addr-overflow run-addrname-test.sh \
@@ -318,6 +319,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh run-ar.sh \
 testfile_gnu_props.32be.o.bz2 \
 testfile_gnu_props.64be.o.bz2 \
 testfile-gnu-property-note-aarch64.bz2 \
+run-retain.sh testfile-retain.o.bz2 \
 run-allfcts-multi.sh \
 test-offset-loop.bz2 test-offset-loop.alt.bz2 \
 run-prelink-addr-test.sh \
diff --git a/tests/run-retain.sh b/tests/run-retain.sh
new file mode 100755
index ..c5376de4
--- /dev/null
+++ b/tests/run-retain.sh
@@ -0,0 +1,44 @@
+# Copyright (C) 2020 Red Hat, Inc.
+# This file is part of elfutils.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# elfutils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+
+. $srcdir/test-subr.sh
+
+# - retian.s
+#   .section.data.retain,"R" 
+#   .word   1
+#
+# as -o testfile-retain.o retain.s
+
+testfiles testfile-retain.o
+
+testrun_compare ${abs_top_builddir}/src/readelf -S testfile-retain.o << EOF
+There are 9 section headers, starting at offset 0x158:
+
+Section Headers:
+[Nr] Name Type Addr Off  Size ES 
Flags Lk Inf Al
+[ 0]  NULL     0   
 0   0  0
+[ 1] .textPROGBITS  0040   0 
AX 0   0  1
+[ 2] .dataPROGBITS  0040   0 
WA 0   0  1
+[ 3] .