public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: Remove unintended __longjmp export
@ 2016-11-22 16:43 Florian Weimer
  2016-11-27  6:45 ` Mike Frysinger
  2016-11-28 13:05 ` Tulio Magno Quites Machado Filho
  0 siblings, 2 replies; 5+ messages in thread
From: Florian Weimer @ 2016-11-22 16:43 UTC (permalink / raw)
  To: GNU C Library

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

Due to an accident, we export __longjmp under a public symbol version 
for the powerpc32/fpu configuration.

__longjmp is declared as hidden for internal use.  This means that any 
reference to this symbol (of which there aren't any right now in 
libc.so) will cause the symbol to turn unexported.  The reason is that 
the linker does not distinguish between hidden definitions and 
references.  GCC emits a .hidden directive in the __longjmp-referencing 
translation unit, and this kills the .symver-based export.

I propose the removal of the __longjmp export as the simplest fix. 
__longjmp is in the implementation namespace and is not used in a public 
header.  As a result, nothing out there should reference it.

If this is not acceptable, I'll come up with different approach to 
address this.  But I prefer to address this issue in this way.

Tested on a powerpc32/fpu configuration with no regressions.

Florian

[-- Attachment #2: ppc-longjmp.patch --]
[-- Type: text/x-patch, Size: 1658 bytes --]

powerpc: Remove unintended __longjmp symbol from ABI

2016-11-22  Florian Weimer  <fweimer@redhat.com>

	* sysdeps/powerpc/powerpc32/fpu/__longjmp.S (__longjmp): Remove
	version and turn into strong alias.  Remove compat symbol.

	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
	(__longjmp): Remove.

diff --git a/sysdeps/powerpc/powerpc32/fpu/__longjmp.S b/sysdeps/powerpc/powerpc32/fpu/__longjmp.S
index 529e095..c233b88 100644
--- a/sysdeps/powerpc/powerpc32/fpu/__longjmp.S
+++ b/sysdeps/powerpc/powerpc32/fpu/__longjmp.S
@@ -26,15 +26,13 @@
 # include "__longjmp-common.S"
 
 #else /* IS_IN (libc) */
-/* Build a versioned object for libc.  */
-versioned_symbol (libc, __vmx__longjmp, __longjmp, GLIBC_2_3_4);
+strong_alias (__vmx__longjmp, __longjmp)
 # define __longjmp_symbol  __vmx__longjmp
 # include "__longjmp-common.S"
 
 # if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
 #  define __NO_VMX__
 #  undef JB_SIZE
-compat_symbol (libc, __novmx__longjmp, __longjmp, GLIBC_2_0);
 #  undef __longjmp_symbol
 #  define __longjmp_symbol  __novmx__longjmp
 #  include "__longjmp-common.S"
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 4b0cde8..4ba3146 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2112,7 +2112,6 @@ GLIBC_2.3.4 GLIBC_2.3.4 A
 GLIBC_2.3.4 __chk_fail F
 GLIBC_2.3.4 __fprintf_chk F
 GLIBC_2.3.4 __gets_chk F
-GLIBC_2.3.4 __longjmp F
 GLIBC_2.3.4 __memcpy_chk F
 GLIBC_2.3.4 __memmove_chk F
 GLIBC_2.3.4 __mempcpy_chk F

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

* Re: [PATCH] powerpc: Remove unintended __longjmp export
  2016-11-22 16:43 [PATCH] powerpc: Remove unintended __longjmp export Florian Weimer
@ 2016-11-27  6:45 ` Mike Frysinger
  2016-11-27 13:59   ` Florian Weimer
  2016-11-28 13:05 ` Tulio Magno Quites Machado Filho
  1 sibling, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2016-11-27  6:45 UTC (permalink / raw)
  To: Florian Weimer; +Cc: GNU C Library

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

On 22 Nov 2016 17:43, Florian Weimer wrote:
> Due to an accident, we export __longjmp under a public symbol version 
> for the powerpc32/fpu configuration.
> 
> __longjmp is declared as hidden for internal use.  This means that any 
> reference to this symbol (of which there aren't any right now in 
> libc.so) will cause the symbol to turn unexported.  The reason is that 
> the linker does not distinguish between hidden definitions and 
> references.  GCC emits a .hidden directive in the __longjmp-referencing 
> translation unit, and this kills the .symver-based export.
> 
> I propose the removal of the __longjmp export as the simplest fix. 
> __longjmp is in the implementation namespace and is not used in a public 
> header.  As a result, nothing out there should reference it.
> 
> If this is not acceptable, I'll come up with different approach to 
> address this.  But I prefer to address this issue in this way.
> 
> Tested on a powerpc32/fpu configuration with no regressions.

makes sense to me.  not sure how any package would end up with a reference
to this symbol in their binaries.
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] powerpc: Remove unintended __longjmp export
  2016-11-27  6:45 ` Mike Frysinger
@ 2016-11-27 13:59   ` Florian Weimer
  0 siblings, 0 replies; 5+ messages in thread
From: Florian Weimer @ 2016-11-27 13:59 UTC (permalink / raw)
  Cc: GNU C Library, Steven Munroe, Tulio Magno Quites Machado Filho

On 11/27/2016 07:45 AM, Mike Frysinger wrote:
> On 22 Nov 2016 17:43, Florian Weimer wrote:
>> Due to an accident, we export __longjmp under a public symbol version
>> for the powerpc32/fpu configuration.
>>
>> __longjmp is declared as hidden for internal use.  This means that any
>> reference to this symbol (of which there aren't any right now in
>> libc.so) will cause the symbol to turn unexported.  The reason is that
>> the linker does not distinguish between hidden definitions and
>> references.  GCC emits a .hidden directive in the __longjmp-referencing
>> translation unit, and this kills the .symver-based export.
>>
>> I propose the removal of the __longjmp export as the simplest fix.
>> __longjmp is in the implementation namespace and is not used in a public
>> header.  As a result, nothing out there should reference it.
>>
>> If this is not acceptable, I'll come up with different approach to
>> address this.  But I prefer to address this issue in this way.
>>
>> Tested on a powerpc32/fpu configuration with no regressions.
>
> makes sense to me.  not sure how any package would end up with a reference
> to this symbol in their binaries.

Thanks.  I'll plan to commit this next week, and also the companion 
patch to add a missing hidden symbol.

Steven and Tulio, in case you want to comment, these patches are here:

https://sourceware.org/ml/libc-alpha/2016-11/msg00794.html
https://sourceware.org/ml/libc-alpha/2016-11/msg00798.html

Thanks,
Florian

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

* Re: [PATCH] powerpc: Remove unintended __longjmp export
  2016-11-22 16:43 [PATCH] powerpc: Remove unintended __longjmp export Florian Weimer
  2016-11-27  6:45 ` Mike Frysinger
@ 2016-11-28 13:05 ` Tulio Magno Quites Machado Filho
  2016-11-29 10:12   ` Florian Weimer
  1 sibling, 1 reply; 5+ messages in thread
From: Tulio Magno Quites Machado Filho @ 2016-11-28 13:05 UTC (permalink / raw)
  To: Florian Weimer, GNU C Library; +Cc: Steve Munroe

Florian Weimer <fweimer@redhat.com> writes:

> Due to an accident, we export __longjmp under a public symbol version 
> for the powerpc32/fpu configuration.
>
> __longjmp is declared as hidden for internal use.  This means that any 
> reference to this symbol (of which there aren't any right now in 
> libc.so) will cause the symbol to turn unexported.  The reason is that 
> the linker does not distinguish between hidden definitions and 
> references.  GCC emits a .hidden directive in the __longjmp-referencing 
> translation unit, and this kills the .symver-based export.
>
> I propose the removal of the __longjmp export as the simplest fix. 
> __longjmp is in the implementation namespace and is not used in a public 
> header.  As a result, nothing out there should reference it.
>
> If this is not acceptable, I'll come up with different approach to 
> address this.  But I prefer to address this issue in this way.
>
> Tested on a powerpc32/fpu configuration with no regressions.

Makes sense to me too.

-- 
Tulio Magno

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

* Re: [PATCH] powerpc: Remove unintended __longjmp export
  2016-11-28 13:05 ` Tulio Magno Quites Machado Filho
@ 2016-11-29 10:12   ` Florian Weimer
  0 siblings, 0 replies; 5+ messages in thread
From: Florian Weimer @ 2016-11-29 10:12 UTC (permalink / raw)
  To: Tulio Magno Quites Machado Filho, GNU C Library; +Cc: Steve Munroe

On 11/28/2016 02:04 PM, Tulio Magno Quites Machado Filho wrote:
> Florian Weimer <fweimer@redhat.com> writes:
>
>> Due to an accident, we export __longjmp under a public symbol version
>> for the powerpc32/fpu configuration.
>>
>> __longjmp is declared as hidden for internal use.  This means that any
>> reference to this symbol (of which there aren't any right now in
>> libc.so) will cause the symbol to turn unexported.  The reason is that
>> the linker does not distinguish between hidden definitions and
>> references.  GCC emits a .hidden directive in the __longjmp-referencing
>> translation unit, and this kills the .symver-based export.
>>
>> I propose the removal of the __longjmp export as the simplest fix.
>> __longjmp is in the implementation namespace and is not used in a public
>> header.  As a result, nothing out there should reference it.
>>
>> If this is not acceptable, I'll come up with different approach to
>> address this.  But I prefer to address this issue in this way.
>>
>> Tested on a powerpc32/fpu configuration with no regressions.
>
> Makes sense to me too.

Thanks, I have committed both patches.

Florian

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

end of thread, other threads:[~2016-11-29 10:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-22 16:43 [PATCH] powerpc: Remove unintended __longjmp export Florian Weimer
2016-11-27  6:45 ` Mike Frysinger
2016-11-27 13:59   ` Florian Weimer
2016-11-28 13:05 ` Tulio Magno Quites Machado Filho
2016-11-29 10:12   ` 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).