diff mbox

i386: Do not set internal_function

Message ID 20170814113616.3D29C401ADB67@oldenburg.str.redhat.com
State New
Headers show

Commit Message

Florian Weimer Aug. 14, 2017, 11:36 a.m. UTC
All calls to functions with the internal_function attribute
have been removed from assembler implementations, which means that
the definition of internal_function can be changed at the C level
without causing ABI issues with assembler code.

_dl_fixup still uses a regparm calling convention on i386, but this
is controlled through ARCH_FIXUP_ATTRIBUTE, not internal_function.

2017-08-14  Florian Weimer  <fweimer@redhat.com>

	i386: Do not set internal_function.
	* config.h.in (USE_REGPARMS, internal_function): Remove.
	* sysdeps/i386/configure.ac (USE_REGPARMS): Likewise.
	* sysdeps/i386/configure (USE_REGPARMS): Likewise.

Comments

H.J. Lu Aug. 14, 2017, 12:32 p.m. UTC | #1
On Mon, Aug 14, 2017 at 4:36 AM, Florian Weimer <fweimer@redhat.com> wrote:
> All calls to functions with the internal_function attribute
> have been removed from assembler implementations, which means that
> the definition of internal_function can be changed at the C level
> without causing ABI issues with assembler code.
>
> _dl_fixup still uses a regparm calling convention on i386, but this
> is controlled through ARCH_FIXUP_ATTRIBUTE, not internal_function.
>
> 2017-08-14  Florian Weimer  <fweimer@redhat.com>
>
>         i386: Do not set internal_function.
>         * config.h.in (USE_REGPARMS, internal_function): Remove.
>         * sysdeps/i386/configure.ac (USE_REGPARMS): Likewise.
>         * sysdeps/i386/configure (USE_REGPARMS): Likewise.
>

Does include/libc-symbols.h still define internal_function?
Florian Weimer Aug. 14, 2017, 12:35 p.m. UTC | #2
On 08/14/2017 02:32 PM, H.J. Lu wrote:
> On Mon, Aug 14, 2017 at 4:36 AM, Florian Weimer <fweimer@redhat.com> wrote:
>> All calls to functions with the internal_function attribute
>> have been removed from assembler implementations, which means that
>> the definition of internal_function can be changed at the C level
>> without causing ABI issues with assembler code.
>>
>> _dl_fixup still uses a regparm calling convention on i386, but this
>> is controlled through ARCH_FIXUP_ATTRIBUTE, not internal_function.
>>
>> 2017-08-14  Florian Weimer  <fweimer@redhat.com>
>>
>>         i386: Do not set internal_function.
>>         * config.h.in (USE_REGPARMS, internal_function): Remove.
>>         * sysdeps/i386/configure.ac (USE_REGPARMS): Likewise.
>>         * sysdeps/i386/configure (USE_REGPARMS): Likewise.
>>
> 
> Does include/libc-symbols.h still define internal_function?

Yes, the macro generic definition is still present, but it expands to
nothing.

Completely removing internal_function is a separate cleanup.  I would
like to tackle this on a per-subdirectory basis once this change is in.

Thanks,
Florian
H.J. Lu Aug. 14, 2017, 12:44 p.m. UTC | #3
On Mon, Aug 14, 2017 at 5:35 AM, Florian Weimer <fweimer@redhat.com> wrote:
> On 08/14/2017 02:32 PM, H.J. Lu wrote:
>> On Mon, Aug 14, 2017 at 4:36 AM, Florian Weimer <fweimer@redhat.com> wrote:
>>> All calls to functions with the internal_function attribute
>>> have been removed from assembler implementations, which means that
>>> the definition of internal_function can be changed at the C level
>>> without causing ABI issues with assembler code.
>>>
>>> _dl_fixup still uses a regparm calling convention on i386, but this
>>> is controlled through ARCH_FIXUP_ATTRIBUTE, not internal_function.
>>>
>>> 2017-08-14  Florian Weimer  <fweimer@redhat.com>
>>>
>>>         i386: Do not set internal_function.
>>>         * config.h.in (USE_REGPARMS, internal_function): Remove.
>>>         * sysdeps/i386/configure.ac (USE_REGPARMS): Likewise.
>>>         * sysdeps/i386/configure (USE_REGPARMS): Likewise.
>>>
>>
>> Does include/libc-symbols.h still define internal_function?
>
> Yes, the macro generic definition is still present, but it expands to
> nothing.
>
> Completely removing internal_function is a separate cleanup.  I would
> like to tackle this on a per-subdirectory basis once this change is in.
>

The patch looks good to me after all i386 changes have been checked
in.

Thanks.
diff mbox

Patch

diff --git a/config.h.in b/config.h.in
index 22418576a0..014fb4ea0e 100644
--- a/config.h.in
+++ b/config.h.in
@@ -47,10 +47,6 @@ 
 #undef	STACK_PROTECTOR_LEVEL
 #endif
 
-/* Define if the regparm attribute shall be used for local functions
-   (gcc on ix86 only).  */
-#undef	USE_REGPARMS
-
 /* Defined on SPARC if GCC emits GOTDATA relocations.  */
 #undef  HAVE_GCC_GOTDATA
 
@@ -100,12 +96,6 @@ 
 #undef HAVE_AARCH64_BE
 
 
-/* Defined to some form of __attribute__ ((...)) if the compiler supports
-   a different, more efficient calling convention.  */
-#if defined USE_REGPARMS && !defined PROF
-# define internal_function __attribute__ ((regparm (3), stdcall))
-#endif
-
 /* Linux specific: minimum supported kernel version.  */
 #undef	__LINUX_KERNEL_VERSION
 
diff --git a/sysdeps/i386/configure b/sysdeps/i386/configure
index 5b55c5affe..4d6685f7c2 100644
--- a/sysdeps/i386/configure
+++ b/sysdeps/i386/configure
@@ -77,8 +77,5 @@  if test $libc_cv_asm_mpx = yes; then
 
 fi
 
-$as_echo "#define USE_REGPARMS 1" >>confdefs.h
-
-
 $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
 
diff --git a/sysdeps/i386/configure.ac b/sysdeps/i386/configure.ac
index 19ef33f34a..f7766ad2b8 100644
--- a/sysdeps/i386/configure.ac
+++ b/sysdeps/i386/configure.ac
@@ -45,8 +45,6 @@  if test $libc_cv_asm_mpx = yes; then
   AC_DEFINE(HAVE_MPX_SUPPORT)
 fi
 
-AC_DEFINE(USE_REGPARMS)
-
 dnl It is always possible to access static and hidden symbols in an
 dnl position independent way.
 AC_DEFINE(PI_STATIC_AND_HIDDEN)