This is the mail archive of the 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/21041] Fix for bug 20019 causes linker errors for shared libraries using longjmp

--- Comment #7 from H.J. Lu < at gmail dot com> ---
Here is an example:

[hjl@gnu-6 pr21041b]$ cat bar.c
extern void xxx (void);

bar (void)
  xxx ();
[hjl@gnu-6 pr21041b]$ cat foo.c
extern void bar (void);

foo (void)
  bar ();
[hjl@gnu-6 pr21041b]$ cat ifunc.c 
extern void real_xxx (void);

static void *
xxx_resolver ()
  return &real_xxx;

extern void xxx (void) __attribute__ ((ifunc ("xxx_resolver")));
[hjl@gnu-6 pr21041b]$ cat xxx.c 
xxx (void)

__typeof (xxx) real_xxx __attribute__ ((alias("xxx")));
[hjl@gnu-6 pr21041b]$ cat main.c
void foo (void);

main ()
  foo ();
  return 0;
[hjl@gnu-6 pr21041b]$ make
gcc -O2   -c -o main.o main.c
gcc -O2 -fPIC   -c -o foo.o foo.c
gcc -O2 -fPIC   -c -o bar.o bar.c
ld.bfd -shared -z now -o bar.o
ld.bfd -shared -z now -o foo.o
gcc -O2 -fPIC   -c -o ifunc.o ifunc.c
gcc -O2   -c -o xxx.o xxx.c
ld.bfd -shared -o xxx.o
ld.bfd -shared -o ifunc.o
gcc -o x main.o -Wl,-rpath,.
gcc -o y main.o -Wl,-rpath,.
Makefile:10: recipe for target 'all' failed
make: *** [all] Segmentation fault
[hjl@gnu-6 pr21041b]$

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]