[csw-maintainers] ld: fatal: relocations remain against allocatable but non-writable sections

Maciej (Matchek) Bliziński maciej at opencsw.org
Sat Jun 16 22:02:55 CEST 2012


When building gcc-4.7.1, I ran against this error:

ld: fatal: relocations remain against allocatable but non-writable sections
collect2: error: ld returned 1 exit status

It happens when linking the libgnat shared object. It's reproducible,
try a gcc4 build from the repository and you'll see it.

I found an old discussion about the problem, and Mike's workaround was
to use the GNU linker. A blog post I found[1] was to add
“-mimpure-text -lrt” to LDFLAGS. In case of GCC it's not that easy,
because of nested builds with redefined environments.

Does anyone have any insight about this problem?

Maciej

[1] http://blogs.everycity.co.uk/alasdair/2009/05/text-relocation-remains-against-symbol-libx264/


More information about the maintainers mailing list