Re: 4.7.1 on Solaris 10: ld: fatal: relocations remain against allocatable but non-writable sections

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I hit the exact same problem on Solaris 8/9/10 and simply tossed
it over my shoulder and ignored it for a while. I know that some
folks will say "use gas/gld from binutils" however that simply is
not reasonable on Solaris systems.

Dennis

ps: sorry for the top post

> I've hit a build problem when upgrading from 4.7.0 to 4.7.1. I'm using
> the same build recipe[1], so it's most probably a change in GCC code.
> The immediate error I'm hitting is this:
>
> rm -f rts/libgna*.so
> cd rts; `echo
> "/home/raos/mgar/gcc4/trunk/work/solaris10-sparc/build-isa-sparcv8plus/objdir/./gcc/xgcc
> -B/home/raos/mgar/gcc4/trunk/work/solaris10-sparc/build-isa-sparcv8plus/objdir/./gcc/
> -B/opt/csw/sparc-sun-solaris2.10/bin/
> -B/opt/csw/sparc-sun-solaris2.10/lib/ -isystem
> /opt/csw/sparc-sun-solaris2.10/include -isystem
> /opt/csw/sparc-sun-solaris2.10/sys-include   " \
>                 | sed -e 's,\./xgcc,../../xgcc,' -e
> 's,-B\./,-B../../,'` -shared -g -O2  \
>         -fPIC \
>         -o libgnat-4.7.so \
>         a-assert.o (...) raise-gcc.o \
>         -Wl,-h,libgnat-4.7.so \
>         -lposix4 -lnsl -lsocket -lm
> Text relocation remains                         referenced
>     against symbol                  offset      in file
> <unknown>                           0x0         raise-gcc.o
> (...many, many lines...)
> memcpy                              0x4c        sysdep.o
> ld: fatal: relocations remain against allocatable but non-writable sections
> collect2: error: ld returned 1 exit status
> gmake[5]: *** [gnatlib-shared-default] Error 1
> gmake[5]: Leaving directory
> `/home/raos/mgar/gcc4/trunk/work/solaris10-sparc/build-isa-sparcv8plus/objdir/gcc/ada'
> gmake[4]: *** [gnatlib-shared-dual] Error 2
>
> From asking around so far, it's similar to this minimal example:
>
> static int c = 1;
>
> int f(int a) {
>        return a+c;
> }
>
> gcc -shared -o liba.so liba.c
>
> Text relocation remains                         referenced
>    against symbol                  offset      in file
> c                                   0x4         /var/tmp//ccqHaWcX.o
> ld: fatal: relocations remain against allocatable but non-writable sections
> collect2: ld returned 1 exit status
>
> In this case, the fix is to add -fpic to the invocation. But in the
> build logs I do see -fPIC, and it still fails, so I'm not sure if it's
> really the same kind of problem.
>
> Has anyone else encountered this error?
>
> Maciej
>
> [1]
> https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/pkg/gcc4/trunk/Makefile
>




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux