From fdc93e12a77866cafd1aae4463d89cef2c01d9b1 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 17 Jan 2009 11:47:10 -0800 Subject: Move argp_program_version_hook and argp_program_bug_address variables in all programs into the .rodata section. --- src/ChangeLog | 18 ++++++++++++++++++ src/addr2line.c | 6 ++++-- src/ar.c | 5 +++-- src/elfcmp.c | 5 +++-- src/elflint.c | 5 ++--- src/findtextrel.c | 6 ++++-- src/ld.c | 4 ++-- src/nm.c | 4 ++-- src/objdump.c | 4 ++-- src/ranlib.c | 4 ++-- src/readelf.c | 4 ++-- src/size.c | 4 ++-- src/strings.c | 4 ++-- src/strip.c | 4 ++-- src/unstrip.c | 5 ++--- 15 files changed, 52 insertions(+), 30 deletions(-) (limited to 'src') 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 + + * 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 * 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 #include +#include + /* 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 #include +#include #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 35368a5e..1c508c47 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 #include +#include + 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[] = -- cgit v1.2.1