This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
shared libraries on x86 solaris using egcs-1.0.3a
- To: egcs-bugs at cygnus dot com
- Subject: shared libraries on x86 solaris using egcs-1.0.3a
- From: "e. boasson" <eboasson at signaal dot nl>
- Date: Tue, 16 Jun 1998 10:45:48 +0200
- Classification: Unclassified
Symptoms
========
egcs-1.0.3a (but gcc-2.8.1 as well) sometimes generate code that contains
relocations against the text segment when both -fpic and -O are specified
on solaris 2.6/x86.
% gcc -O -fpic -shared test.i -o test.so
Text relocation remains referenced
against symbol offset in file
__iob 0xc /var/tmp/cc0DZedA1.o
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status
Configuration
=============
SunOS sophie 5.6 Generic i86pc i386 i86pc
Reading specs from /usr/local/lib/gcc-lib/i386-pc-solaris2.6/egcs-2.90.29/specs
gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)
(default configuration)
Erik Boasson.
Source code that produces the bug
=================================
#include <stdio.h>
void f (int i)
{
fprintf (stderr, "%f", i * 1e-9);
}
Preprocessed source code
========================
# 1 "test.c"
# 1 "/usr/local/lib/gcc-lib/i386-pc-solaris2.6/egcs-2.90.29/include/stdio.h" 1 3
#pragma ident "@(#)stdio.h 1.49 97/05/09 SMI"
# 1 "/usr/local/lib/gcc-lib/i386-pc-solaris2.6/egcs-2.90.29/include/sys/feature_tests.h" 1 3
#pragma ident "@(#)feature_tests.h 1.13 97/06/26 SMI"
# 17 "/usr/local/lib/gcc-lib/i386-pc-solaris2.6/egcs-2.90.29/include/stdio.h" 2 3
# 1 "/usr/include/sys/va_list.h" 1 3
#pragma ident "@(#)va_list.h 1.6 96/01/26 SMI"
# 41 "/usr/include/sys/va_list.h" 3
typedef void *__va_list;
# 18 "/usr/local/lib/gcc-lib/i386-pc-solaris2.6/egcs-2.90.29/include/stdio.h" 2 3
typedef unsigned int size_t;
typedef long long __longlong_t;
typedef long off_t;
typedef __longlong_t off64_t;
typedef long fpos_t;
typedef __longlong_t fpos64_t;
# 127 "/usr/local/lib/gcc-lib/i386-pc-solaris2.6/egcs-2.90.29/include/stdio.h" 3
typedef struct
{
int _cnt;
unsigned char *_ptr;
unsigned char *_base;
unsigned char _flag;
unsigned char _file;
} FILE;
extern FILE __iob[60 ];
extern FILE *_lastbuf;
extern unsigned char *_bufendtab[];
extern unsigned char _sibuf[], _sobuf[];
# 227 "/usr/local/lib/gcc-lib/i386-pc-solaris2.6/egcs-2.90.29/include/stdio.h" 3
extern int remove(const char *);
extern int rename(const char *, const char *);
extern FILE *tmpfile(void);
extern char *tmpnam(char *);
extern int fclose(FILE *);
extern int fflush(FILE *);
extern FILE *fopen(const char *, const char *);
extern FILE *freopen(const char *, const char *, FILE *);
extern void setbuf(FILE *, char *);
extern void setbuffer(FILE *, char *, size_t);
extern int setlinebuf(FILE *);
extern int setvbuf(FILE *, char *, int, size_t);
extern int fprintf(FILE *, const char *, ...);
extern int fscanf(FILE *, const char *, ...);
extern int printf(const char *, ...);
extern int scanf(const char *, ...);
extern int snprintf(char *, size_t, const char *, ...);
extern int sprintf(char *, const char *, ...);
extern int sscanf(const char *, const char *, ...);
extern int vfprintf(FILE *, const char *, __va_list);
extern int vprintf(const char *, __va_list);
extern int vsnprintf(char *, size_t, const char *, __va_list);
extern int vsprintf(char *, const char *, __va_list);
extern int fgetc(FILE *);
extern char *fgets(char *, int, FILE *);
extern int fputc(int, FILE *);
extern int fputs(const char *, FILE *);
extern int getc(FILE *);
extern int getchar(void);
extern char *gets(char *);
extern int putc(int, FILE *);
extern int putchar(int);
extern int puts(const char *);
extern int ungetc(int, FILE *);
extern size_t fread(void *, size_t, size_t, FILE *);
extern size_t fwrite(const void *, size_t, size_t, FILE *);
extern int fgetpos(FILE *, fpos_t *);
extern int fseek(FILE *, long, int);
extern int fsetpos(FILE *, const fpos_t *);
extern long ftell(FILE *);
extern void rewind(FILE *);
extern void clearerr(FILE *);
extern int feof(FILE *);
extern int ferror(FILE *);
extern void perror(const char *);
extern int __filbuf(FILE *);
extern int __flsbuf(int, FILE *);
extern FILE *fdopen(int, const char *);
extern char *ctermid(char *);
extern int fileno(FILE *);
# 324 "/usr/local/lib/gcc-lib/i386-pc-solaris2.6/egcs-2.90.29/include/stdio.h" 3
extern FILE *popen(const char *, const char *);
extern char *cuserid(char *);
extern char *tempnam(const char *, const char *);
extern int getopt(int, char *const *, const char *);
extern int getsubopt(char **, char *const *, char **);
extern char *optarg;
extern int optind, opterr, optopt;
extern int getw(FILE *);
extern int putw(int, FILE *);
extern int pclose(FILE *);
extern int fseeko(FILE *, off_t, int);
extern off_t ftello(FILE *);
extern FILE *fopen64(const char *, const char *);
extern FILE *freopen64(const char *, const char *, FILE *);
extern FILE *tmpfile64(void);
extern int fgetpos64(FILE *, fpos64_t *);
extern int fsetpos64(FILE *, const fpos64_t *);
extern int fseeko64(FILE *, off64_t, int);
extern off64_t ftello64(FILE *);
# 472 "/usr/local/lib/gcc-lib/i386-pc-solaris2.6/egcs-2.90.29/include/stdio.h" 3
# 520 "/usr/local/lib/gcc-lib/i386-pc-solaris2.6/egcs-2.90.29/include/stdio.h" 3
# 1 "test.c" 2
void f (int i)
{
fprintf ((&__iob[2]) , "%f", i * 1e-9);
}