summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath <[email protected]>2007-07-16 22:23:37 +0000
committerRoland McGrath <[email protected]>2007-07-16 22:23:37 +0000
commit87d4780beb37f265fa89ffd909e77513ef516180 (patch)
tree5d74ec3564099ce0370bff12595cac95644e2fe1
parent55d34a5ac854be02fa10186182bc22685923c703 (diff)
libdwfl/
2007-07-16 Roland McGrath <[email protected]> * dwfl_module.c (dwfl_report_module): Increment DWFL->nmodules when reviving an existing module. tests/ 2007-07-16 Roland McGrath <[email protected]> * dwfl-bug-report.c: New file. * Makefile.am (noinst_PROGRAMS, TESTS): Add it. (dwfl_bug_report_LDADD): New variable.
-rw-r--r--libdw/ChangeLog5
-rw-r--r--libdw/libdw.h10
-rw-r--r--libdwfl/ChangeLog7
-rw-r--r--libdwfl/dwfl_module.c1
-rw-r--r--libebl/ChangeLog7
-rw-r--r--libebl/eblobjnote.c13
-rw-r--r--libebl/eblobjnotetypename.c4
-rw-r--r--libelf/ChangeLog4
-rw-r--r--libelf/elf.h23
-rw-r--r--tests/ChangeLog10
-rw-r--r--tests/Makefile.am6
-rw-r--r--tests/dwfl-bug-report.c57
12 files changed, 133 insertions, 14 deletions
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 50dc089e..78b10528 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,8 @@
+2007-07-03 Roland McGrath <[email protected]>
+
+ * libdw.h (__extern_inline): New macro.
+ [__OPTIMIZE__] (dwarf_whatattr, dwarf_whatform): Use it.
+
2007-04-16 Roland McGrath <[email protected]>
* libdw.map (ELFUTILS_0.127): Add dwfl_module_address_section.
diff --git a/libdw/libdw.h b/libdw/libdw.h
index 968e73a2..53853127 100644
--- a/libdw/libdw.h
+++ b/libdw/libdw.h
@@ -61,6 +61,12 @@
# 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;
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index 53286668..9df78876 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,4 +1,9 @@
-2007-06-08 Roland McGrath <[email protected]>
+2007-07-16 Roland McGrath <[email protected]>
+
+ * dwfl_module.c (dwfl_report_module): Increment DWFL->nmodules when
+ reviving an existing module.
+
+2007-06-08 Roland McGrath <[email protected]>
* libdwflP.h: Fix #ifndef for config.h to use PACKAGE_NAME.
diff --git a/libdwfl/dwfl_module.c b/libdwfl/dwfl_module.c
index a47b068a..b84a0a80 100644
--- a/libdwfl/dwfl_module.c
+++ b/libdwfl/dwfl_module.c
@@ -149,6 +149,7 @@ dwfl_report_module (Dwfl *dwfl, const char *name,
m->next = *tailp;
m->gc = false;
*tailp = m;
+ ++dwfl->nmodules;
return m;
}
diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index cda50af4..a48f8e33 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -1,3 +1,10 @@
+2007-07-09 Roland McGrath <[email protected]>
+
+ * 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 <[email protected]>
* eblcorenotetypename.c (ebl_core_note_type_name): Handle NT_PRXFPREG.
diff --git a/libebl/eblobjnote.c b/libebl/eblobjnote.c
index d4b6e1f4..747fb8e7 100644
--- a/libebl/eblobjnote.c
+++ b/libebl/eblobjnote.c
@@ -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 <[email protected]>, 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)
{
diff --git a/libebl/eblobjnotetypename.c b/libebl/eblobjnotetypename.c
index 6bf90596..ff9330f9 100644
--- a/libebl/eblobjnotetypename.c
+++ b/libebl/eblobjnotetypename.c
@@ -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 <[email protected]>, 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. */
diff --git a/libelf/ChangeLog b/libelf/ChangeLog
index be1735fb..37b60730 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -1,3 +1,7 @@
+2007-07-09 Roland McGrath <[email protected]>
+
+ * elf.h: Update from glibc.
+
2007-04-22 Roland McGrath <[email protected]>
* elf.h: Update from glibc.
diff --git a/libelf/elf.h b/libelf/elf.h
index 6c2d54c1..6cc547ef 100644
--- a/libelf/elf.h
+++ b/libelf/elf.h
@@ -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
diff --git a/tests/ChangeLog b/tests/ChangeLog
index e21e90da..9d082c87 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,4 +1,10 @@
-2007-06-06 Roland McGrath <[email protected]>
+2007-07-16 Roland McGrath <[email protected]>
+
+ * dwfl-bug-report.c: New file.
+ * Makefile.am (noinst_PROGRAMS, TESTS): Add it.
+ (dwfl_bug_report_LDADD): New variable.
+
+2007-06-06 Roland McGrath <[email protected]>
* run-unstrip-test.sh: Declare testfile.unstrip for removal.
@@ -579,7 +585,7 @@
* show-abbrev.c (main): Adjust for dwarf_getabbrev interface change.
-2005-04-04 Roland McGrath <[email protected]>
+2005-04-04 Roland McGrath <[email protected]>
* line2addr.c (main): Initialize LINES and NLINES before calling
dwarf_getsrc_file, and free LINES afterwards.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index ec312c32..86638768 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -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
index 00000000..5f8699dd
--- /dev/null
+++ b/tests/dwfl-bug-report.c
@@ -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;
+}