This is the mail archive of the glibc-bugs@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]

[Bug dynamic-link/20309] tls_shared_gnu2_test fails on Fedora 24


https://sourceware.org/bugzilla/show_bug.cgi?id=20309

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|gold                        |dynamic-link
            Version|2.27 (HEAD)                 |2.23
           Assignee|ccoutant at gmail dot com          |unassigned at sourceware dot org
            Product|binutils                    |glibc
   Target Milestone|---                         |2.24

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
This may be a glibc bug.  With glibc 2.23, I got

[hjl@gnu-6 tls-gnu2-1]$ cat def.c 
__thread int gd = 1;
[hjl@gnu-6 tls-gnu2-1]$ cat gd.c
extern __thread int gd;

int *
get_gd (void)
{
  return &gd;
}

void
set_gd (int i)
{
  gd = i;
}

int
test_gd (int i)
{
  return gd == i;
}
[hjl@gnu-6 tls-gnu2-1]$ cat ld.c
static __thread int ld;

int *
get_ld (void)
{
  return &ld;
}

void
set_ld (int i)
{
  ld = i;
}

int
test_ld (int i)
{
  return ld == i;
}
[hjl@gnu-6 tls-gnu2-1]$ cat main.c
#include <stdio.h>
#include <stdlib.h>

extern int * get_gd (void);
extern void set_gd (int);
extern int test_gd (int);
extern int * get_ld (void);
extern void set_ld (int);
extern int test_ld (int);

int
main ()
{
  int *p;

  p = get_gd ();
  set_gd (3);
  if (*p != 3 || !test_gd (3))
    abort ();

  p = get_ld ();
  set_ld (4);
  if (*p != 4 || !test_ld (4))
    abort ();

  printf ("PASS\n");

  return 0;
}
[hjl@gnu-6 tls-gnu2-1]$ make
gcc -m32 -fPIC -fno-asynchronous-unwind-tables -mtls-dialect=gnu2   -c -o
main.o main.c
gcc -m32 -fPIC -fno-asynchronous-unwind-tables -mtls-dialect=gnu2   -c -o def.o
def.c
gcc -m32 -fPIC -fno-asynchronous-unwind-tables -mtls-dialect=gnu2   -c -o gd.o
gd.c
gcc -m32 -fPIC -fno-asynchronous-unwind-tables -mtls-dialect=gnu2   -c -o ld.o
ld.c
ld -m elf_i386 -shared -o libtls.so gd.o ld.o
gcc -m32 -o x main.o def.o libtls.so -Wl,-R,.
gcc -m32 -static -o y main.o def.o gd.o ld.o -Wl,-R,.
ld -m elf_i386 -shared -o libdef.so def.o
gcc -m32 -o ie main.o gd.o ld.o libdef.so -Wl,-R,.
gcc -m32 -o le main.o def.o gd.o ld.o -Wl,-R,.
./x
Makefile:19: recipe for target 'all' failed
make: *** [all] Segmentation fault
[hjl@gnu-6 tls-gnu2-1]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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