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/system.h | |
parent | 3a52c7a528e41cc28e69e68ef817f0b2d7f130e5 (diff) | |
download | elfutils-fdc93e12a77866cafd1aae4463d89cef2c01d9b1.tar.gz |
Move argp_program_version_hook and argp_program_bug_address variables
in all programs into the .rodata section.
Diffstat (limited to 'lib/system.h')
-rw-r--r-- | lib/system.h | 14 |
1 files changed, 13 insertions, 1 deletions
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 */ |