summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-06-02 07:32:19 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-06-02 07:34:24 +0200
commitc44838ebf8b8da0795d56e05b477c5d2b37b4a19 (patch)
treec1dc4f38603b4b09748ae2bf334022109279c234 /scripts
parentd32ee64df750c2a1ebfffaccc1c02251a73d0532 (diff)
downloadglibc-c44838ebf8b8da0795d56e05b477c5d2b37b4a19.tar.gz
glibc-c44838ebf8b8da0795d56e05b477c5d2b37b4a19.tar.xz
glibc-c44838ebf8b8da0795d56e05b477c5d2b37b4a19.zip
Add libc ABI extension kludge for baseline-violating libdl symbols
Some targets have a GLIBC_2.0 baseline for libdl, while using
GLIBC_2.2 for libc.  This means that the generated libc.map file
does not have any version nodes for GLIBC_2.0 or GLIBC_2.1.  However,
moving symbols from libdl into libc needs such version nodes.
(Future symbol moves from librt will need this as well.)

This kludge is only necessary for symbols predating GLIBC_2.2 because
the affected targets use GLIBC_2.2 as the baseline for libc.  Given
the small number and fixed set of affected architectures, no generic
mechanism is implemented, and instead the map file fragment is
hard-coded in scripts/versions.mk.

The compat_symbol macro already emits the appropriate version strings,
so no adjustments are needed there.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/versions.awk26
1 files changed, 25 insertions, 1 deletions
diff --git a/scripts/versions.awk b/scripts/versions.awk
index a7154480e3..565233e529 100644
--- a/scripts/versions.awk
+++ b/scripts/versions.awk
@@ -93,6 +93,26 @@ function ord(c) {
   printf("%s %s %s\n", actlib, sortver, $0) | sort;
 }
 
+# Some targets do not set the ABI baseline for libdl.  As a result,
+# symbols originally in libdl need to be moved under historic symbol
+# versions, without altering the baseline version for libc itself.
+/^ *!libc_pre_versions/ {
+    libc_pre_versions_active = 1;
+}
+
+function libc_pre_versions() {
+    # No local: * here, so that we do not have to update this script
+    # if symbols are moved into libc.  The abilist files and the other
+    # targets (with a real GLIBC_2.0 baseline) provide testing
+    # coverage.
+    printf("\
+GLIBC_2.0 {\n\
+};\n\
+GLIBC_2.1 {\n\
+} GLIBC_2.0;\n\
+") > outfile;
+    return "GLIBC_2.1";
+}
 
 function closeversion(name, oldname) {
   printf("  local:\n    *;\n") > outfile;
@@ -154,7 +174,11 @@ END {
       oldlib = $1;
       real_outfile = buildroot oldlib ".map";
       outfile = real_outfile "T";
-      veryoldver = "";
+      if ($1 == "libc" && libc_pre_versions_active) {
+	  veryoldver = libc_pre_versions();
+      } else {
+	  veryoldver = "";
+      }
       printf(" %s.map", oldlib);
     }
     if ($2 != oldver) {