From patchwork Wed Sep 11 21:04:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 1161279 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-105149-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="MTS8nvFM"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YcmBTrGe"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46TDvX04w4z9s00 for ; Thu, 12 Sep 2019 07:05:43 +1000 (AEST) 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:in-reply-to:references; q=dns; s=default; b=sE02xW6W wXEW/nmBC2M162N0VgrPsn9bM3YOvgKcj7WKGWMMzLo85I61hEf+4T59BNWGQIS/ UPa7GOBz1bl0UFHrobTfh+eVeRoz60ZjuFMOLT6Mq+8qxHxvP5eRimBrYHUAGYDS ZWCotwRVvD8TP5OEaGAvWzpDLSPssnFI5Oc= 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:in-reply-to:references; s=default; bh=peZRcLZqqBHfIX bTIeZ4M3ZAwxo=; b=MTS8nvFMlyJ+glOURjHJtKffXdE0oUZDqROB9k4H9y3AhK cj3H8+2BbpvOPAXNNs1Cm87fzuExikP7JpTDfY7SCk7nPbv8ky0RDakx3JcXi4Fd 16R9H8ikpaRBm5cksJj5LqmWfQXMevF1E1NCwzD9ral2FTk9I0d9pf8Gru8cg= Received: (qmail 94496 invoked by alias); 11 Sep 2019 21:05:13 -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 94331 invoked by uid 89); 11 Sep 2019 21:05:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=VERSION, HX-Languages-Length:2415 X-HELO: mail-pf1-f195.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=2vW6T2y0YFiEJII7Dz2MlyYB441a3nXq5/WJPOKgc1s=; b=YcmBTrGeUQa7TL233fLPgps3vsxkieb8bvofkLr5AFEDaB7Tv24W8U23zA0RksuHpE HMdIe9aT7xpHZGNv7tqbYWVOrKsrQG+Tm+Qq0PEjaTbhkb92sxz2GkI2s+qPT66l4Ib5 D6LLFQeTjPYNsIcF2FGe3HwWCrYyhsCKmZTHQl+3JDsa1lR/23obXogSzKYYtydJ97wc 6nMxUCQLfK+q6T7cMyptPjSSVPUgG7HGCNv3TMxTvNe8dB+RHQByoz+7Nw+plmg7Swh1 2LdBi9WnBpODys3tbLtr3D0MoMsBZ7VtYx7pspqQ06ZPLPNl1w6rZaFpXC+CRxcsEEIC px5g== From: Isaku Yamahata To: libc-alpha@sourceware.org Cc: isaku.yamahata@intel.com, Isaku Yamahata Subject: [RFC PATCH 03/11] elf: define note section for LibOS Date: Wed, 11 Sep 2019 14:04:01 -0700 Message-Id: In-Reply-To: References: In-Reply-To: References: Define note section for LibOS which describes glibc release/version and abi for LibOS. LibOS can easily check it when loading ld.so. Signed-off-by: Isaku Yamahata --- elf/Makefile | 3 ++- elf/Versions | 3 +++ elf/libos.c | 26 ++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 elf/libos.c diff --git a/elf/Makefile b/elf/Makefile index d470e41402..275105b0de 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -33,7 +33,8 @@ dl-routines = $(addprefix dl-,load lookup object reloc deps hwcaps \ runtime init fini debug misc \ version profile tls origin scope \ execstack open close trampoline \ - exception sort-maps) + exception sort-maps) \ + libos ifeq (yes,$(use-ldconfig)) dl-routines += dl-cache endif diff --git a/elf/Versions b/elf/Versions index 3b09901f6c..b9b4ae168a 100644 --- a/elf/Versions +++ b/elf/Versions @@ -78,5 +78,8 @@ ld { # Set value of a tunable. __tunable_get_val; + + # libos + __libos_release; __libos_version; __libos_abi; } } diff --git a/elf/libos.c b/elf/libos.c new file mode 100644 index 0000000000..8fe3df4944 --- /dev/null +++ b/elf/libos.c @@ -0,0 +1,26 @@ +/* Copyright (C) 2019 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include "../version.h" + +const char * __libos_release = RELEASE; +const char * __libos_version = VERSION; +const uint64_t __libos_abi = 0; +LIBOS_NOTES("versions", LIBOS_NOTE_VERSION, __libos_release, __WORDSIZE / 8, "release"); +LIBOS_NOTES("versions", LIBOS_NOTE_VERSION, __libos_version, __WORDSIZE / 8, "version"); +LIBOS_NOTES("versions", LIBOS_NOTE_VERSION, __libos_abi, 8, "abi");