]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libdwfl/
authorRoland McGrath <roland@redhat.com>
Mon, 16 Jul 2007 22:23:37 +0000 (22:23 +0000)
committerRoland McGrath <roland@redhat.com>
Mon, 16 Jul 2007 22:23:37 +0000 (22:23 +0000)
2007-07-16  Roland McGrath  <roland@redhat.com>

* dwfl_module.c (dwfl_report_module): Increment DWFL->nmodules when
reviving an existing module.

tests/
2007-07-16  Roland McGrath  <roland@redhat.com>

* dwfl-bug-report.c: New file.
* Makefile.am (noinst_PROGRAMS, TESTS): Add it.
(dwfl_bug_report_LDADD): New variable.

12 files changed:
libdw/ChangeLog
libdw/libdw.h
libdwfl/ChangeLog
libdwfl/dwfl_module.c
libebl/ChangeLog
libebl/eblobjnote.c
libebl/eblobjnotetypename.c
libelf/ChangeLog
libelf/elf.h
tests/ChangeLog
tests/Makefile.am
tests/dwfl-bug-report.c [new file with mode: 0644]

index 50dc089ebe4695eda4f46d4136bf0fc298cf857e..78b10528c5b437253b6fcbb3a1fdd51d86154682 100644 (file)
@@ -1,3 +1,8 @@
+2007-07-03  Roland McGrath  <roland@redhat.com>
+
+       * libdw.h (__extern_inline): New macro.
+       [__OPTIMIZE__] (dwarf_whatattr, dwarf_whatform): Use it.
+
 2007-04-16  Roland McGrath  <roland@redhat.com>
 
        * libdw.map (ELFUTILS_0.127): Add dwfl_module_address_section.
index 968e73a2d9d9493bf461573af279e6f791803928..5385312752f5c18298fb011032c52a6118112167 100644 (file)
 # define __nonnull_attribute__(args...)
 #endif
 
+#ifdef __GNUC_STDC_INLINE__
+# define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
+#else
+# define __extern_inline extern __inline
+#endif
+
 
 /* Mode for the session.  */
 typedef enum
@@ -624,14 +630,14 @@ extern Dwarf_OOM dwarf_new_oom_handler (Dwarf *dbg, Dwarf_OOM handler);
 /* Inline optimizations.  */
 #ifdef __OPTIMIZE__
 /* Return attribute code of given attribute.  */
-extern inline unsigned int
+__extern_inline unsigned int
 dwarf_whatattr (Dwarf_Attribute *attr)
 {
   return attr == NULL ? 0 : attr->code;
 }
 
 /* Return attribute code of given attribute.  */
-extern inline unsigned int
+__extern_inline unsigned int
 dwarf_whatform (Dwarf_Attribute *attr)
 {
   return attr == NULL ? 0 : attr->form;
index 53286668a3dae7017530a28db4075796ebec5de8..9df78876ea7129314f0c1dc45c14e84b5600f6f4 100644 (file)
@@ -1,4 +1,9 @@
-2007-06-08  Roland McGrath  <roland@frob.com>
+2007-07-16  Roland McGrath  <roland@redhat.com>
+
+       * dwfl_module.c (dwfl_report_module): Increment DWFL->nmodules when
+       reviving an existing module.
+
+2007-06-08  Roland McGrath  <roland@redhat.com>
 
        * libdwflP.h: Fix #ifndef for config.h to use PACKAGE_NAME.
 
index a47b068a70584961167ba31286b6730b3da42159..b84a0a80753243e39fa2f4ea05550f9cef14b884 100644 (file)
@@ -149,6 +149,7 @@ dwfl_report_module (Dwfl *dwfl, const char *name,
          m->next = *tailp;
          m->gc = false;
          *tailp = m;
+         ++dwfl->nmodules;
          return m;
        }
 
index cda50af4fcb0f6cccfd987e85013e3aafb93378f..a48f8e33305ddf63b4f3f699e3ace0e33fe5eabd 100644 (file)
@@ -1,3 +1,10 @@
+2007-07-09  Roland McGrath  <roland@redhat.com>
+
+       * eblobjnotetypename.c (ebl_object_note_type_name): Handle
+       NT_GNU_HWCAP, NT_GNU_BUILD_ID.
+
+       * eblobjnote.c (ebl_object_note): Handle NT_GNU_BUILD_ID.
+
 2007-04-22  Roland McGrath  <roland@redhat.com>
 
        * eblcorenotetypename.c (ebl_core_note_type_name): Handle NT_PRXFPREG.
index d4b6e1f4f257577c8d88ade08fe01bd2ef349f9f..747fb8e7bfc705d660c00a51f3421a054896811b 100644 (file)
@@ -1,5 +1,5 @@
 /* Print contents of object file note.
-   Copyright (C) 2002 Red Hat, Inc.
+   Copyright (C) 2002, 2007 Red Hat, Inc.
    This file is part of Red Hat elfutils.
    Written by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -70,6 +70,17 @@ ebl_object_note (ebl, name, type, descsz, desc)
     /* The machine specific function did not know this type.  */
     switch (type)
       {
+      case NT_GNU_BUILD_ID:
+       if (strcmp (name, "GNU") == 0 && descsz > 0)
+         {
+           printf (gettext ("    Build ID: "));
+           uint_fast32_t i;
+           for (i = 0; i < descsz - 1; ++i)
+             printf ("%02" PRIx8, (uint8_t) desc[i]);
+           printf ("%02" PRIx8 "\n", (uint8_t) desc[i]);
+         }
+       break;
+
       case NT_VERSION:
        if (strcmp (name, "GNU") == 0 && descsz >= 8)
          {
index 6bf905968ef9a107fc2ef908c3dc2c3da1869fed..ff9330f93af8e61aa1b14270c3bd049b26e05550 100644 (file)
@@ -1,5 +1,5 @@
 /* Return note type name.
-   Copyright (C) 2002 Red Hat, Inc.
+   Copyright (C) 2002, 2007 Red Hat, Inc.
    This file is part of Red Hat elfutils.
    Written by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -72,6 +72,8 @@ ebl_object_note_type_name (ebl, type, buf, len)
        {
 #define KNOWNSTYPE(name) [NT_##name] = #name
          KNOWNSTYPE (VERSION),
+         KNOWNSTYPE (GNU_HWCAP),
+         KNOWNSTYPE (GNU_BUILD_ID),
        };
 
       /* Handle standard names.  */
index be1735fbced993e261646ec780c7ab5a49bbd564..37b60730f7512eeea785cdde3d7fe391cd325826 100644 (file)
@@ -1,3 +1,7 @@
+2007-07-09  Roland McGrath  <roland@redhat.com>
+
+       * elf.h: Update from glibc.
+
 2007-04-22  Roland McGrath  <roland@redhat.com>
 
        * elf.h: Update from glibc.
index 6c2d54c1681018bd95c3b1de30c01944111fe99f..6cc547ef6030a208b47a3510f3fcb8f07c13a2fd 100644 (file)
@@ -602,8 +602,8 @@ typedef struct
 #define NT_UTSNAME     15              /* Contains copy of utsname struct */
 #define NT_LWPSTATUS   16              /* Contains copy of lwpstatus struct */
 #define NT_LWPSINFO    17              /* Contains copy of lwpinfo struct */
-#define NT_PRFPXREG    20              /* Contains copy of fprxregset struct*/
-#define NT_PRXFPREG    0x46e62b7f      /* Contains copy of user_fxsr_struct*/
+#define NT_PRFPXREG    20              /* Contains copy of fprxregset struct */
+#define NT_PRXFPREG    0x46e62b7f      /* Contains copy of user_fxsr_struct */
 
 /* Legal values for the note segment descriptor types for object files.  */
 
@@ -1017,15 +1017,28 @@ typedef struct
    word 2: minor version of the ABI
    word 3: subminor version of the ABI
 */
-#define ELF_NOTE_ABI           1
+#define NT_GNU_ABI_TAG 1
+#define ELF_NOTE_ABI   NT_GNU_ABI_TAG /* Old name.  */
 
-/* Known OSes.  These value can appear in word 0 of an ELF_NOTE_ABI
-   note section entry.  */
+/* Known OSes.  These values can appear in word 0 of an
+   NT_GNU_ABI_TAG note section entry.  */
 #define ELF_NOTE_OS_LINUX      0
 #define ELF_NOTE_OS_GNU                1
 #define ELF_NOTE_OS_SOLARIS2   2
 #define ELF_NOTE_OS_FREEBSD    3
 
+/* Synthetic hwcap information.  The descriptor begins with two words:
+   word 0: number of entries
+   word 1: bitmask of enabled entries
+   Then follow variable-length entries, one byte followed by a
+   '\0'-terminated hwcap name string.  The byte gives the bit
+   number to test if enabled, (1U << bit) & bitmask.  */
+#define NT_GNU_HWCAP   2
+
+/* Build ID bits as generated by ld --build-id.
+   The descriptor consists of any nonzero number of bytes.  */
+#define NT_GNU_BUILD_ID        3
+
 
 /* Move records.  */
 typedef struct
index e21e90da45a90b474b39dc3f46a495367ddbd7d6..9d082c879a1e071fe5c3df748450e3e030d06497 100644 (file)
@@ -1,4 +1,10 @@
-2007-06-06  Roland McGrath  <roland@frob.com>
+2007-07-16  Roland McGrath  <roland@redhat.com>
+
+       * dwfl-bug-report.c: New file.
+       * Makefile.am (noinst_PROGRAMS, TESTS): Add it.
+       (dwfl_bug_report_LDADD): New variable.
+
+2007-06-06  Roland McGrath  <roland@redhat.com>
 
        * run-unstrip-test.sh: Declare testfile.unstrip for removal.
 
 
        * show-abbrev.c (main): Adjust for dwarf_getabbrev interface change.
 
-2005-04-04  Roland McGrath  <roland@frob.com>
+2005-04-04  Roland McGrath  <roland@redhat.com>
 
        * line2addr.c (main): Initialize LINES and NLINES before calling
        dwarf_getsrc_file, and free LINES afterwards.
index ec312c32c808d292c9d49560fdb193b3e0725b17..86638768bb036e2384b8942eb3eedca8c76a3829 100644 (file)
@@ -59,7 +59,7 @@ noinst_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \
                  show-abbrev hash newscn ecp dwflmodtest \
                  find-prologues funcretval allregs rdwrmmap \
                  dwfl-bug-addr-overflow arls dwfl-bug-fd-leak \
-                 dwfl-addr-sect
+                 dwfl-addr-sect dwfl-bug-report
 # get-ciefde
 asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \
            asm-tst6 asm-tst7 asm-tst8 asm-tst9
@@ -78,7 +78,8 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \
        run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \
        run-find-prologues.sh run-allregs.sh run-readelf-test1.sh \
        run-native-test.sh run-bug1-test.sh \
-       dwfl-bug-addr-overflow run-addrname-test.sh dwfl-bug-fd-leak \
+       dwfl-bug-addr-overflow run-addrname-test.sh \
+       dwfl-bug-fd-leak dwfl-bug-report \
        run-dwfl-bug-offline-rel.sh
 # run-show-ciefde.sh
 
@@ -210,6 +211,7 @@ rdwrmmap_LDADD = $(libelf)
 dwfl_bug_addr_overflow_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
 arls_LDADD = $(libelf) $(libmudflap)
 dwfl_bug_fd_leak_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
+dwfl_bug_report_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
 dwfl_addr_sect_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
 
 CLEANFILES = xxx *.gcno *.gcda *gconv
diff --git a/tests/dwfl-bug-report.c b/tests/dwfl-bug-report.c
new file mode 100644 (file)
index 0000000..5f8699d
--- /dev/null
@@ -0,0 +1,57 @@
+/* Test program for dwfl_report_end bug.
+   Copyright (C) 2007 Red Hat, Inc.
+   This file is part of Red Hat elfutils.
+
+   Red Hat elfutils 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; version 2 of the License.
+
+   Red Hat 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 Red Hat elfutils; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+   Red Hat elfutils is an included package of the Open Invention Network.
+   An included package of the Open Invention Network is a package for which
+   Open Invention Network licensees cross-license their patents.  No patent
+   license is granted, either expressly or impliedly, by designation as an
+   included package.  Should you wish to participate in the Open Invention
+   Network licensing program, please visit www.openinventionnetwork.com
+   <http://www.openinventionnetwork.com>.  */
+
+#include <config.h>
+#include ELFUTILS_HEADER(dwfl)
+
+#include <elfutils/libdwfl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+
+static const Dwfl_Callbacks callbacks =
+  {
+    .find_elf = dwfl_linux_proc_find_elf,
+    .find_debuginfo = dwfl_standard_find_debuginfo,
+  };
+
+int
+main (void)
+{
+  Dwfl *dwfl = dwfl_begin (&callbacks);
+
+  for (int i = 0; i < 5; ++i)
+    {
+      dwfl_report_begin (dwfl);
+      dwfl_report_module (dwfl, "module1", 0, 10);
+      dwfl_report_end (dwfl, NULL, NULL);
+    }
+
+  dwfl_end (dwfl);
+
+  return 0;
+}