Bug 46861 - alpha gcc 4.2 -fPIC visibility hidden => gp-relative relocation against dynamic symbol
Summary: alpha gcc 4.2 -fPIC visibility hidden => gp-relative relocation against dynam...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.2.4
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-09 06:22 UTC by Jay
Modified: 2017-08-01 19:48 UTC (History)
0 users

See Also:
Host:
Target: alphaev5-unknown-linux-gnu
Build:
Known to work: 4.3.5, 4.4.5, 4.5.1
Known to fail: 4.2.4
Last reconfirmed: 2010-12-09 10:12:22


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jay 2010-12-09 06:22:39 UTC
I assume this is a known bug in gcc 4.2?
  No repro with 4.5.1.
I worked around it by using a local static signal handler that
calls the real one.


jay@alphalinux:~$ $HOME/gcc-4.5.1/bin/gcc -v -fPIC 1.c 2.c -shared
Target: alphaev5-unknown-linux-gnu
Configured with: /home/jay/src/gcc-4.5.1/configure -prefix=/home/jay/gcc-4.5.1

=> success

jay@alphalinux:~$ gcc -v -fPIC 1.c 2.c -shared
Target: alpha-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --disable-libssp --with-long-double-128 --enable-checking=release --build=alpha-linux-gnu --host=alpha-linux-gnu --target=alpha-linux-gnu
Thread model: posix
gcc version 4.2.4 (Debian 4.2.4-6)


/usr/bin/ld: /tmp/ccNIE2XD.o: gp-relative relocation against dynamic symbol SignalHandler
/usr/bin/ld: /tmp/ccNIE2XD.o: gp-relative relocation against dynamic symbol SignalHandler
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status

jay@alphalinux:~$ cat 1.c 2.c

#include <signal.h>
void SignalHandler(int signo, siginfo_t *info, void *context)
{
}

#include <string.h>
#include <signal.h>

#pragma GCC visibility push(hidden)

void SignalHandler(int signo, siginfo_t *info, void *context);

void F2(void)
{
  struct sigaction act;
  int r;

  memset(&act, 0, sizeof(act));
  act.sa_sigaction = &SignalHandler;
  sigaction(0, &act, NULL);
}
Comment 1 Richard Biener 2010-12-09 10:12:22 UTC
GCC 4.2.x is no longer maintained, please try newer GCC version(s).
Comment 2 Jay 2010-12-09 11:21:35 UTC
Right, I already reported: no problem with 4.5.1.
4.2.4 is what Debian 5.0 has though.
I'll stick with my workaround.
I can try 4.3.x, 4.4.x if there is interest (i.e. in fixing them if they are broken; heck for that matter I should probably try stock 4.2.x, instead of Debian's)
Comment 3 Jonathan Wakely 2010-12-09 11:43:07 UTC
(In reply to comment #2)
> Right, I already reported: no problem with 4.5.1.
> 4.2.4 is what Debian 5.0 has though.

Then it should be reported to Debian if they're still maintaining their 4.2

> I'll stick with my workaround.
> I can try 4.3.x, 4.4.x if there is interest (i.e. in fixing them if they are
> broken; heck for that matter I should probably try stock 4.2.x, instead of
> Debian's)

If they're broken then there'll be interest, there's just no interest in fixing *anything* in 4.2
Comment 4 Jay 2010-12-11 08:47:22 UTC
It appears to also be ok in 4.3.5.


jay@alphalinux:~$ $HOME/gcc-4.3.5/bin/gcc -v
Using built-in specs.
Target: alphaev5-unknown-linux-gnu
Configured with: /home/jay/src/gcc-4.3.5/configure -prefix=/home/jay/gcc-4.3.5
Thread model: posix
gcc version 4.3.5 (GCC) 


jay@alphalinux:~$ $HOME/gcc-4.3.5/bin/gcc 1.c 2.c -fPIC -shared
 => success


4.4.5 I think has a bootstrap problem in libstdc++, I will confirm and open a separate bug.
Comment 5 Jay 2010-12-11 09:40:39 UTC
No problem with 4.4.5 either.

jay@alphalinux:~$ $HOME/gcc-4.4.5/bin/gcc -v
Using built-in specs.
Target: alphaev5-unknown-linux-gnu
Configured with: /home/jay/src/gcc-4.4.5/configure -prefix=/home/jay/gcc-4.4.5
Thread model: posix
gcc version 4.4.5 (GCC) 


jay@alphalinux:~$ $HOME/gcc-4.4.5/bin/gcc 1.c 2.c -fPIC -shared
 => success
Comment 6 Eric Gallager 2017-08-01 19:48:41 UTC
Closing since it's apparently fixed in more recent versions of GCC