[PATCH] Add GLIBC_PRIVATE_RELR as proxy for DT_RELR

H.J. Lu hjl.tools@gmail.com
Fri Nov 19 15:26:55 GMT 2021


Executables with DT_RELR will crash mysteriously with glibc binaries
without DT_RELR support.  Bump EI_ABIVERSION won't prevent crash since
the Linux kernel loader doesn't check EI_ABIVERSION on executables.
Adding a glibc version dependency on the first glibc version with
DT_RELR support will prevent backporting DT_RELR support to released
glibc branches.

Add a GLIBC_PRIVATE_RELR version as a proxy for DT_RELR support in glibc.
Linker should add the GLIBC_PRIVATE_RELR version dependency on binaries
with DT_RELR.  GLIBC_PRIVATE_RELR should be backported together when
backporting DT_RELR support.
---
 io/Versions         | 4 +++-
 scripts/abilist.awk | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/io/Versions b/io/Versions
index 4e19540885..629d458324 100644
--- a/io/Versions
+++ b/io/Versions
@@ -141,7 +141,6 @@ libc {
     closefrom;
   }
   GLIBC_PRIVATE {
-    __libc_fcntl64;
     __fcntl_nocancel;
     __open64_nocancel;
     __write_nocancel;
@@ -151,4 +150,7 @@ libc {
     __file_change_detection_for_fp;
     __fstat64;
   }
+  GLIBC_PRIVATE_RELR {
+    __libc_fcntl64;
+  }
 }
diff --git a/scripts/abilist.awk b/scripts/abilist.awk
index 24a34ccbed..620aacb627 100644
--- a/scripts/abilist.awk
+++ b/scripts/abilist.awk
@@ -55,7 +55,7 @@ $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
   # caused STV_HIDDEN symbols to appear in .dynsym, though that is useless.
   if (NF > 7 && $7 == ".hidden") next;
 
-  if (version == "GLIBC_PRIVATE" && !include_private) next;
+  if (version ~ /^GLIBC_PRIVATE/ && !include_private) next;
 
   desc = "";
   if (type == "D" && ($4 == ".tbss" || $4 == ".tdata")) {
-- 
2.33.1



More information about the Libc-alpha mailing list