From: Isaku Yamahata <isaku.yamahata@gmail.com>
To: libc-alpha@sourceware.org
Cc: isaku.yamahata@intel.com, Isaku Yamahata <isaku.yamahata@gmail.com>
Subject: [RFC PATCH 03/11] elf: define note section for LibOS
Date: Wed, 11 Sep 2019 14:04:01 -0700 [thread overview]
Message-ID: <dfd71718cf139bb3f3c4a55c55f0776207cbb2ea.1568219399.git.isaku.yamahata@gmail.com> (raw)
In-Reply-To: <cover.1568219399.git.isaku.yamahata@gmail.com>
In-Reply-To: <cover.1568219399.git.isaku.yamahata@gmail.com>
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 <isaku.yamahata@gmail.com>
---
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
+ <http://www.gnu.org/licenses/>. */
+
+#include <libos.h>
+#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");
--
2.17.1
next prev parent reply other threads:[~2019-09-11 21:05 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-11 21:03 [RFC PATCH 00/11] Library OS support Isaku Yamahata
2019-09-11 21:03 ` [RFC PATCH 01/11] x86-64, elf: make elf_machine_lazy_rel() ignore R_X86_64_NONE Isaku Yamahata
2019-09-11 21:04 ` [RFC PATCH 02/11] elf: add macro to define note section for LibOS Isaku Yamahata
2019-09-11 21:04 ` Isaku Yamahata [this message]
2019-09-11 21:04 ` [RFC PATCH 04/11] elf: add stub functions for LibOS support Isaku Yamahata
2019-09-11 21:04 ` [RFC PATCH 05/11] elf: add hook, __libos_map_library to dl-open.c Isaku Yamahata
2019-09-11 21:04 ` [RFC PATCH 06/11] elf/rtld: introduce runtime option to disable HP_TIMING_INLINE Isaku Yamahata
2019-09-11 21:04 ` [RFC PATCH 07/11] malloc: make arena size configurable on startup Isaku Yamahata
2019-09-12 1:03 ` DJ Delorie
2019-09-12 18:43 ` Isaku Yamahata
2019-09-11 21:04 ` [RFC PATCH 08/11] x86-64: replace syscall instruction with SYSCALL_INST macro Isaku Yamahata
2019-09-11 21:04 ` [RFC PATCH 09/11] x86-64: add nop instruction after syscall instrunction Isaku Yamahata
2019-09-11 21:04 ` [RFC PATCH 10/11] x86-64: make the number of nops after syscall configurable Isaku Yamahata
2019-09-11 21:04 ` [RFC PATCH 11/11] benchtests: simple benchmark to measure nop effects Isaku Yamahata
2019-09-11 21:35 ` Patrick McGehearty
2019-09-12 0:10 ` [RFC PATCH 00/11] Library OS support Joseph Myers
2019-09-12 1:13 ` Isaku Yamahata
2019-09-16 20:47 ` Joseph Myers
2019-09-17 17:46 ` Isaku Yamahata
2019-09-17 13:19 ` Adhemerval Zanella
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dfd71718cf139bb3f3c4a55c55f0776207cbb2ea.1568219399.git.isaku.yamahata@gmail.com \
--to=isaku.yamahata@gmail.com \
--cc=isaku.yamahata@intel.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).