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