public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] misc: Turn sstk into a compat symbol
@ 2020-04-27 10:21 Florian Weimer
  2020-04-27 10:38 ` Andreas Schwab
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Florian Weimer @ 2020-04-27 10:21 UTC (permalink / raw)
  To: libc-alpha

It is not implemented anywhere.  There is an osf_sstk system call on
alpha, but it is not used to implement sstk, and the system call
is not implemented on Linux, either.

-----
 misc/sstk.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/misc/sstk.c b/misc/sstk.c
index ad2010b5dd..0a2a967917 100644
--- a/misc/sstk.c
+++ b/misc/sstk.c
@@ -16,17 +16,14 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include <errno.h>
+#include <shlib-compat.h>
 
-/* Increase the size of the stack by INCREMENT,
-   and return the address of the bottom of the stack.  */
-
-void *sstk (int increment) __THROW;
-
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_32)
 void *
 sstk (int increment)
 {
   __set_errno (ENOSYS);
   return (void *) -1;
 }
-
-stub_warning (sstk)
+compat_symbol (libc, sstk, sstk, GLIBC_2_0);
+#endif

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

* Re: [PATCH] misc: Turn sstk into a compat symbol
  2020-04-27 10:21 [PATCH] misc: Turn sstk into a compat symbol Florian Weimer
@ 2020-04-27 10:38 ` Andreas Schwab
  2020-04-27 12:38 ` Zack Weinberg
  2020-04-27 20:31 ` Joseph Myers
  2 siblings, 0 replies; 8+ messages in thread
From: Andreas Schwab @ 2020-04-27 10:38 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

On Apr 27 2020, Florian Weimer wrote:

> It is not implemented anywhere.  There is an osf_sstk system call on
> alpha, but it is not used to implement sstk, and the system call
> is not implemented on Linux, either.

Ok.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

* Re: [PATCH] misc: Turn sstk into a compat symbol
  2020-04-27 10:21 [PATCH] misc: Turn sstk into a compat symbol Florian Weimer
  2020-04-27 10:38 ` Andreas Schwab
@ 2020-04-27 12:38 ` Zack Weinberg
  2020-04-27 12:52   ` Florian Weimer
  2020-04-27 20:31 ` Joseph Myers
  2 siblings, 1 reply; 8+ messages in thread
From: Zack Weinberg @ 2020-04-27 12:38 UTC (permalink / raw)
  To: Florian Weimer; +Cc: GNU C Library

On Mon, Apr 27, 2020 at 7:01 AM Florian Weimer <fw@deneb.enyo.de> wrote:
>
> It is not implemented anywhere.  There is an osf_sstk system call on
> alpha, but it is not used to implement sstk, and the system call
> is not implemented on Linux, either.

Maybe you should also remove the entry for sstk from sysdeps/unix/syscalls.list?

zw

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

* Re: [PATCH] misc: Turn sstk into a compat symbol
  2020-04-27 12:38 ` Zack Weinberg
@ 2020-04-27 12:52   ` Florian Weimer
  0 siblings, 0 replies; 8+ messages in thread
From: Florian Weimer @ 2020-04-27 12:52 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: GNU C Library

* Zack Weinberg:

> On Mon, Apr 27, 2020 at 7:01 AM Florian Weimer <fw@deneb.enyo.de> wrote:
>>
>> It is not implemented anywhere.  There is an osf_sstk system call on
>> alpha, but it is not used to implement sstk, and the system call
>> is not implemented on Linux, either.
>
> Maybe you should also remove the entry for sstk from
> sysdeps/unix/syscalls.list?

Indeed, and I also forgot to add attribute_compat_text_section.

8<------------------------------------------------------------------8<
Subject: misc: Remove sstk from the autogenerated system call list
    
This change should not have an effect because the system call was
never defined.  Also add the misssing attribute_compat_text_section
attribute to the sstk function (a minor optimization).

Fixes commit 9cc93ba0973ad04ee26c515a1552afb85e73c6ba
("misc: Turn sstk into a compat symbol").

diff --git a/misc/sstk.c b/misc/sstk.c
index 0a2a967917..dda6f7b426 100644
--- a/misc/sstk.c
+++ b/misc/sstk.c
@@ -19,7 +19,7 @@
 #include <shlib-compat.h>
 
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_32)
-void *
+void * attribute_compat_text_section
 sstk (int increment)
 {
   __set_errno (ENOSYS);
diff --git a/sysdeps/unix/syscalls.list b/sysdeps/unix/syscalls.list
index 01c4a0e6b1..e8f8718b04 100644
--- a/sysdeps/unix/syscalls.list
+++ b/sysdeps/unix/syscalls.list
@@ -78,7 +78,6 @@ sigaction	-	sigaction	i:ipp	__sigaction	sigaction
 sigsuspend	-	sigsuspend	Ci:p	sigsuspend
 socket		-	socket		i:iii	__socket	socket
 socketpair	-	socketpair	i:iiif	socketpair
-sstk		-	sstk		b:i	sstk
 statfs		-	statfs		i:sp	__statfs	statfs
 swapoff		-	swapoff		i:s	swapoff
 swapon		-	swapon		i:s	swapon

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

* Re: [PATCH] misc: Turn sstk into a compat symbol
  2020-04-27 10:21 [PATCH] misc: Turn sstk into a compat symbol Florian Weimer
  2020-04-27 10:38 ` Andreas Schwab
  2020-04-27 12:38 ` Zack Weinberg
@ 2020-04-27 20:31 ` Joseph Myers
  2020-04-28 10:11   ` Florian Weimer
  2 siblings, 1 reply; 8+ messages in thread
From: Joseph Myers @ 2020-04-27 20:31 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

In general making something (in the user namespace, not necessarily in the 
case of a symbol starting _) into a compat symbol should get an entry in 
NEWS under "Deprecated and removed features, and other changes affecting 
compatibility:".  We've done this even for functions that could not 
actually work at runtime (e.g. the wrappers for various obsolete Linux 
kernel syscalls removed from the kernel before the oldest kernel version 
supported by glibc at the time of making the symbols into compat symbols).

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH] misc: Turn sstk into a compat symbol
  2020-04-27 20:31 ` Joseph Myers
@ 2020-04-28 10:11   ` Florian Weimer
  2020-04-28 10:35     ` Florian Weimer
  0 siblings, 1 reply; 8+ messages in thread
From: Florian Weimer @ 2020-04-28 10:11 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

* Joseph Myers:

> In general making something (in the user namespace, not necessarily in the 
> case of a symbol starting _) into a compat symbol should get an entry in 
> NEWS under "Deprecated and removed features, and other changes affecting 
> compatibility:".  We've done this even for functions that could not 
> actually work at runtime (e.g. the wrappers for various obsolete Linux 
> kernel syscalls removed from the kernel before the oldest kernel version 
> supported by glibc at the time of making the symbols into compat symbols).

Thanks.  Like this?

8<------------------------------------------------------------------8<
Subject: misc: Remove sstk from the autogenerated system call list

This change should not have an effect because the system call was
never defined.  Also add the misssing attribute_compat_text_section
attribute to the sstk function (a minor optimization).  Also update the
NEWS file to document the change.

Fixes commit 9cc93ba0973ad04ee26c515a1552afb85e73c6ba
("misc: Turn sstk into a compat symbol").

-----
 NEWS                       | 4 ++++
 misc/sstk.c                | 2 +-
 sysdeps/unix/syscalls.list | 1 -
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 0e627b3405..834de03bda 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,10 @@ Deprecated and removed features, and other changes affecting compatibility:
   but always fails with ENOSYS.  This reflects the removal of the system
   call from all architectures, starting with Linux 5.5.
 
+* The sstk function is no longer available to newly linked binaries.
+  Its implementation always returned an array, and the function was not
+  declared in any header file.
+
 Changes to build and runtime requirements:
 
   [Add changes to build and runtime requirements here]
diff --git a/misc/sstk.c b/misc/sstk.c
index 0a2a967917..dda6f7b426 100644
--- a/misc/sstk.c
+++ b/misc/sstk.c
@@ -19,7 +19,7 @@
 #include <shlib-compat.h>
 
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_32)
-void *
+void * attribute_compat_text_section
 sstk (int increment)
 {
   __set_errno (ENOSYS);
diff --git a/sysdeps/unix/syscalls.list b/sysdeps/unix/syscalls.list
index 01c4a0e6b1..e8f8718b04 100644
--- a/sysdeps/unix/syscalls.list
+++ b/sysdeps/unix/syscalls.list
@@ -78,7 +78,6 @@ sigaction	-	sigaction	i:ipp	__sigaction	sigaction
 sigsuspend	-	sigsuspend	Ci:p	sigsuspend
 socket		-	socket		i:iii	__socket	socket
 socketpair	-	socketpair	i:iiif	socketpair
-sstk		-	sstk		b:i	sstk
 statfs		-	statfs		i:sp	__statfs	statfs
 swapoff		-	swapoff		i:s	swapoff
 swapon		-	swapon		i:s	swapon

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

* Re: [PATCH] misc: Turn sstk into a compat symbol
  2020-04-28 10:11   ` Florian Weimer
@ 2020-04-28 10:35     ` Florian Weimer
  2020-04-28 14:57       ` Joseph Myers
  0 siblings, 1 reply; 8+ messages in thread
From: Florian Weimer @ 2020-04-28 10:35 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

* Florian Weimer:

> * Joseph Myers:
>
>> In general making something (in the user namespace, not necessarily in the 
>> case of a symbol starting _) into a compat symbol should get an entry in 
>> NEWS under "Deprecated and removed features, and other changes affecting 
>> compatibility:".  We've done this even for functions that could not 
>> actually work at runtime (e.g. the wrappers for various obsolete Linux 
>> kernel syscalls removed from the kernel before the oldest kernel version 
>> supported by glibc at the time of making the symbols into compat symbols).
>
> Thanks.  Like this?

Now with the weird typo fixed (sorry).

8<------------------------------------------------------------------8<
This change should not have an effect because the system call was
never defined.  Also add the misssing attribute_compat_text_section
attribute to the sstk function (a minor optimization).  Also update the
NEWS file to document the change.

Fixes commit 9cc93ba0973ad04ee26c515a1552afb85e73c6ba
("misc: Turn sstk into a compat symbol").

-----
 NEWS                       | 4 ++++
 misc/sstk.c                | 2 +-
 sysdeps/unix/syscalls.list | 1 -
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 0e627b3405..f58436c91a 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,10 @@ Deprecated and removed features, and other changes affecting compatibility:
   but always fails with ENOSYS.  This reflects the removal of the system
   call from all architectures, starting with Linux 5.5.
 
+* The sstk function is no longer available to newly linked binaries.
+  Its implementation always returned with a failure, and the function
+  was not declared in any header file.
+
 Changes to build and runtime requirements:
 
   [Add changes to build and runtime requirements here]
diff --git a/misc/sstk.c b/misc/sstk.c
index 0a2a967917..dda6f7b426 100644
--- a/misc/sstk.c
+++ b/misc/sstk.c
@@ -19,7 +19,7 @@
 #include <shlib-compat.h>
 
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_32)
-void *
+void * attribute_compat_text_section
 sstk (int increment)
 {
   __set_errno (ENOSYS);
diff --git a/sysdeps/unix/syscalls.list b/sysdeps/unix/syscalls.list
index 01c4a0e6b1..e8f8718b04 100644
--- a/sysdeps/unix/syscalls.list
+++ b/sysdeps/unix/syscalls.list
@@ -78,7 +78,6 @@ sigaction	-	sigaction	i:ipp	__sigaction	sigaction
 sigsuspend	-	sigsuspend	Ci:p	sigsuspend
 socket		-	socket		i:iii	__socket	socket
 socketpair	-	socketpair	i:iiif	socketpair
-sstk		-	sstk		b:i	sstk
 statfs		-	statfs		i:sp	__statfs	statfs
 swapoff		-	swapoff		i:s	swapoff
 swapon		-	swapon		i:s	swapon

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

* Re: [PATCH] misc: Turn sstk into a compat symbol
  2020-04-28 10:35     ` Florian Weimer
@ 2020-04-28 14:57       ` Joseph Myers
  0 siblings, 0 replies; 8+ messages in thread
From: Joseph Myers @ 2020-04-28 14:57 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

On Tue, 28 Apr 2020, Florian Weimer wrote:

> Now with the weird typo fixed (sorry).
> 
> 8<------------------------------------------------------------------8<
> This change should not have an effect because the system call was
> never defined.  Also add the misssing attribute_compat_text_section
> attribute to the sstk function (a minor optimization).  Also update the
> NEWS file to document the change.
> 
> Fixes commit 9cc93ba0973ad04ee26c515a1552afb85e73c6ba
> ("misc: Turn sstk into a compat symbol").

This version is OK.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

end of thread, other threads:[~2020-04-28 14:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-27 10:21 [PATCH] misc: Turn sstk into a compat symbol Florian Weimer
2020-04-27 10:38 ` Andreas Schwab
2020-04-27 12:38 ` Zack Weinberg
2020-04-27 12:52   ` Florian Weimer
2020-04-27 20:31 ` Joseph Myers
2020-04-28 10:11   ` Florian Weimer
2020-04-28 10:35     ` Florian Weimer
2020-04-28 14:57       ` Joseph Myers

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