This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: powerpc help needed: Defining hidden alias for __sigsetjmp


On 11/14/2016 04:37 PM, Andreas Schwab wrote:
On Nov 14 2016, Florian Weimer <fweimer@redhat.com> wrote:

I came up with the attached patch.  It adds a definition of the hidden
redirect to libc.so, as expected.  But in addition to that, I get this ABI
difference on powerpc32:

-GLIBC_2.3.4 __longjmp F

Are you sure this is the only change you did?  setjmp.* does not contain
anything related to longjmp.  I couldn't reproduce that.

Thanks.  It only happens in conjunction with this patch:

  <https://sourceware.org/ml/libc-alpha/2016-11/msg00465.html>

This patch adds a reference to __longjmp to libc.so. With it, libc_pic.os has this:

8296: 00017024 492 FUNC GLOBAL HIDDEN 2 __longjmp@@GLIBC_2.3.4
 9342: 00017210    184 FUNC    GLOBAL DEFAULT        2 __longjmp@GLIBC_2.0

And libc.so has this:

5208: 00039c04 492 FUNC LOCAL DEFAULT 11 __longjmp@@GLIBC_2.3.4
 5758: 00039df0    184 FUNC    LOCAL  DEFAULT       11 __longjmp@GLIBC_2.0

It turns out that libc.map lists _longjmp only, based on the entry in sysdeps/powerpc/Versions.

setjmp/__longjmp.os has:

   11: 00000000    492 FUNC    GLOBAL DEFAULT        1 __vmx__longjmp
   14: 000001ec    184 FUNC    GLOBAL DEFAULT        1 __novmx__longjmp
15: 00000000 492 FUNC GLOBAL DEFAULT 1 __longjmp@@GLIBC_2.3.4
   16: 000001ec    184 FUNC    GLOBAL DEFAULT        1 __longjmp@GLIBC_2.0

setjmp/longjmp.os has:

   21: 00000000    116 FUNC    GLOBAL DEFAULT        1 __vmx__libc_longjmp
22: 00000000 116 FUNC GLOBAL DEFAULT 1 __vmx__libc_siglongjmp
   23: 00000000    116 FUNC    WEAK   DEFAULT        1 __vmx_longjmp
   24: 00000000    116 FUNC    WEAK   DEFAULT        1 __vmxlongjmp
   25: 00000000    116 FUNC    WEAK   DEFAULT        1 __vmxsiglongjmp
30: 00000000 116 FUNC GLOBAL HIDDEN 1 __GI___vmx__libc_longjmp 31: 00000000 116 FUNC GLOBAL DEFAULT 1 __libc_longjmp@@GLIBC_PRIVATE 32: 00000000 116 FUNC GLOBAL DEFAULT 1 __libc_siglongjmp@@GLIBC_PRIVATE 33: 00000000 116 FUNC WEAK DEFAULT 1 _longjmp@@GLIBC_2.3.4
   34: 00000000    116 FUNC    WEAK   DEFAULT        1 longjmp@@GLIBC_2.3.4
35: 00000000 116 FUNC WEAK DEFAULT 1 siglongjmp@@GLIBC_2.3.4

So the __GI_* aliases are missing there, too.

The internal reference to __longjmp seems to cause ld to drop the exported symbol version. Adding __longjmp to sysdeps/powerpc/Versions does not change this. Neither does adding

libc_hidden_ver (__vmx__libc_longjmp, __longjmp)

to sysdeps/powerpc/longjmp.c. Okay, that's because the definition comes from sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S. But changing that file to contain:

versioned_symbol (libc, __vmx__longjmp, __longjmp, GLIBC_2_3_4);
# define __longjmp_symbol  __vmx__longjmp
# include "__longjmp-common.S"
libc_hidden_ver (__vmx__libc_longjmp, __longjmp)

does not help, either.

Maybe this is relevant.  __longjmp is declared *hidden*:

extern void __longjmp (__jmp_buf __env, int __val)
     __attribute__ ((__noreturn__)) attribute_hidden;

So maybe that's why a reference to it causes ld to drop the export.

I wonder if this indeed the root cause. It would mean this is a spurious ABI addition. Can we drop __longjmp from the ABI in this way? Or do we have to fix this up using a powerpc-specific alias?

This happens on no other architecture for which we have abilist files. It was introduced into the abilist file here:

commit 0741d64c9140aa205f9df8ebee80ca0bcb018445
Author: Andreas Schwab <schwab@linux-m68k.org>
Date:   Tue May 1 01:12:54 2012 +0200

    Update powerpc ABI data

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]