Blame SOURCES/elfutils-0.176-xlate-note.patch

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