ddbc0a
commit 28b5f578ae772bb2404c3847e4e22ad1c407af54
ddbc0a
Author: Mark Wielaard <mark@klomp.org>
ddbc0a
Date:   Tue Apr 30 13:00:17 2019 +0200
ddbc0a
ddbc0a
    libelf: If xlate can only convert the ELF note header, just do that.
ddbc0a
    
ddbc0a
    When we started parsing new style ELF_T_NHDR8 notes we added extra
ddbc0a
    checks on alignment and padding. When those failed we would stop
ddbc0a
    converting and just return the rest of the ELF Note unconverted.
ddbc0a
    In the case were we just had enough data for just the ELF Note header
ddbc0a
    and the destionation and source weren't the same we would then
ddbc0a
    accidentially throw away the Note header conversion we just did.
ddbc0a
    
ddbc0a
    Fix that by indicating we did correctly convert just the header.
ddbc0a
    
ddbc0a
    Adds testcase that compares parsing ELF notes with gelf_getnote
ddbc0a
    and parsing the raw data by hand using elf32_xlatetom using just
ddbc0a
    the Note header and ignoring the (raw) note data.
ddbc0a
    
ddbc0a
    Signed-off-by: Mark Wielaard <mark@klomp.org>
ddbc0a
ddbc0a
diff --git a/libelf/note_xlate.h b/libelf/note_xlate.h
ddbc0a
index bc9950f..7e2784b 100644
ddbc0a
--- a/libelf/note_xlate.h
ddbc0a
+++ b/libelf/note_xlate.h
ddbc0a
@@ -47,13 +47,25 @@ elf_cvt_note (void *dest, const void *src, size_t len, int encode,
ddbc0a
       note_len += n->n_namesz;
ddbc0a
       note_len = nhdr8 ? NOTE_ALIGN8 (note_len) : NOTE_ALIGN4 (note_len);
ddbc0a
       if (note_len > len || note_len < sizeof *n)
ddbc0a
-	break;
ddbc0a
+	{
ddbc0a
+	  /* Header was translated, nothing else.  */
ddbc0a
+	  len -= sizeof *n;
ddbc0a
+	  src += sizeof *n;
ddbc0a
+	  dest += sizeof *n;
ddbc0a
+	  break;
ddbc0a
+	}
ddbc0a
 
ddbc0a
       /* data as a whole needs to be aligned.  */
ddbc0a
       note_len += n->n_descsz;
ddbc0a
       note_len = nhdr8 ? NOTE_ALIGN8 (note_len) : NOTE_ALIGN4 (note_len);
ddbc0a
       if (note_len > len || note_len < sizeof *n)
ddbc0a
-	break;
ddbc0a
+	{
ddbc0a
+	  /* Header was translated, nothing else.  */
ddbc0a
+	  len -= sizeof *n;
ddbc0a
+	  src += sizeof *n;
ddbc0a
+	  dest += sizeof *n;
ddbc0a
+	  break;
ddbc0a
+	}
ddbc0a
 
ddbc0a
       /* Copy or skip the note data.  */
ddbc0a
       size_t note_data_len = note_len - sizeof *n;
ddbc0a
diff --git a/tests/Makefile.am b/tests/Makefile.am
ddbc0a
index 1b0c7d3..498c1db 100644
ddbc0a
--- a/tests/Makefile.am
ddbc0a
+++ b/tests/Makefile.am
ddbc0a
@@ -60,7 +60,7 @@ check_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \
ddbc0a
 		  fillfile dwarf_default_lower_bound dwarf-die-addr-die \
ddbc0a
 		  get-units-invalid get-units-split attr-integrate-skel \
ddbc0a
 		  all-dwarf-ranges unit-info next_cfi \
ddbc0a
-		  elfcopy addsections
ddbc0a
+		  elfcopy addsections xlate_notes
ddbc0a
 
ddbc0a
 asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \
ddbc0a
 	    asm-tst6 asm-tst7 asm-tst8 asm-tst9
ddbc0a
@@ -159,7 +159,7 @@ TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile test-nlist \
ddbc0a
 	run-next-cfi.sh run-next-cfi-self.sh \
ddbc0a
 	run-copyadd-sections.sh run-copymany-sections.sh \
ddbc0a
 	run-typeiter-many.sh run-strip-test-many.sh \
ddbc0a
-	run-strip-version.sh
ddbc0a
+	run-strip-version.sh run-xlate-note.sh
ddbc0a
 
ddbc0a
 if !BIARCH
ddbc0a
 export ELFUTILS_DISABLE_BIARCH = 1
ddbc0a
@@ -423,7 +423,8 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh run-ar.sh \
ddbc0a
 	     testfile-debug-rel-ppc64-g.o.bz2 \
ddbc0a
 	     testfile-debug-rel-ppc64-z.o.bz2 \
ddbc0a
 	     testfile-debug-rel-ppc64.o.bz2 \
ddbc0a
-	     run-strip-version.sh testfile-version.bz2
ddbc0a
+	     run-strip-version.sh testfile-version.bz2 \
ddbc0a
+	     run-xlate-note.sh
ddbc0a
 
ddbc0a
 if USE_VALGRIND
ddbc0a
 valgrind_cmd='valgrind -q --leak-check=full --error-exitcode=1'
ddbc0a
@@ -593,6 +594,7 @@ unit_info_LDADD = $(libdw)
ddbc0a
 next_cfi_LDADD = $(libelf) $(libdw)
ddbc0a
 elfcopy_LDADD = $(libelf)
ddbc0a
 addsections_LDADD = $(libelf)
ddbc0a
+xlate_notes_LDADD = $(libelf)
ddbc0a
 
ddbc0a
 # We want to test the libelf header against the system elf.h header.
ddbc0a
 # Don't include any -I CPPFLAGS. Except when we install our own elf.h.
ddbc0a
diff --git a/tests/run-xlate-note.sh b/tests/run-xlate-note.sh
ddbc0a
new file mode 100755
ddbc0a
index 0000000..a907418
ddbc0a
--- /dev/null
ddbc0a
+++ b/tests/run-xlate-note.sh
ddbc0a
@@ -0,0 +1,93 @@
ddbc0a
+# Copyright (C) 2019 Red Hat, Inc.
ddbc0a
+# This file is part of elfutils.
ddbc0a
+#
ddbc0a
+# This file is free software; you can redistribute it and/or modify
ddbc0a
+# it under the terms of the GNU General Public License as published by
ddbc0a
+# the Free Software Foundation; either version 3 of the License, or
ddbc0a
+# (at your option) any later version.
ddbc0a
+#
ddbc0a
+# elfutils is distributed in the hope that it will be useful, but
ddbc0a
+# WITHOUT ANY WARRANTY; without even the implied warranty of
ddbc0a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ddbc0a
+# GNU General Public License for more details.
ddbc0a
+#
ddbc0a
+# You should have received a copy of the GNU General Public License
ddbc0a
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
ddbc0a
+
ddbc0a
+. $srcdir/test-subr.sh
ddbc0a
+
ddbc0a
+testfiles testfileppc32
ddbc0a
+testrun_compare ${abs_top_builddir}/tests/xlate_notes testfileppc32 << EOF
ddbc0a
+Notes in section 2:
ddbc0a
+type: 1,1, namesz: 4,4, descsz: 16,16
ddbc0a
+Notes in section 3:
ddbc0a
+type: 3,3, namesz: 4,4, descsz: 20,20
ddbc0a
+EOF
ddbc0a
+
ddbc0a
+testfiles testfileppc64
ddbc0a
+testrun_compare ${abs_top_builddir}/tests/xlate_notes testfileppc64 << EOF
ddbc0a
+Notes in section 2:
ddbc0a
+type: 1,1, namesz: 4,4, descsz: 16,16
ddbc0a
+Notes in section 3:
ddbc0a
+type: 3,3, namesz: 4,4, descsz: 20,20
ddbc0a
+EOF
ddbc0a
+
ddbc0a
+testfiles testfiles390
ddbc0a
+testrun_compare ${abs_top_builddir}/tests/xlate_notes testfiles390 << EOF
ddbc0a
+Notes in section 2:
ddbc0a
+type: 1,1, namesz: 4,4, descsz: 16,16
ddbc0a
+Notes in section 3:
ddbc0a
+type: 3,3, namesz: 4,4, descsz: 20,20
ddbc0a
+EOF
ddbc0a
+
ddbc0a
+testfiles testfiles390x
ddbc0a
+testrun_compare ${abs_top_builddir}/tests/xlate_notes testfiles390x << EOF
ddbc0a
+Notes in section 2:
ddbc0a
+type: 1,1, namesz: 4,4, descsz: 16,16
ddbc0a
+Notes in section 3:
ddbc0a
+type: 3,3, namesz: 4,4, descsz: 20,20
ddbc0a
+EOF
ddbc0a
+
ddbc0a
+testfiles testfileaarch64
ddbc0a
+testrun_compare ${abs_top_builddir}/tests/xlate_notes testfileaarch64 << EOF
ddbc0a
+Notes in section 2:
ddbc0a
+type: 1,1, namesz: 4,4, descsz: 16,16
ddbc0a
+Notes in section 3:
ddbc0a
+type: 3,3, namesz: 4,4, descsz: 20,20
ddbc0a
+EOF
ddbc0a
+
ddbc0a
+testfiles testfilearm
ddbc0a
+testrun_compare ${abs_top_builddir}/tests/xlate_notes testfilearm << EOF
ddbc0a
+Notes in section 2:
ddbc0a
+type: 1,1, namesz: 4,4, descsz: 16,16
ddbc0a
+Notes in section 3:
ddbc0a
+type: 3,3, namesz: 4,4, descsz: 20,20
ddbc0a
+EOF
ddbc0a
+
ddbc0a
+testfiles testfile_gnu_props.32be.o
ddbc0a
+testrun_compare ${abs_top_builddir}/tests/xlate_notes testfile_gnu_props.32be.o << EOF
ddbc0a
+Notes in section 4:
ddbc0a
+type: 5,5, namesz: 4,4, descsz: 12,12
ddbc0a
+type: 5,5, namesz: 4,4, descsz: 8,8
ddbc0a
+EOF
ddbc0a
+
ddbc0a
+testfiles testfile_gnu_props.32le.o
ddbc0a
+testrun_compare ${abs_top_builddir}/tests/xlate_notes testfile_gnu_props.32le.o << EOF
ddbc0a
+Notes in section 4:
ddbc0a
+type: 5,5, namesz: 4,4, descsz: 12,12
ddbc0a
+type: 5,5, namesz: 4,4, descsz: 8,8
ddbc0a
+EOF
ddbc0a
+
ddbc0a
+testfiles testfile_gnu_props.64be.o
ddbc0a
+testrun_compare ${abs_top_builddir}/tests/xlate_notes testfile_gnu_props.64be.o << EOF
ddbc0a
+Notes in section 4:
ddbc0a
+type: 5,5, namesz: 4,4, descsz: 16,16
ddbc0a
+type: 5,5, namesz: 4,4, descsz: 8,8
ddbc0a
+EOF
ddbc0a
+
ddbc0a
+testfiles testfile_gnu_props.64le.o
ddbc0a
+testrun_compare ${abs_top_builddir}/tests/xlate_notes testfile_gnu_props.64le.o << EOF
ddbc0a
+Notes in section 4:
ddbc0a
+type: 5,5, namesz: 4,4, descsz: 16,16
ddbc0a
+type: 5,5, namesz: 4,4, descsz: 8,8
ddbc0a
+EOF
ddbc0a
diff --git a/tests/xlate_notes.c b/tests/xlate_notes.c
ddbc0a
new file mode 100644
ddbc0a
index 0000000..90a4ae2
ddbc0a
--- /dev/null
ddbc0a
+++ b/tests/xlate_notes.c
ddbc0a
@@ -0,0 +1,157 @@
ddbc0a
+/* Test program for extracting ELF Note headers and getting whole notes.
ddbc0a
+   Copyright (C) 2019 Red Hat, Inc.
ddbc0a
+   This file is part of elfutils.
ddbc0a
+
ddbc0a
+   This file is free software; you can redistribute it and/or modify
ddbc0a
+   it under the terms of the GNU General Public License as published by
ddbc0a
+   the Free Software Foundation; either version 3 of the License, or
ddbc0a
+   (at your option) any later version.
ddbc0a
+
ddbc0a
+   elfutils is distributed in the hope that it will be useful, but
ddbc0a
+   WITHOUT ANY WARRANTY; without even the implied warranty of
ddbc0a
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ddbc0a
+   GNU General Public License for more details.
ddbc0a
+
ddbc0a
+   You should have received a copy of the GNU General Public License
ddbc0a
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
ddbc0a
+
ddbc0a
+#ifdef HAVE_CONFIG_H
ddbc0a
+# include <config.h>
ddbc0a
+#endif
ddbc0a
+
ddbc0a
+#include <errno.h>
ddbc0a
+#include <fcntl.h>
ddbc0a
+#include <inttypes.h>
ddbc0a
+#include <stdio.h>
ddbc0a
+#include <stdlib.h>
ddbc0a
+#include <string.h>
ddbc0a
+#include <unistd.h>
ddbc0a
+
ddbc0a
+#include ELFUTILS_HEADER(elf)
ddbc0a
+#include <gelf.h>
ddbc0a
+
ddbc0a
+int
ddbc0a
+main (int argc, char *argv[])
ddbc0a
+{
ddbc0a
+  if (argc != 2)
ddbc0a
+    {
ddbc0a
+      printf ("No ELF file given as argument\n");
ddbc0a
+      exit (1);
ddbc0a
+    }
ddbc0a
+
ddbc0a
+  const char *fname = argv[1];
ddbc0a
+
ddbc0a
+  // Initialize libelf.
ddbc0a
+  elf_version (EV_CURRENT);
ddbc0a
+
ddbc0a
+  /* Read the ELF from disk now.  */
ddbc0a
+  int fd = open (fname, O_RDONLY);
ddbc0a
+  if (fd == -1)
ddbc0a
+    {
ddbc0a
+      printf ("cannot open '%s': %s\n", fname, strerror (errno));
ddbc0a
+      exit (1);
ddbc0a
+    }
ddbc0a
+
ddbc0a
+  Elf *elf = elf_begin (fd, ELF_C_READ, NULL);
ddbc0a
+  if (elf == NULL)
ddbc0a
+    {
ddbc0a
+      printf ("cannot create ELF descriptor: %s\n", elf_errmsg (-1));
ddbc0a
+      exit (1);
ddbc0a
+    }
ddbc0a
+
ddbc0a
+  GElf_Ehdr ehdr;
ddbc0a
+  if (gelf_getehdr (elf, &ehdr) == NULL)
ddbc0a
+    {
ddbc0a
+      printf ("cannot get Ehdr: %s\n", elf_errmsg (-1));
ddbc0a
+      exit (1);
ddbc0a
+    }
ddbc0a
+
ddbc0a
+  /* Search for all SHT_NOTE sections.  */
ddbc0a
+  Elf_Scn *scn = NULL;
ddbc0a
+  while ((scn = elf_nextscn (elf, scn)) != NULL)
ddbc0a
+    {
ddbc0a
+      /* Get the header.  */
ddbc0a
+      GElf_Shdr shdr;
ddbc0a
+      if (gelf_getshdr (scn, &shdr) == NULL)
ddbc0a
+	{
ddbc0a
+	  printf ("couldn't get shdr: %s\n", elf_errmsg (-1));
ddbc0a
+	  exit (1);
ddbc0a
+	}
ddbc0a
+
ddbc0a
+      if (shdr.sh_type == SHT_NOTE)
ddbc0a
+	{
ddbc0a
+	  printf ("Notes in section %zd:\n", elf_ndxscn (scn));
ddbc0a
+
ddbc0a
+	  Elf_Data *raw = elf_rawdata (scn, NULL);
ddbc0a
+	  if (raw == NULL)
ddbc0a
+	    {
ddbc0a
+	      printf ("couldn't get raw data: %s\n", elf_errmsg (-1));
ddbc0a
+	      exit (1);
ddbc0a
+	    }
ddbc0a
+
ddbc0a
+	  Elf_Data *data = elf_getdata (scn, NULL);
ddbc0a
+	  if (data == NULL)
ddbc0a
+	    {
ddbc0a
+	      printf ("couldn't get data: %s\n", elf_errmsg (-1));
ddbc0a
+	      exit (1);
ddbc0a
+	    }
ddbc0a
+
ddbc0a
+	  size_t off = 0;
ddbc0a
+	  size_t next;
ddbc0a
+	  GElf_Nhdr nhdr;
ddbc0a
+	  size_t n_off;
ddbc0a
+	  size_t d_off;
ddbc0a
+	  while ((next = gelf_getnote (data, off, &nhdr, &n_off, &d_off)) > 0)
ddbc0a
+	    {
ddbc0a
+	      /* Now just get the note header "raw" (don't
ddbc0a
+		 copy/translate the note data). This only handles
ddbc0a
+		 traditional GNU ELF Notes, so we still use the next
ddbc0a
+		 from gelf_getnote (padding is different for new style
ddbc0a
+		 ELF_T_NHDR8 notes).  */
ddbc0a
+	      Elf32_Nhdr nh;
ddbc0a
+	      Elf_Data src =
ddbc0a
+                {
ddbc0a
+                  .d_version = EV_CURRENT, .d_type = ELF_T_NHDR,
ddbc0a
+		  .d_size = sizeof nh
ddbc0a
+                };
ddbc0a
+	      Elf_Data dst = src;
ddbc0a
+	      src.d_buf = raw->d_buf + off;
ddbc0a
+	      dst.d_buf = &nh;
ddbc0a
+
ddbc0a
+	      if (elf32_xlatetom (&dst, &src, ehdr.e_ident[EI_DATA]) == NULL)
ddbc0a
+		{
ddbc0a
+		  printf ("couldn't xlate note: %s\n", elf_errmsg (-1));
ddbc0a
+		  exit (1);
ddbc0a
+		}
ddbc0a
+
ddbc0a
+	      printf ("type: %" PRId32 ",%" PRId32
ddbc0a
+		      ", namesz: %" PRId32 ",%" PRId32
ddbc0a
+		      ", descsz: %" PRId32 ",%" PRId32 "\n",
ddbc0a
+		      nhdr.n_type, nh.n_type,
ddbc0a
+		      nhdr.n_namesz, nh.n_namesz,
ddbc0a
+		      nhdr.n_descsz, nh.n_descsz);
ddbc0a
+
ddbc0a
+	      if (nhdr.n_type != nh.n_type
ddbc0a
+		  || nhdr.n_namesz != nh.n_namesz
ddbc0a
+		  || nhdr.n_descsz != nh.n_descsz)
ddbc0a
+		{
ddbc0a
+		  printf ("Nhdrs not equal!\n");
ddbc0a
+		  exit (1);
ddbc0a
+		}
ddbc0a
+
ddbc0a
+	      off = next;
ddbc0a
+	    }
ddbc0a
+	}
ddbc0a
+
ddbc0a
+    }
ddbc0a
+
ddbc0a
+  if (elf_end (elf) != 0)
ddbc0a
+    {
ddbc0a
+      printf ("failure in elf_end: %s\n", elf_errmsg (-1));
ddbc0a
+      exit (1);
ddbc0a
+    }
ddbc0a
+
ddbc0a
+  close (fd);
ddbc0a
+
ddbc0a
+  return 0;
ddbc0a
+}
ddbc0a
diff -ur elfutils-0.176.orig/tests/Makefile.in elfutils-0.176/tests/Makefile.in
ddbc0a
--- elfutils-0.176.orig/tests/Makefile.in	2019-04-30 22:42:49.534655124 +0200
ddbc0a
+++ elfutils-0.176/tests/Makefile.in	2019-04-30 22:46:30.046656790 +0200
ddbc0a
@@ -131,8 +131,8 @@
ddbc0a
 	get-units-invalid$(EXEEXT) get-units-split$(EXEEXT) \
ddbc0a
 	attr-integrate-skel$(EXEEXT) all-dwarf-ranges$(EXEEXT) \
ddbc0a
 	unit-info$(EXEEXT) next_cfi$(EXEEXT) elfcopy$(EXEEXT) \
ddbc0a
-	addsections$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) \
ddbc0a
-	$(am__EXEEXT_4)
ddbc0a
+	addsections$(EXEEXT) xlate_notes$(EXEEXT) $(am__EXEEXT_1) \
ddbc0a
+	$(am__EXEEXT_2) $(am__EXEEXT_4)
ddbc0a
 @BIARCH_TRUE@am__append_5 = backtrace-child-biarch
ddbc0a
 TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile$(EXEEXT) \
ddbc0a
 	test-nlist$(EXEEXT) update1$(EXEEXT) update2$(EXEEXT) \
ddbc0a
@@ -211,8 +211,8 @@
ddbc0a
 	run-unit-info.sh run-reloc-bpf.sh run-next-cfi.sh \
ddbc0a
 	run-next-cfi-self.sh run-copyadd-sections.sh \
ddbc0a
 	run-copymany-sections.sh run-typeiter-many.sh \
ddbc0a
-	run-strip-test-many.sh run-strip-version.sh $(am__EXEEXT_2) \
ddbc0a
-	$(am__append_8) $(am__EXEEXT_5)
ddbc0a
+	run-strip-test-many.sh run-strip-version.sh run-xlate-note.sh \
ddbc0a
+	$(am__EXEEXT_2) $(am__append_8) $(am__EXEEXT_5)
ddbc0a
 @STANDALONE_FALSE@am__append_6 = msg_tst system-elf-libelf-test
ddbc0a
 @STANDALONE_FALSE@am__append_7 = msg_tst system-elf-libelf-test
ddbc0a
 @LZMA_TRUE@am__append_8 = run-readelf-s.sh run-dwflsyms.sh
ddbc0a
@@ -606,6 +606,9 @@
ddbc0a
 vendorelf_SOURCES = vendorelf.c
ddbc0a
 vendorelf_OBJECTS = vendorelf.$(OBJEXT)
ddbc0a
 vendorelf_DEPENDENCIES = $(am__DEPENDENCIES_2)
ddbc0a
+xlate_notes_SOURCES = xlate_notes.c
ddbc0a
+xlate_notes_OBJECTS = xlate_notes.$(OBJEXT)
ddbc0a
+xlate_notes_DEPENDENCIES = $(am__DEPENDENCIES_2)
ddbc0a
 zstrptr_SOURCES = zstrptr.c
ddbc0a
 zstrptr_OBJECTS = zstrptr.$(OBJEXT)
ddbc0a
 zstrptr_DEPENDENCIES = $(am__DEPENDENCIES_2)
ddbc0a
@@ -683,7 +686,7 @@
ddbc0a
 	./$(DEPDIR)/update2.Po ./$(DEPDIR)/update3.Po \
ddbc0a
 	./$(DEPDIR)/update4.Po ./$(DEPDIR)/varlocs.Po \
ddbc0a
 	./$(DEPDIR)/vdsosyms.Po ./$(DEPDIR)/vendorelf.Po \
ddbc0a
-	./$(DEPDIR)/zstrptr.Po
ddbc0a
+	./$(DEPDIR)/xlate_notes.Po ./$(DEPDIR)/zstrptr.Po
ddbc0a
 am__mv = mv -f
ddbc0a
 AM_V_lt = $(am__v_lt_@AM_V@)
ddbc0a
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
ddbc0a
@@ -726,7 +729,8 @@
ddbc0a
 	showptable.c strptr.c system-elf-libelf-test.c \
ddbc0a
 	test-elf_cntl_gelf_getshdr.c test-flag-nobits.c test-nlist.c \
ddbc0a
 	typeiter.c typeiter2.c unit-info.c update1.c update2.c \
ddbc0a
-	update3.c update4.c varlocs.c vdsosyms.c vendorelf.c zstrptr.c
ddbc0a
+	update3.c update4.c varlocs.c vdsosyms.c vendorelf.c \
ddbc0a
+	xlate_notes.c zstrptr.c
ddbc0a
 DIST_SOURCES = addrcfi.c addrscopes.c addsections.c aggregate_size.c \
ddbc0a
 	all-dwarf-ranges.c alldts.c allfcts.c allregs.c arextract.c \
ddbc0a
 	arls.c arsymtest.c asm-tst1.c asm-tst2.c asm-tst3.c asm-tst4.c \
ddbc0a
@@ -752,7 +756,8 @@
ddbc0a
 	showptable.c strptr.c system-elf-libelf-test.c \
ddbc0a
 	test-elf_cntl_gelf_getshdr.c test-flag-nobits.c test-nlist.c \
ddbc0a
 	typeiter.c typeiter2.c unit-info.c update1.c update2.c \
ddbc0a
-	update3.c update4.c varlocs.c vdsosyms.c vendorelf.c zstrptr.c
ddbc0a
+	update3.c update4.c varlocs.c vdsosyms.c vendorelf.c \
ddbc0a
+	xlate_notes.c zstrptr.c
ddbc0a
 am__can_run_installinfo = \
ddbc0a
   case $$AM_UPDATE_INFO_DIR in \
ddbc0a
     n|no|NO) false;; \
ddbc0a
@@ -1405,7 +1410,8 @@
ddbc0a
 	     testfile-debug-rel-ppc64-g.o.bz2 \
ddbc0a
 	     testfile-debug-rel-ppc64-z.o.bz2 \
ddbc0a
 	     testfile-debug-rel-ppc64.o.bz2 \
ddbc0a
-	     run-strip-version.sh testfile-version.bz2
ddbc0a
+	     run-strip-version.sh testfile-version.bz2 \
ddbc0a
+	     run-xlate-note.sh
ddbc0a
 
ddbc0a
 @USE_VALGRIND_TRUE@valgrind_cmd = 'valgrind -q --leak-check=full --error-exitcode=1'
ddbc0a
 installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir); \
ddbc0a
@@ -1559,6 +1565,7 @@
ddbc0a
 next_cfi_LDADD = $(libelf) $(libdw)
ddbc0a
 elfcopy_LDADD = $(libelf)
ddbc0a
 addsections_LDADD = $(libelf)
ddbc0a
+xlate_notes_LDADD = $(libelf)
ddbc0a
 
ddbc0a
 # We want to test the libelf header against the system elf.h header.
ddbc0a
 # Don't include any -I CPPFLAGS. Except when we install our own elf.h.
ddbc0a
@@ -2011,6 +2018,10 @@
ddbc0a
 	@rm -f vendorelf$(EXEEXT)
ddbc0a
 	$(AM_V_CCLD)$(LINK) $(vendorelf_OBJECTS) $(vendorelf_LDADD) $(LIBS)
ddbc0a
 
ddbc0a
+xlate_notes$(EXEEXT): $(xlate_notes_OBJECTS) $(xlate_notes_DEPENDENCIES) $(EXTRA_xlate_notes_DEPENDENCIES) 
ddbc0a
+	@rm -f xlate_notes$(EXEEXT)
ddbc0a
+	$(AM_V_CCLD)$(LINK) $(xlate_notes_OBJECTS) $(xlate_notes_LDADD) $(LIBS)
ddbc0a
+
ddbc0a
 zstrptr$(EXEEXT): $(zstrptr_OBJECTS) $(zstrptr_DEPENDENCIES) $(EXTRA_zstrptr_DEPENDENCIES) 
ddbc0a
 	@rm -f zstrptr$(EXEEXT)
ddbc0a
 	$(AM_V_CCLD)$(LINK) $(zstrptr_OBJECTS) $(zstrptr_LDADD) $(LIBS)
ddbc0a
@@ -2124,6 +2135,7 @@
ddbc0a
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/varlocs.Po@am__quote@ # am--include-marker
ddbc0a
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vdsosyms.Po@am__quote@ # am--include-marker
ddbc0a
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vendorelf.Po@am__quote@ # am--include-marker
ddbc0a
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xlate_notes.Po@am__quote@ # am--include-marker
ddbc0a
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zstrptr.Po@am__quote@ # am--include-marker
ddbc0a
 
ddbc0a
 $(am__depfiles_remade):
ddbc0a
@@ -3732,6 +3744,13 @@
ddbc0a
 	--log-file $$b.log --trs-file $$b.trs \
ddbc0a
 	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
ddbc0a
 	"$$tst" $(AM_TESTS_FD_REDIRECT)
ddbc0a
+run-xlate-note.sh.log: run-xlate-note.sh
ddbc0a
+	@p='run-xlate-note.sh'; \
ddbc0a
+	b='run-xlate-note.sh'; \
ddbc0a
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
ddbc0a
+	--log-file $$b.log --trs-file $$b.trs \
ddbc0a
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
ddbc0a
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
ddbc0a
 msg_tst.log: msg_tst$(EXEEXT)
ddbc0a
 	@p='msg_tst$(EXEEXT)'; \
ddbc0a
 	b='msg_tst'; \
ddbc0a
@@ -4027,6 +4046,7 @@
ddbc0a
 	-rm -f ./$(DEPDIR)/varlocs.Po
ddbc0a
 	-rm -f ./$(DEPDIR)/vdsosyms.Po
ddbc0a
 	-rm -f ./$(DEPDIR)/vendorelf.Po
ddbc0a
+	-rm -f ./$(DEPDIR)/xlate_notes.Po
ddbc0a
 	-rm -f ./$(DEPDIR)/zstrptr.Po
ddbc0a
 	-rm -f Makefile
ddbc0a
 distclean-am: clean-am distclean-compile distclean-generic \
ddbc0a
@@ -4176,6 +4196,7 @@
ddbc0a
 	-rm -f ./$(DEPDIR)/varlocs.Po
ddbc0a
 	-rm -f ./$(DEPDIR)/vdsosyms.Po
ddbc0a
 	-rm -f ./$(DEPDIR)/vendorelf.Po
ddbc0a
+	-rm -f ./$(DEPDIR)/xlate_notes.Po
ddbc0a
 	-rm -f ./$(DEPDIR)/zstrptr.Po
ddbc0a
 	-rm -f Makefile
ddbc0a
 maintainer-clean-am: distclean-am maintainer-clean-generic