From patchwork Tue Jun 21 05:06:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 70514 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1832008qgy; Mon, 20 Jun 2016 22:13:57 -0700 (PDT) X-Received: by 10.36.48.80 with SMTP id q77mr2313549itq.83.1466486037439; Mon, 20 Jun 2016 22:13:57 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id p6si1377pai.24.2016.06.20.22.13.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jun 2016 22:13:57 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-70824-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-70824-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-70824-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type; q=dns; s=default; b=pSEQJ sggSUFtoow5MflAf/RKuTLDSu0UCDNZ9FHvnc13UhdD6NF7f3I0CPc/QO6CflRky IEg5uigRENGfX44cV7u22iJO/ZbgznAHjo5R3uR/Dj0UUXnzuIBociz/Kk6Zg0wF n+mGo6EoLJpKX2HyjZ6k5vyVrLfpv43aPNBI4s= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type; s=default; bh=qI0iUOOiGcb uzJPnjCu7wWKMea8=; b=ABhp3XAx5ywtp60HoHXU9/AtukoEv5gUaBPOUifx3Rc mFy9ylWJVO3kqiKd9QUewUkJx5Ef4QzFw0eMrxlzx3EjXxvh39G3wJZbhHDIKhnh b5BOQz22rNEJxquxov3FYvdHX00bKtBNQoH3WBpSRoA/+1cW/b3TY9zOkheaYB4k = Received: (qmail 22448 invoked by alias); 21 Jun 2016 05:13:32 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 20121 invoked by uid 89); 21 Jun 2016 05:13:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:3526, EM_AARCH64, em_aarch64 X-HELO: na01-bn1-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; From: Yury Norov To: , CC: , , , , , , , , , Andrew Pinski , Yury Norov Subject: [PATCH 15/27] [AARCH64] Add support to ldconfig for ILP32 and libilp32 Date: Tue, 21 Jun 2016 08:06:59 +0300 Message-ID: <1466485631-3532-17-git-send-email-ynorov@caviumnetworks.com> In-Reply-To: <1466485631-3532-1-git-send-email-ynorov@caviumnetworks.com> References: <1466485631-3532-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-ClientProxiedBy: HE1PR03CA0014.eurprd03.prod.outlook.com (10.163.170.152) To BN4PR07MB2243.namprd07.prod.outlook.com (10.164.63.149) X-MS-Office365-Filtering-Correlation-Id: 899f77f4-b5fa-484b-37d9-08d3999262b3 X-Microsoft-Exchange-Diagnostics: 1; BN4PR07MB2243; 2:vqUduJQ+IamkrtXTo/E9PawEVqXR6Xxs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N94+WWUJ7YwaGcptdaXmYbt8m+z0HzyeBH4dzz1TnlwYFvhx76FaqIBCUSZZfXaugLAn6JfcWDrnm7n6wkmXygq9UwkA1YehFwu/+aRRAxsBXChhnYjnR5hD3Wt+TflCJxw8JVPtfDjCTLFFs1XpTHh0n/IhEOJFaDXOqPu2C3hEpGoFsJhMr2H3bdAsL2aEP/ycTt47Gw4SLsEnkrU6lRDniW2iOgDto+zvYi3hKVHyLr3B7V/pp9kJSNnjmFE7ENbWZbWesofdI0in3+bHZNXizmvcahDPHgDL3hMbpRRvDUGzlXlDH9Q4DdIEuVWNSop18moHBcWh0oAa/fPuvY6zotwjF/K7alrMf+X4T/xtzeYCE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:BN4PR07MB2243; BCL:0; PCL:0; RULEID:; SRVR:BN4PR07MB2243; X-Microsoft-Exchange-Diagnostics: 1; BN4PR07MB2243; 4:L3Al1tVWL8lLtObDpFSxA5zSd1FfEAPl7iF7OfzlcYxZ793spbAxbpiUJlcBRZohSW07GGQFZbkDewvV62cChDz7CGB5AvBHNfKJYZoEjopHDaEywGWp8yzOstelIUvesKHcFORzB0qjbNNt/WB1dm7lhtO1E0IvLeB1SNAHesFIBJIiIIbVLRPwQldb3zDVLd/gnru1JKBKqZsX6IK60GxA8dy5Cs+I+7/cSwXigw3mRq9gcNdG7vc00R1dC+rXeyhWrnZkQ8RkSwfDLGzceQeoIyXNhtEgOVYsLnEeRpTd/B/L0vKN0SBKdp1oPvjTf6kk/co190P4J4b1oVgDLfNqZd1BM6gs373ndKIFdQ1EQPfoJeVYKY78CcJt38Ed X-Forefront-PRVS: 098076C36C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(199003)(189002)(81166006)(5003940100001)(8676002)(81156014)(7846002)(4001430100002)(105586002)(229853001)(68736007)(106356001)(7736002)(2950100001)(575784001)(50986999)(97736004)(36756003)(50226002)(107886002)(2906002)(47776003)(76176999)(77096005)(66066001)(33646002)(19580405001)(92566002)(50466002)(5001770100001)(586003)(48376002)(101416001)(4326007)(19580395003)(6116002)(76506005)(3846002)(42186005)(189998001)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN4PR07MB2243; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN4PR07MB2243; 23:wDSbShQ0y5olD7rDieH+NXywvH3+1qyOStIAVIWW7?= =?us-ascii?Q?adE0PNLdIIkNHYNxapxrioEoEB6L4w2XLSUNKHNABYKFjxdM9WF1exyKiDyo?= =?us-ascii?Q?n/sIZBtfTduz/6wz3689GZpRq76Cn72Eg7dRrLJLiQXqjSMPZzSDqm29pm9r?= =?us-ascii?Q?5twtTNPV1YfSpzI6gwzprIXLz+mUzbN6tP9WmQXi+EbRwBv4wEQY86tGiqf4?= =?us-ascii?Q?gNTsaMVzsrTgkrimuE09QYM865khqcWwoziz+qNZy6vG33GOQ9qXUTDe8eQh?= =?us-ascii?Q?sOBBYWJjehMuH95Nnx+cQYZihY0DUPbUflMSwL+6Se+ejR8YgBGZJPjZxdQ+?= =?us-ascii?Q?ORkYGFGY6FWw8tP9Zm18bnPYzh/J5u0UBW0nV+C8k/kUpv+LKjFVQt2PR0jz?= =?us-ascii?Q?z0gN32QcL6jIRSaZjcmMsCa9l5gJHNUbfEMUfn28xTjxSXSIY9X+3FiIK/82?= =?us-ascii?Q?ah4T0N9sCUdy+7noTBucB6er6NOi2z4lukQnkYqNfDFrSiljKFOEzdrlLchg?= =?us-ascii?Q?0QbUYOQb9LmHUkRRTmfr1ckkOXa9GtZ1J5b80WbMELbuukDdizaEmtRoa10y?= =?us-ascii?Q?BE30VFwYYDo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yyk50Eb5dkb+KVh6N09+ePT8OLY1TkeIWYAWCLdzUij4paBOiGhPw/plRpA2re6tQ6HJwf16cBjNUHF7WlJILjgqUBQKx6/iTWvl5tWQg==; 24:p+5x6O9O5Qzead+utu9ZDkDVrCPrMw8j9+Iw7kQgRO73L4NW4BM2RbXMNGb78pisj/GywYv5WDxsd3Rt7bgRsJpf4q9+lxN6yTKjPPjzmlA=; 7:k8VlEIlHhUmW7EsR9QVBa5SYxKA8dmLBQZB829TlqV93MqV9ATTPgcthM1ulDOvc/+PYeZAlNp9W4UqJUpWdmsj/sHFnVRkz4d7/K2FBb9m02cX7f2IXk5bWVZyNSHoUd1EfjCjE+n4VjD6B3mNO4vjacMdia3vkwFnt4Do4dAo0mLgCGh6pH8OUQnziFaodEgRIpE8sdojt+pFGEnpdwTGs2iwQJmV/08zvTZ4VWNm4RW1q17jbSUO9hZvB9EHF SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2016 05:10:38.5345 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN4PR07MB2243 From: Andrew Pinski This patch adds support to ldconfig for libilp32 which is used by ILP32. * sysdeps/generic/ldconfig.h (FLAG_AARCH64_LIB32): New define. * elf/cache.c (print_entry): Handle FLAG_AARCH64_LIB32. * sysdeps/unix/sysv/linux/aarch64/dl-cache.h (_DL_CACHE_DEFAULT_ID): Define it to be the FLAG_AARCH64_LIB32 if compiling for ILP32. (add_system_dir): Add libilp32 to the list of system directories. * sysdeps/unix/sysv/linux/arm/readelflib.c (process_elf_file): Handle ILP32 elf binaries. Signed-off-by: Yury Norov --- elf/cache.c | 2 ++ sysdeps/generic/ldconfig.h | 1 + sysdeps/unix/sysv/linux/aarch64/dl-cache.h | 13 ++++++++++++- sysdeps/unix/sysv/linux/arm/readelflib.c | 4 +++- 4 files changed, 18 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/elf/cache.c b/elf/cache.c index fbee172..cbc6162 100644 --- a/elf/cache.c +++ b/elf/cache.c @@ -101,6 +101,8 @@ print_entry (const char *lib, int flag, unsigned int osversion, case FLAG_AARCH64_LIB64: fputs (",AArch64", stdout); break; + case FLAG_AARCH64_LIB32: + fputs (",ILP32", stdout); /* Uses the ARM soft-float ABI. */ case FLAG_ARM_LIBSF: fputs (",soft-float", stdout); diff --git a/sysdeps/generic/ldconfig.h b/sysdeps/generic/ldconfig.h index 07600b7..8150227 100644 --- a/sysdeps/generic/ldconfig.h +++ b/sysdeps/generic/ldconfig.h @@ -42,6 +42,7 @@ #define FLAG_MIPS_LIB32_NAN2008 0x0c00 #define FLAG_MIPS64_LIBN32_NAN2008 0x0d00 #define FLAG_MIPS64_LIBN64_NAN2008 0x0e00 +#define FLAG_AARCH64_LIB32 0x0f00 /* Name of auxiliary cache. */ #define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache" diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-cache.h b/sysdeps/unix/sysv/linux/aarch64/dl-cache.h index 9c7b271..044fdba 100644 --- a/sysdeps/unix/sysv/linux/aarch64/dl-cache.h +++ b/sysdeps/unix/sysv/linux/aarch64/dl-cache.h @@ -18,7 +18,11 @@ #include +#ifdef __LP64__ #define _DL_CACHE_DEFAULT_ID (FLAG_AARCH64_LIB64 | FLAG_ELF_LIBC6) +#else +#define _DL_CACHE_DEFAULT_ID (FLAG_AARCH64_LIB32 | FLAG_ELF_LIBC6) +#endif #define _dl_cache_check_flags(flags) \ ((flags) == _DL_CACHE_DEFAULT_ID) @@ -27,18 +31,25 @@ do \ { \ size_t len = strlen (dir); \ - char path[len + 3]; \ + char path[len + 6]; \ memcpy (path, dir, len + 1); \ if (len >= 6 && ! memcmp (path + len - 6, "/lib64", 6)) \ { \ len -= 2; \ path[len] = '\0'; \ } \ + if (len >= 9 && ! memcmp (path + len - 9, "/libilp32", 9))\ + { \ + len -= 5; \ + path[len] = '\0'; \ + } \ add_dir (path); \ if (len >= 4 && ! memcmp (path + len - 4, "/lib", 4)) \ { \ memcpy (path + len, "64", 3); \ add_dir (path); \ + memcpy (path + len, "ilp32", 6); \ + add_dir (path); \ } \ } while (0) diff --git a/sysdeps/unix/sysv/linux/arm/readelflib.c b/sysdeps/unix/sysv/linux/arm/readelflib.c index e6ae72e..ddbad25 100644 --- a/sysdeps/unix/sysv/linux/arm/readelflib.c +++ b/sysdeps/unix/sysv/linux/arm/readelflib.c @@ -41,7 +41,9 @@ process_elf_file (const char *file_name, const char *lib, int *flag, ret = process_elf32_file (file_name, lib, flag, osversion, soname, file_contents, file_length); - if (!ret && EF_ARM_EABI_VERSION (elf32_header->e_flags) == EF_ARM_EABI_VER5) + if (!ret && elf_header->e_machine == EM_AARCH64) + *flag = FLAG_AARCH64_LIB32|FLAG_ELF_LIBC6; + else if (!ret && EF_ARM_EABI_VERSION (elf32_header->e_flags) == EF_ARM_EABI_VER5) { if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_HARD) *flag = FLAG_ARM_LIBHF|FLAG_ELF_LIBC6;