public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Compat symbols in abilist files
@ 2017-04-13 13:09 Florian Weimer
  2017-04-13 13:16 ` Andreas Schwab
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Florian Weimer @ 2017-04-13 13:09 UTC (permalink / raw)
  To: GNU C Library

[-- Attachment #1: Type: text/plain, Size: 377 bytes --]

I've come up with the attached patch to mark compat symbols as such in 
the abilist files.

Do we want to do this?  The downside is that when building glibc in 
certain non-standard configurations, some symbols are not compat symbols 
anymore (the prime example is probably --enable-obsolete-rpc).  On the 
other hand, the additional verification is valuable.

Thanks,
Florian

[-- Attachment #2: compat.patch --]
[-- Type: text/x-patch, Size: 954 bytes --]

ABI checks: Mark compat symbols with "<compat>"

2017-04-13  Florian Weimer  <fweimer@redhat.com>

	* scripts/abilist.awk: Mark compat symbols with "<compat>."

diff --git a/scripts/abilist.awk b/scripts/abilist.awk
index bd740d4..cb17373 100644
--- a/scripts/abilist.awk
+++ b/scripts/abilist.awk
@@ -46,7 +46,10 @@ $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
   size = " 0x" size;
   version = $6;
   symbol = $NF;
-  gsub(/[()]/, "", version);
+  weak = version ~ /^\(.*\)$/;
+  if (weak) {
+    gsub(/[()]/, "", version);
+  }
 
   # binutils versions up through at least 2.23 have some bugs that
   # caused STV_HIDDEN symbols to appear in .dynsym, though that is useless.
@@ -102,6 +105,10 @@ $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
   if (desc == "")
     desc = symbol " " type size;
 
+  if (weak) {
+    desc = desc " <compat>";
+  }
+
   if (combine)
     version = soname " " version (combine_fullname ? " " sofullname : "");
 

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Compat symbols in abilist files
@ 2021-03-17 20:59 Florian Weimer
  2021-03-17 21:21 ` Joseph Myers
  0 siblings, 1 reply; 11+ messages in thread
From: Florian Weimer @ 2021-03-17 20:59 UTC (permalink / raw)
  To: libc-alpha; +Cc: Joseph Myers

I'd like to re-raise the matter of comapt symbol markers in abilist
files.

--enable-obsolete-rpc (which changed compat symbol status) is gone,
which should simplify matters.

Joseph, you objected to this in the past.  While reviewing libpthread
symbol moves, I noticed that when going from

  libc:  pread@@GLIBC_2.1   libpthread: pread@@GLIBC_2.2

to

  libc:  pread@GLIBC_2.1 pread@@GLIBC_2.2

we would actually have to switch to 

  libc:  pread@GLIBC_2.1 pread@GLIBC_2.2 pread@@GLIBC_2.34

because a newly linked binary would produce a pread@@GLIBC_2.2 reference
without linking to libpthread, which could result in a lazy binding
failure at run time.  If we swap around the roles of compat symbols,
like this

  libc:  pread@@GLIBC_2.1 pread@GLIBC_2.2

the new symbol version is not necessary.

Unfortunately this is currently not visible at all in the abilist files.
The versioned_symbol/compat_symbol constructs are also quite hard to
review.  So I'm worried that we don't get the link-time ABI we want on
all targets.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-03-18 20:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-13 13:09 Compat symbols in abilist files Florian Weimer
2017-04-13 13:16 ` Andreas Schwab
2017-04-13 13:20   ` Florian Weimer
2017-04-18 22:18 ` Joseph Myers
2017-04-19  2:10   ` Carlos O'Donell
2017-04-19  9:46     ` Joseph Myers
2017-04-19  2:06 ` Carlos O'Donell
2017-04-19  7:00   ` Florian Weimer
2021-03-17 20:59 Florian Weimer
2021-03-17 21:21 ` Joseph Myers
2021-03-18 20:25   ` Florian Weimer

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).