diff options
author | Ulrich Drepper <drepper@myware66.akkadia.org> | 2009-01-17 11:47:10 -0800 |
---|---|---|
committer | Ulrich Drepper <drepper@myware66.akkadia.org> | 2009-01-17 11:47:10 -0800 |
commit | fdc93e12a77866cafd1aae4463d89cef2c01d9b1 (patch) | |
tree | 96164f699e204dbc733f3810f7e534fa7265bc8e /lib | |
parent | 3a52c7a528e41cc28e69e68ef817f0b2d7f130e5 (diff) | |
download | android_external_elfutils-fdc93e12a77866cafd1aae4463d89cef2c01d9b1.tar.gz android_external_elfutils-fdc93e12a77866cafd1aae4463d89cef2c01d9b1.tar.bz2 android_external_elfutils-fdc93e12a77866cafd1aae4463d89cef2c01d9b1.zip |
Move argp_program_version_hook and argp_program_bug_address variables
in all programs into the .rodata section.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ChangeLog | 5 | ||||
-rw-r--r-- | lib/system.h | 14 |
2 files changed, 18 insertions, 1 deletions
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 <drepper@redhat.com> + + * system.h (ARGP_PROGRAM_VERSION_HOOK_DEF): Define. + (ARGP_PROGRAM_BUG_ADDRESS_DEF): Define. + 2009-01-10 Ulrich Drepper <drepper@redhat.com> * 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 */ |