about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/Makefile16
-rw-r--r--elf/elf.h6
-rw-r--r--elf/libc-dl-profstub.c6
3 files changed, 23 insertions, 5 deletions
diff --git a/elf/Makefile b/elf/Makefile
index 280e777c19..57b3a19d36 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -1033,9 +1033,19 @@ test-xfail-tst-protected1b = yes
 endif
 ifeq (yesyes,$(have-fpie)$(build-shared))
 modules-names += tst-piemod1
-tests += tst-pie1 tst-pie2 tst-dlopen-pie tst-dlopen-tlsmodid-pie \
-  tst-dlopen-self-pie
-tests-pie += tst-pie1 tst-pie2 tst-dlopen-tlsmodid-pie tst-dlopen-self-pie
+tests += \
+  tst-dlopen-pie \
+  tst-dlopen-self-pie \
+  tst-dlopen-tlsmodid-pie \
+  tst-pie1 \
+  tst-pie2 \
+  # tests
+tests-pie += \
+  tst-dlopen-self-pie \
+  tst-dlopen-tlsmodid-pie \
+  tst-pie1 \
+  tst-pie2 \
+  # tests-pie
 ifeq (yes,$(have-protected-data))
 tests += vismain
 tests-pie += vismain
diff --git a/elf/elf.h b/elf/elf.h
index 682bce5a94..081742a9c3 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -1337,9 +1337,13 @@ typedef struct
 #define NT_GNU_PROPERTY_TYPE_0 5
 
 /* Packaging metadata as defined on
-   https://systemd.io/COREDUMP_PACKAGE_METADATA/ */
+   https://systemd.io/ELF_PACKAGE_METADATA/ */
 #define NT_FDO_PACKAGING_METADATA 0xcafe1a7e
 
+/* dlopen metadata as defined on
+   https://systemd.io/ELF_DLOPEN_METADATA/ */
+#define NT_FDO_DLOPEN_METADATA 0x407c0c0a
+
 /* Note section name of program property.   */
 #define NOTE_GNU_PROPERTY_SECTION_NAME ".note.gnu.property"
 
diff --git a/elf/libc-dl-profstub.c b/elf/libc-dl-profstub.c
index 36a65f4616..dd12443f2c 100644
--- a/elf/libc-dl-profstub.c
+++ b/elf/libc-dl-profstub.c
@@ -19,17 +19,21 @@
 #include <dlfcn.h>
 #include <elf.h>
 #include <ldsodefs.h>
+#include <shlib-compat.h>
 
 /* This is the map for the shared object we profile.  It is defined here
    only because we test for this value being NULL or not.  */
 
-
+#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_40)
+attribute_compat_text_section
 void
 _dl_mcount_wrapper (void *selfpc)
 {
   GLRO(dl_mcount) ((ElfW(Addr)) RETURN_ADDRESS (0), (ElfW(Addr)) selfpc);
 }
 
+compat_symbol (libc, _dl_mcount_wrapper, _dl_mcount_wrapper, GLIBC_2_1);
+#endif
 
 void
 _dl_mcount_wrapper_check (void *selfpc)