diff options
author | Mike Frysinger <vapier@gentoo.org> | 2017-03-03 12:07:15 -0800 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2017-03-03 12:07:15 -0800 |
commit | 4358729342fd859b7099ae9f2d2274e677bdd306 (patch) | |
tree | fb8be875426a9f5bda216a75e6fbad7b1c4c7696 | |
parent | lddtree: move parser logic into a func (diff) | |
download | pax-utils-4358729342fd859b7099ae9f2d2274e677bdd306.tar.gz pax-utils-4358729342fd859b7099ae9f2d2274e677bdd306.tar.bz2 pax-utils-4358729342fd859b7099ae9f2d2274e677bdd306.zip |
paxelf: constify pax_short_* helpers
-rw-r--r-- | paxelf.c | 6 | ||||
-rw-r--r-- | paxelf.h | 6 | ||||
-rw-r--r-- | scanelf.c | 5 |
3 files changed, 8 insertions, 9 deletions
@@ -726,7 +726,7 @@ void unreadelf(elfobj *elf) free(elf); } -char *pax_short_hf_flags(unsigned long flags) +const char *pax_short_hf_flags(unsigned long flags) { static char buffer[7]; @@ -746,7 +746,7 @@ char *pax_short_hf_flags(unsigned long flags) * lower case: explicitly disabled * upper case: explicitly enabled * - : default */ -char *pax_short_pf_flags(unsigned long flags) +const char *pax_short_pf_flags(unsigned long flags) { static char buffer[7]; @@ -772,7 +772,7 @@ char *pax_short_pf_flags(unsigned long flags) return buffer; } -char *gnu_short_stack_flags(unsigned long flags) +const char *gnu_short_stack_flags(unsigned long flags) { static char buffer[4]; @@ -50,9 +50,9 @@ typedef struct { (phdr && VALID_RANGE(elf, EGET(phdr->p_offset), EGET(phdr->p_filesz))) /* prototypes */ -extern char *pax_short_hf_flags(unsigned long flags); -extern char *pax_short_pf_flags(unsigned long flags); -extern char *gnu_short_stack_flags(unsigned long flags); +extern const char *pax_short_hf_flags(unsigned long flags); +extern const char *pax_short_pf_flags(unsigned long flags); +extern const char *gnu_short_stack_flags(unsigned long flags); extern elfobj *readelf_buffer(const char *filename, void *buffer, size_t buffer_len); extern elfobj *_readelf_fd(const char *filename, int fd, size_t len, int read_only); #define readelf_fd(filename, fd, len) _readelf_fd(filename, fd, len, 1) @@ -358,7 +358,7 @@ static void scanelf_file_get_symtabs(elfobj *elf, void **sym, void **str) warn("%s: ELF hash table is corrupt", elf->filename); } -static char *scanelf_file_pax(elfobj *elf, char *found_pax) +static const char *scanelf_file_pax(elfobj *elf, char *found_pax) { static char ret[7]; unsigned long i, shown; @@ -397,8 +397,7 @@ static char *scanelf_file_pax(elfobj *elf, char *found_pax) /* fall back to EI_PAX if no PT_PAX was found */ if (!*ret) { - static char *paxflags; - paxflags = pax_short_hf_flags(EI_PAX_FLAGS(elf)); + const char *paxflags = pax_short_hf_flags(EI_PAX_FLAGS(elf)); if (!be_quiet || (be_quiet && EI_PAX_FLAGS(elf))) { *found_pax = 1; return (be_wewy_wewy_quiet ? NULL : paxflags); |