From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 61DB6138335 for ; Thu, 7 Jun 2018 04:44:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CF2DAE0C09; Thu, 7 Jun 2018 04:44:13 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 617BDE0BF8 for ; Thu, 7 Jun 2018 04:44:13 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 27A05335C92 for ; Thu, 7 Jun 2018 04:44:12 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AE8AB2C7 for ; Thu, 7 Jun 2018 04:44:10 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1528346490.f76827ef097d155a65e4536ee34c5d5f3b3635d3.vapier@gentoo> Subject: [gentoo-commits] proj/pax-utils:master commit in: / X-VCS-Repository: proj/pax-utils X-VCS-Files: scanelf.c X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: f76827ef097d155a65e4536ee34c5d5f3b3635d3 X-VCS-Branch: master Date: Thu, 7 Jun 2018 04:44:10 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 14968590-3ec9-4807-bafb-4cbe297436c8 X-Archives-Hash: d7ffb317abc469e21dd39435aa24e49e commit: f76827ef097d155a65e4536ee34c5d5f3b3635d3 Author: Mike Frysinger gentoo org> AuthorDate: Fri Mar 3 20:10:27 2017 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Thu Jun 7 04:41:30 2018 +0000 URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=f76827ef scanelf: constify most scanelf_file_* helpers Just house keeping -- all of these pointers are already used as const mem. scanelf.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scanelf.c b/scanelf.c index 16f712f..7095c96 100644 --- a/scanelf.c +++ b/scanelf.c @@ -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;