Bug 15687 - powerpc64 abi breakage with nocancel functions
Summary: powerpc64 abi breakage with nocancel functions
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: nptl (show other bugs)
Version: 2.18
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-27 01:17 UTC by Alan Modra
Modified: 2014-06-13 13:30 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Modra 2013-06-27 01:17:33 UTC
glibc contains powerpc64 functions without functions descriptors.  As seen in nptl/ptw-pause.o

[snip]
  [ 1] .text     PROGBITS    0000000000000000 000040 0000b4 00  AX  0   0  4
[snip]
  [ 5] .opd      PROGBITS    0000000000000000 0000f8 000018 00  WA  0   0  8
[snip]
    10: 0000000000000000   180 FUNC    GLOBAL DEFAULT    5 __libc_pause
    11: 000000000000000c    48 FUNC    GLOBAL DEFAULT    1 __pause_nocancel

Notice that __pause_nocancel is define in .text, ie. does not have a function descriptor.  This triggered an error in powerpc64 gold --gc-sections.

It looks to me like nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h is the culprit.  The ENTRY macro normally is reposible for generating function descriptors, but I see no such thing for the nocancel variant entry point.
Comment 1 Andreas Schwab 2013-06-27 12:39:59 UTC
All _nocancel decls are hidden anyway, so I don't think this is a problem.  None of the calls need the descriptor.
Comment 2 Alan Modra 2013-06-27 15:21:51 UTC
They might be hidden in libc.so, but not in the static library.

nm libc.a | grep __pause_nocancel
000000000000000c T __pause_nocancel

You would not be able to set a function pointer to any of these functions, then call via the pointer.  Not that anyone is likely to want to do such a thing,  I'm just pointing out one of the consequences of no function descriptor.
Comment 3 Andreas Schwab 2013-06-27 16:02:48 UTC
Well, the static library has a lot of internal things that are not supposed to be used, and break if used improperly.
Comment 4 Jing Yu 2013-07-17 18:36:43 UTC
__pause_nocancel is called by __pthread_mutex_lock_full(pthread_mutex_t*) in nptl/pthread_mutex_lock.c. In such a case, does __pause_nocancel need a function descriptor?
Comment 5 Andreas Schwab 2013-07-17 20:46:35 UTC
The reference is still library-internal.
Comment 6 Alan Modra 2013-08-11 02:49:34 UTC
Closing since these are reserved identifiers.