summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlrich Drepper <[email protected]>2009-01-17 15:21:25 -0800
committerUlrich Drepper <[email protected]>2009-01-17 15:21:25 -0800
commitd3fb1c85285587bb4d76693d06d5fce52cdcaa4d (patch)
tree9ad76c69e4e50028e6bee9107ed3adb8d15f99b8
parent978360c6ec51192ab7f1333ae9f1c105bcdb5ecd (diff)
parent54456d8e63bfe787e2b616993e26aba1c8dffa4d (diff)
Merge branch 'master' of ssh://git.fedorahosted.org/git/elfutils
-rw-r--r--config/ChangeLog5
-rw-r--r--config/Makefile.am4
-rw-r--r--config/known-dwarf.awk45
-rw-r--r--lib/ChangeLog5
-rw-r--r--lib/system.h14
-rw-r--r--libdw/ChangeLog14
-rw-r--r--libdw/Makefile.am5
-rw-r--r--libdw/dwarf.h44
-rw-r--r--src/ChangeLog18
-rw-r--r--src/addr2line.c6
-rw-r--r--src/ar.c5
-rw-r--r--src/elfcmp.c5
-rw-r--r--src/elflint.c5
-rw-r--r--src/findtextrel.c6
-rw-r--r--src/ld.c4
-rw-r--r--src/nm.c4
-rw-r--r--src/objdump.c4
-rw-r--r--src/ranlib.c4
-rw-r--r--src/readelf.c4
-rw-r--r--src/size.c4
-rw-r--r--src/strings.c4
-rw-r--r--src/strip.c4
-rw-r--r--src/unstrip.c5
23 files changed, 165 insertions, 53 deletions
diff --git a/config/ChangeLog b/config/ChangeLog
index 0c503736..883e8939 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,8 @@
+2009-01-11 Roland McGrath <[email protected]>
+
+ * known-dwarf.awk: New file.
+ * Makefile.am (EXTRA_DIST): Add it.
+
2008-12-24 Roland McGrath <[email protected]>
* Makefile.am ($(srcdir)/elfutils.spec.in): Rewrite awk magic.
diff --git a/config/Makefile.am b/config/Makefile.am
index f2db4efb..91adeee5 100644
--- a/config/Makefile.am
+++ b/config/Makefile.am
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-
## Configure input file for elfutils.
##
-## Copyright (C) 2004, 2005, 2008 Red Hat, Inc.
+## Copyright (C) 2004, 2005, 2008, 2009 Red Hat, Inc.
## This file is part of Red Hat elfutils.
##
## Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -25,7 +25,7 @@
## Network licensing program, please visit www.openinventionnetwork.com
## <http://www.openinventionnetwork.com>.
##
-EXTRA_DIST = elfutils.spec.in
+EXTRA_DIST = elfutils.spec.in known-dwarf.awk
if MAINTAINER_MODE
$(srcdir)/elfutils.spec.in: $(top_srcdir)/NEWS
diff --git a/config/known-dwarf.awk b/config/known-dwarf.awk
new file mode 100644
index 00000000..6e8af6d4
--- /dev/null
+++ b/config/known-dwarf.awk
@@ -0,0 +1,45 @@
+#!/bin/awk -f
+
+$1 ~ /DW_([A-Z]+)_([^ ]+)/ {
+ match($1, /DW_([A-Z]+)_([^ ]+)/, fields);
+ set = fields[1];
+ elt = fields[2];
+ if (set in DW)
+ DW[set] = DW[set] "," elt;
+ else
+ DW[set] = elt;
+ if ($NF == "*/" && $4 == "/*") {
+ c = $5;
+ for (i = 6; i < NF; ++i) c = c " " $i;
+ comment[set, elt] = c;
+ }
+}
+END {
+ print "/* Generated by config/dwarf-known.awk from libdw.h contents. */";
+ n = asorti(DW, sets);
+ for (i = 1; i <= n; ++i) {
+ set = sets[i];
+ if (what && what != set) continue;
+ print "\n#define ALL_KNOWN_DW_" set " \\";
+ split(DW[set], elts, ",");
+ m = asort(elts);
+ lo = hi = "";
+ for (j = 1; j <= m; ++j) {
+ elt = elts[j];
+ if (elt ~ /(lo|low)_user$/) {
+ lo = elt;
+ continue;
+ }
+ if (elt ~ /(hi|high)_user$/) {
+ hi = elt;
+ continue;
+ }
+ if (comment[set, elt])
+ print " ONE_KNOWN_DW_" set "_DESC (" elt ", DW_" set "_" elt \
+ ", \"" comment[set, elt] "\") \\";
+ else
+ print " ONE_KNOWN_DW_" set " (" elt ", DW_" set "_" elt ") \\";
+ }
+ print " /* End of DW_" set "_*. */";
+ }
+}
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 8791640b..0774524c 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,8 @@
+2009-01-17 Ulrich Drepper <[email protected]>
+
+ * system.h (ARGP_PROGRAM_VERSION_HOOK_DEF): Define.
+ (ARGP_PROGRAM_BUG_ADDRESS_DEF): Define.
+
2009-01-10 Ulrich Drepper <[email protected]>
* eu-config.h: Remove tls_key_t, key_create, getspecific, setspecific,
diff --git a/lib/system.h b/lib/system.h
index 23c666ad..10b4734a 100644
--- a/lib/system.h
+++ b/lib/system.h
@@ -1,5 +1,5 @@
/* Declarations for common convenience functions.
- Copyright (C) 2006 Red Hat, Inc.
+ Copyright (C) 2006, 2009 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -78,4 +78,16 @@ extern int crc32_file (int fd, uint32_t *resp);
#define pread_retry(fd, buf, len, off) \
TEMP_FAILURE_RETRY (pread (fd, buf, len, off))
+
+/* We need define two variables, argp_program_version_hook and
+ argp_program_bug_address, in all programs. argp.h declares these
+ variables as non-const (which is correct in general). But we can
+ do better, it is not going to change. So we want to move them into
+ the .rodata section. Define macros to do the trick. */
+#define ARGP_PROGRAM_VERSION_HOOK_DEF \
+ void (*const apvh) (FILE *, struct argp_state *) \
+ __asm ("argp_program_version_hook")
+#define ARGP_PROGRAM_BUG_ADDRESS_DEF \
+ const char *const apba__ __asm ("argp_program_bug_address")
+
#endif /* system.h */
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index cefb900b..51ab6e94 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,17 @@
+2009-01-17 Roland McGrath <[email protected]>
+
+ * Makefile.am (known-dwarf.h): Target renamed, not in $(srcdir).
+ Make it unconditional.
+ (BUILT_SOURCES): Updated.
+
+ * dwarf.h: Add description comments for DW_LANG_* values.
+
+ * Makefile.am [MAINTAINER_MODE]
+ ($(srcdir)/known-dwarf.h): New target.
+ (BUILT_SOURCES): Add it.
+
+ * dwarf.h: Add DW_OP_GNU_push_tls_address, DW_OP_GNU_uninit.
+
2009-01-10 Ulrich Drepper <[email protected]>
* dwarf_error.c: Always use __thread. Remove all !USE_TLS code.
diff --git a/libdw/Makefile.am b/libdw/Makefile.am
index 56c7a2ff..5f84abd8 100644
--- a/libdw/Makefile.am
+++ b/libdw/Makefile.am
@@ -85,6 +85,11 @@ libdw_a_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \
libdw_visit_scopes.c \
dwarf_entry_breakpoints.c
+BUILT_SOURCES = known-dwarf.h
+known-dwarf.h: $(top_srcdir)/config/known-dwarf.awk $(srcdir)/dwarf.h
+ $(AWK) -f $^ > [email protected]
+
if !MUDFLAP
libdw_pic_a_SOURCES =
am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
diff --git a/libdw/dwarf.h b/libdw/dwarf.h
index 091519c5..cce46304 100644
--- a/libdw/dwarf.h
+++ b/libdw/dwarf.h
@@ -1,5 +1,5 @@
/* This file defines standard DWARF types, structures, and macros.
- Copyright (C) 2000, 2002, 2005, 2006, 2007, 2008 Red Hat, Inc.
+ Copyright (C) 2000,2002,2005,2006,2007,2008,2009 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -432,6 +432,10 @@ enum
DW_OP_call_frame_cfa = 0x9c,/* CFA as determined by CFI. */
DW_OP_bit_piece = 0x9d, /* ULEB128 size and ULEB128 offset in bits. */
+ /* GNU extensions. */
+ DW_OP_GNU_push_tls_address = 0xe0,
+ DW_OP_GNU_uninit = 0xf0,
+
DW_OP_lo_user = 0xe0, /* Implementation-defined range start. */
DW_OP_hi_user = 0xff /* Implementation-defined range end. */
};
@@ -515,25 +519,25 @@ enum
/* DWARF language encodings. */
enum
{
- DW_LANG_C89 = 0x0001,
- DW_LANG_C = 0x0002,
- DW_LANG_Ada83 = 0x0003,
- DW_LANG_C_plus_plus = 0x0004,
- DW_LANG_Cobol74 = 0x0005,
- DW_LANG_Cobol85 = 0x0006,
- DW_LANG_Fortran77 = 0x0007,
- DW_LANG_Fortran90 = 0x0008,
- DW_LANG_Pascal83 = 0x0009,
- DW_LANG_Modula2 = 0x000a,
- DW_LANG_Java = 0x000b,
- DW_LANG_C99 = 0x000c,
- DW_LANG_Ada95 = 0x000d,
- DW_LANG_Fortran95 = 0x000e,
- DW_LANG_PL1 = 0x000f,
- DW_LANG_Objc = 0x0010,
- DW_LANG_ObjC_plus_plus = 0x0011,
- DW_LANG_UPC = 0x0012,
- DW_LANG_D = 0x0013,
+ DW_LANG_C89 = 0x0001, /* ISO C:1989 */
+ DW_LANG_C = 0x0002, /* C */
+ DW_LANG_Ada83 = 0x0003, /* ISO Ada:1983 */
+ DW_LANG_C_plus_plus = 0x0004, /* ISO C++:1998 */
+ DW_LANG_Cobol74 = 0x0005, /* ISO Cobol:1974 */
+ DW_LANG_Cobol85 = 0x0006, /* ISO Cobol:1985 */
+ DW_LANG_Fortran77 = 0x0007, /* ISO FORTRAN 77 */
+ DW_LANG_Fortran90 = 0x0008, /* ISO Fortran 90 */
+ DW_LANG_Pascal83 = 0x0009, /* ISO Pascal:1983 */
+ DW_LANG_Modula2 = 0x000a, /* ISO Modula-2:1996 */
+ DW_LANG_Java = 0x000b, /* Java */
+ DW_LANG_C99 = 0x000c, /* ISO C:1999 */
+ DW_LANG_Ada95 = 0x000d, /* ISO Ada:1995 */
+ DW_LANG_Fortran95 = 0x000e, /* ISO Fortran 95 */
+ DW_LANG_PL1 = 0x000f, /* ISO PL/1:1976 */
+ DW_LANG_Objc = 0x0010, /* Objective-C */
+ DW_LANG_ObjC_plus_plus = 0x0011, /* Objective-C++ */
+ DW_LANG_UPC = 0x0012, /* Unified Parallel C */
+ DW_LANG_D = 0x0013, /* D */
DW_LANG_lo_user = 0x8000,
DW_LANG_Mips_Assembler = 0x8001,
diff --git a/src/ChangeLog b/src/ChangeLog
index 4a9b6316..97fd4495 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,21 @@
+2009-01-17 Ulrich Drepper <[email protected]>
+
+ * addr2line.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
+ ARGP_PROGRAM_BUG_ADDRESS_DEF.
+ * ar.c: Likewise.
+ * elfcmp.c: Likewise.
+ * elflint.c: Likewise.
+ * findtextrel.c: Likewise.
+ * ld.c: Likewise.
+ * nm.c: Likewise.
+ * objdump.c: Likewise.
+ * ranlib.c: Likewise.
+ * readelf.c: Likewise.
+ * size.c: Likewise.
+ * strings.c: Likewise.
+ * strip.c: Likewise.
+ * unstrip.c: Likewise.
+
2009-01-16 Ulrich Drepper <[email protected]>
* elflint.c (check_program_header): Check that PT_GNU_EH_FRAME entry
diff --git a/src/addr2line.c b/src/addr2line.c
index 7141e269..5a7b0456 100644
--- a/src/addr2line.c
+++ b/src/addr2line.c
@@ -46,13 +46,15 @@
#include <string.h>
#include <unistd.h>
+#include <system.h>
+
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
-void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
-const char *argp_program_bug_address = PACKAGE_BUGREPORT;
+ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT;
/* Values for the parameters which have no short form. */
diff --git a/src/ar.c b/src/ar.c
index 961db241..a7a12329 100644
--- a/src/ar.c
+++ b/src/ar.c
@@ -55,7 +55,8 @@
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
-void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
+
/* Prototypes for local functions. */
static int do_oper_extract (int oper, const char *arfname, char **argv,
int argc, long int instance);
@@ -66,7 +67,7 @@ static int do_oper_insert (int oper, const char *arfname, char **argv,
/* Bug report address. */
-const char *argp_program_bug_address = PACKAGE_BUGREPORT;
+ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT;
/* Definitions of arguments for argp functions. */
diff --git a/src/elfcmp.c b/src/elfcmp.c
index 8903efb1..a1596365 100644
--- a/src/elfcmp.c
+++ b/src/elfcmp.c
@@ -41,6 +41,7 @@
#include <string.h>
#include <unistd.h>
+#include <system.h>
#include "../libelf/elf-knowledge.h"
#include "../libebl/libeblP.h"
@@ -53,10 +54,10 @@ static int regioncompare (const void *p1, const void *p2);
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
-void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
-const char *argp_program_bug_address = PACKAGE_BUGREPORT;
+ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT;
/* Values for the parameters which have no short form. */
#define OPT_GAPS 0x100
diff --git a/src/elflint.c b/src/elflint.c
index 497f959e..19299023 100644
--- a/src/elflint.c
+++ b/src/elflint.c
@@ -56,10 +56,10 @@
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
-void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
-const char *argp_program_bug_address = PACKAGE_BUGREPORT;
+ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT;
#define ARGP_strict 300
#define ARGP_gnuld 301
@@ -67,7 +67,6 @@ const char *argp_program_bug_address = PACKAGE_BUGREPORT;
/* Definitions of arguments for argp functions. */
static const struct argp_option options[] =
{
-
{ "strict", ARGP_strict, NULL, 0,
N_("Be extremely strict, flag level 2 features."), 0 },
{ "quiet", 'q', NULL, 0, N_("Do not print anything if successful"), 0 },
diff --git a/src/findtextrel.c b/src/findtextrel.c
index 2fd99c96..9d10982f 100644
--- a/src/findtextrel.c
+++ b/src/findtextrel.c
@@ -44,6 +44,8 @@
#include <string.h>
#include <unistd.h>
+#include <system.h>
+
struct segments
{
@@ -54,10 +56,10 @@ struct segments
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
-void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
-const char *argp_program_bug_address = PACKAGE_BUGREPORT;
+ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT;
/* Values for the parameters which have no short form. */
#define OPT_DEBUGINFO 0x100
diff --git a/src/ld.c b/src/ld.c
index b4cc6cc7..989bfaba 100644
--- a/src/ld.c
+++ b/src/ld.c
@@ -48,10 +48,10 @@
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
-void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
-const char *argp_program_bug_address = PACKAGE_BUGREPORT;
+ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT;
/* Values for the various options. */
diff --git a/src/nm.c b/src/nm.c
index 8b8f547f..8833948a 100644
--- a/src/nm.c
+++ b/src/nm.c
@@ -58,10 +58,10 @@
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
-void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
-const char *argp_program_bug_address = PACKAGE_BUGREPORT;
+ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT;
/* Values for the parameters which have no short form. */
diff --git a/src/objdump.c b/src/objdump.c
index 55d3ae2e..7f639410 100644
--- a/src/objdump.c
+++ b/src/objdump.c
@@ -49,10 +49,10 @@
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
-void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
-const char *argp_program_bug_address = PACKAGE_BUGREPORT;
+ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT;
/* Definitions of arguments for argp functions. */
diff --git a/src/ranlib.c b/src/ranlib.c
index f456b997..e92dc89b 100644
--- a/src/ranlib.c
+++ b/src/ranlib.c
@@ -58,10 +58,10 @@ static int handle_file (const char *fname);
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
-void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
-const char *argp_program_bug_address = PACKAGE_BUGREPORT;
+ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT;
/* Definitions of arguments for argp functions. */
diff --git a/src/readelf.c b/src/readelf.c
index 5d74cb56..a3223eb4 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -61,10 +61,10 @@
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
-void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
-const char *argp_program_bug_address = PACKAGE_BUGREPORT;
+ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT;
/* Definitions of arguments for argp functions. */
static const struct argp_option options[] =
diff --git a/src/size.c b/src/size.c
index 9f59cceb..f6f23d55 100644
--- a/src/size.c
+++ b/src/size.c
@@ -50,10 +50,10 @@
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
-void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
-const char *argp_program_bug_address = PACKAGE_BUGREPORT;
+ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT;
/* Values for the parameters which have no short form. */
diff --git a/src/strings.c b/src/strings.c
index aebf07bd..b69f2ad2 100644
--- a/src/strings.c
+++ b/src/strings.c
@@ -59,10 +59,10 @@ static int read_elf (Elf *elf, int fd, const char *fname, off64_t fdlen);
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
-void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
-const char *argp_program_bug_address = PACKAGE_BUGREPORT;
+ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT;
/* Definitions of arguments for argp functions. */
static const struct argp_option options[] =
diff --git a/src/strip.c b/src/strip.c
index 3ca047af..1958bb51 100644
--- a/src/strip.c
+++ b/src/strip.c
@@ -55,10 +55,10 @@
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
-void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
-const char *argp_program_bug_address = PACKAGE_BUGREPORT;
+ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT;
/* Values for the parameters which have no short form. */
diff --git a/src/unstrip.c b/src/unstrip.c
index 4a6fd197..97b73c6f 100644
--- a/src/unstrip.c
+++ b/src/unstrip.c
@@ -64,11 +64,10 @@
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
-void (*argp_program_version_hook) (FILE *, struct argp_state *)
- = print_version;
+ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
/* Bug report address. */
-const char *argp_program_bug_address = PACKAGE_BUGREPORT;
+ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT;
/* Definitions of arguments for argp functions. */
static const struct argp_option options[] =