diff options
author | 2017-03-03 12:10:27 -0800 | |
---|---|---|
committer | 2018-06-07 00:41:30 -0400 | |
commit | f76827ef097d155a65e4536ee34c5d5f3b3635d3 (patch) | |
tree | eebed7b2f34dd796761127fc7174066609e6ca64 /scanelf.c | |
parent | scanelf: constify rpath_security_checks (diff) | |
download | pax-utils-f76827ef097d155a65e4536ee34c5d5f3b3635d3.tar.gz pax-utils-f76827ef097d155a65e4536ee34c5d5f3b3635d3.tar.bz2 pax-utils-f76827ef097d155a65e4536ee34c5d5f3b3635d3.zip |
scanelf: constify most scanelf_file_* helpers
Just house keeping -- all of these pointers are already used as const mem.
Diffstat (limited to 'scanelf.c')
-rw-r--r-- | scanelf.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -411,7 +411,7 @@ static const char *scanelf_file_pax(elfobj *elf, char *found_pax) return ret; } -static char *scanelf_file_phdr(elfobj *elf, char *found_phdr, char *found_relro, char *found_load) +static const char *scanelf_file_phdr(elfobj *elf, char *found_phdr, char *found_relro, char *found_load) { static char ret[12]; char *found; @@ -556,7 +556,7 @@ static const char *scanelf_file_textrel(elfobj *elf, char *found_textrel) * Should rewrite this to check PT_LOAD sections that are marked * Executable rather than the section named '.text'. */ -static char *scanelf_file_textrels(elfobj *elf, char *found_textrels, char *found_textrel) +static const char *scanelf_file_textrels(elfobj *elf, char *found_textrels, char *found_textrel) { unsigned long r, rmax; void *symtab_void, *strtab_void; @@ -939,7 +939,7 @@ static char *lookup_config_lib(const char *fname) static const char *scanelf_file_needed_lib(elfobj *elf, char *found_needed, char *found_lib, int op, char **ret, size_t *ret_len) { - char *needed; + const char *needed; void *strtab_void; char *p; @@ -1011,7 +1011,7 @@ static const char *scanelf_file_needed_lib(elfobj *elf, char *found_needed, char return NULL; } -static char *scanelf_file_interp(elfobj *elf, char *found_interp) +static const char *scanelf_file_interp(elfobj *elf, char *found_interp) { uint64_t offset = 0; @@ -1043,7 +1043,7 @@ static char *scanelf_file_interp(elfobj *elf, char *found_interp) /* Validate the pointer even if we don't use it in output */ if (offset && offset <= (uint64_t)elf->len) { - char *interp = elf->data + offset; + const char *interp = elf->data + offset; /* If it isn't a C pointer, it's garbage */ if (memchr(interp, 0, elf->len - offset)) { @@ -1088,9 +1088,9 @@ static const char *scanelf_file_bind(elfobj *elf, char *found_bind) return dynamic ? "LAZY" : "STATIC"; } } -static char *scanelf_file_soname(elfobj *elf, char *found_soname) +static const char *scanelf_file_soname(elfobj *elf, char *found_soname) { - char *soname; + const char *soname; void *strtab_void; if (!show_soname) return NULL; |