sedj
Programmer
- Aug 6, 2002
- 5,610
Hi,
Compiling the below problem on solaris 5.9 with gcc 3.2, I get the following errors linking :
Compiling using :
gcc bla.c -o bla.so -shared
gives the errors :
Another weird thing is if I alter the code so its not a shared lib, has a 'main', and compile to an exe, then it links just fine.
Never had these problems on Linux x86 platforms .... anybody got an idea of the problem ?
Thanks for any help !
Compiling the below problem on solaris 5.9 with gcc 3.2, I get the following errors linking :
Code:
#include <stdlib.h>
#include <stdio.h>
void simple_func() {
FILE* mylog = fopen("/tmp/simple_func.mylog", "at");
fclose(mylog);
}
Compiling using :
gcc bla.c -o bla.so -shared
gives the errors :
Code:
Text relocation remains referenced
against symbol offset in file
<unknown> 0x4 /var/tmp//ccqx8rg9.o
<unknown> 0x8 /var/tmp//ccqx8rg9.o
<unknown> 0xc /var/tmp//ccqx8rg9.o
<unknown> 0x10 /var/tmp//ccqx8rg9.o
fopen 0x14 /var/tmp//ccqx8rg9.o
fclose 0x24 /var/tmp//ccqx8rg9.o
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status
Another weird thing is if I alter the code so its not a shared lib, has a 'main', and compile to an exe, then it links just fine.
Never had these problems on Linux x86 platforms .... anybody got an idea of the problem ?
Thanks for any help !