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 EE5611395E2 for ; Tue, 15 Nov 2016 04:02:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A2D79E0ABC; Tue, 15 Nov 2016 04:02:44 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8CE73E0ABC for ; Tue, 15 Nov 2016 04:02:44 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 56ED2341592 for ; Tue, 15 Nov 2016 04:02:43 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A2B3D24BB for ; Tue, 15 Nov 2016 04:02:41 +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: <1479182467.7aeb66e8ab261007a95fd0fee0f573d6aede496d.vapier@gentoo> Subject: [gentoo-commits] proj/pax-utils:master commit in: / X-VCS-Repository: proj/pax-utils X-VCS-Files: paxldso.c paxldso.h X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 7aeb66e8ab261007a95fd0fee0f573d6aede496d X-VCS-Branch: master Date: Tue, 15 Nov 2016 04:02:41 +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: ba08d4a9-210b-49a4-a92c-9142c3aa2292 X-Archives-Hash: d9f7386c5e5fbbd61dbfbc4b76e6bd55 commit: 7aeb66e8ab261007a95fd0fee0f573d6aede496d Author: Mike Frysinger gentoo org> AuthorDate: Tue Nov 15 04:01:07 2016 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Tue Nov 15 04:01:07 2016 +0000 URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=7aeb66e8 paxldso: always expose ldpaths array This fixes building when ldso config logic is unavailable since consumers (like scanelf) always attempt to walk the array. Changing the code to be an empty array by default so it won't suck up too much space when support isn't available. paxldso.c | 4 ++-- paxldso.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/paxldso.c b/paxldso.c index 93eaf97..ce64e6c 100644 --- a/paxldso.c +++ b/paxldso.c @@ -235,11 +235,11 @@ static void ldso_cache_cleanup(void) * ld.so.conf logic */ -#if PAX_LDSO_CONFIG - static array_t _ldpaths = array_init_decl; array_t *ldpaths = &_ldpaths; +#if PAX_LDSO_CONFIG + #if defined(__GLIBC__) || defined(__UCLIBC__) || defined(__NetBSD__) int ldso_config_load(const char *fname) diff --git a/paxldso.h b/paxldso.h index bbf8852..1517e5e 100644 --- a/paxldso.h +++ b/paxldso.h @@ -49,8 +49,9 @@ static inline char *ldso_cache_lookup_lib(elfobj *elf, const char *fname) # define PAX_LDSO_CONFIG 1 #endif -#if PAX_LDSO_CONFIG +/* Consumers refer to ldpaths directly, so can't hide its def. */ extern array_t *ldpaths; +#if PAX_LDSO_CONFIG extern int ldso_config_load(const char *fname); #else static inline int ldso_config_load(const char *fname)