* [Bug lto/48851] lto-plugin.c:224:7: error: missing sentinel in function call [-Werror=format]
2011-05-03 12:15 [Bug lto/48851] New: lto-plugin.c:224:7: error: missing sentinel in function call [-Werror=format] michael.a.richmond at nasa dot gov
` (2 preceding siblings ...)
2011-05-03 14:27 ` froydnj at gcc dot gnu.org
@ 2011-05-03 15:51 ` michael.a.richmond at nasa dot gov
2011-05-03 16:02 ` rguenth at gcc dot gnu.org
` (21 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: michael.a.richmond at nasa dot gov @ 2011-05-03 15:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48851
--- Comment #4 from Michael Richmond <michael.a.richmond at nasa dot gov> 2011-05-03 15:44:25 UTC ---
Listed below is the most recently-created version of lto-plugin.i (I truncated
it to comply with the limits in bugzilla):
# 1 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c"
# 1 "/home/mrichmon/gcc-4.7-20110430/g95/lto-plugin//"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c"
# 36 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c"
# 1 "./config.h" 1
# 37 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c" 2
# 1 "/usr/include/stdint.h" 1 3 4
# 22 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 41 "/usr/include/sys/cdefs.h" 3 4
# 1 "/usr/include/machine/cdefs.h" 1 3 4
# 42 "/usr/include/sys/cdefs.h" 2 3 4
# 23 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/machine/_types.h" 1 3 4
# 45 "/usr/include/machine/_types.h" 3 4
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef short __int16_t;
typedef unsigned short __uint16_t;
typedef int __int32_t;
typedef unsigned int __uint32_t;
typedef long long __int64_t;
typedef unsigned long long __uint64_t;
typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;
typedef __int32_t __int_fast8_t;
typedef __uint32_t __uint_fast8_t;
typedef __int32_t __int_fast16_t;
typedef __uint32_t __uint_fast16_t;
typedef __int32_t __int_fast32_t;
typedef __uint32_t __uint_fast32_t;
typedef __int64_t __int_fast64_t;
typedef __uint64_t __uint_fast64_t;
typedef long __intptr_t;
typedef unsigned long __uintptr_t;
typedef __int64_t __intmax_t;
typedef __uint64_t __uintmax_t;
typedef __int32_t __register_t;
typedef unsigned long __vaddr_t;
typedef unsigned long __paddr_t;
typedef unsigned long __vsize_t;
typedef unsigned long __psize_t;
typedef int __clock_t;
typedef int __clockid_t;
typedef long double __double_t;
typedef long double __float_t;
typedef long long __off_t;
typedef long __ptrdiff_t;
typedef unsigned long __size_t;
typedef long __ssize_t;
typedef int __time_t;
typedef int __timer_t;
typedef __builtin_va_list __va_list;
typedef int __wchar_t;
typedef int __wint_t;
typedef int __rune_t;
typedef void * __wctrans_t;
typedef void * __wctype_t;
# 24 "/usr/include/stdint.h" 2 3 4
# 32 "/usr/include/stdint.h" 3 4
typedef __int8_t int8_t;
typedef __uint8_t uint8_t;
typedef __int16_t int16_t;
typedef __uint16_t uint16_t;
typedef __int32_t int32_t;
typedef __uint32_t uint32_t;
typedef __int64_t int64_t;
typedef __uint64_t uint64_t;
typedef __int_least8_t int_least8_t;
typedef __uint_least8_t uint_least8_t;
typedef __int_least16_t int_least16_t;
typedef __uint_least16_t uint_least16_t;
typedef __int_least32_t int_least32_t;
typedef __uint_least32_t uint_least32_t;
typedef __int_least64_t int_least64_t;
typedef __uint_least64_t uint_least64_t;
typedef __int_fast8_t int_fast8_t;
typedef __uint_fast8_t uint_fast8_t;
typedef __int_fast16_t int_fast16_t;
typedef __uint_fast16_t uint_fast16_t;
typedef __int_fast32_t int_fast32_t;
typedef __uint_fast32_t uint_fast32_t;
typedef __int_fast64_t int_fast64_t;
typedef __uint_fast64_t uint_fast64_t;
typedef __intptr_t intptr_t;
typedef __uintptr_t uintptr_t;
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 40 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c" 2
# 1 "/usr/include/assert.h" 1 3 4
# 62 "/usr/include/assert.h" 3 4
__attribute__((__noreturn__)) void __assert(const char *, int, const char *);
__attribute__((__noreturn__)) void __assert2(const char *, int, const char *,
const char *);
# 42 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c" 2
# 1 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/string.h" 1 3
4
# 52 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/string.h" 3
4
typedef __size_t size_t;
# 63 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/string.h" 3
4
void *memchr(const void *, int, size_t);
void *memrchr(const void *, int, size_t);
int memcmp(const void *, const void *, size_t);
void *memcpy(void *, const void *, size_t)
__attribute__ ((__bounded__(__buffer__,1,3)))
__attribute__ ((__bounded__(__buffer__,2,3)));
void *memmove(void *, const void *, size_t)
__attribute__ ((__bounded__(__buffer__,1,3)))
__attribute__ ((__bounded__(__buffer__,2,3)));
void *memset(void *, int, size_t)
__attribute__ ((__bounded__(__buffer__,1,3)));
char *strcat(char *, const char *);
char *strchr(const char *, int);
int strcmp(const char *, const char *);
int strcoll(const char *, const char *);
char *strcpy(char *, const char *);
size_t strcspn(const char *, const char *);
char *strerror(int);
size_t strlen(const char *);
char *strncat(char *, const char *, size_t)
__attribute__ ((__bounded__(__string__,1,3)));
int strncmp(const char *, const char *, size_t);
char *strncpy(char *, const char *, size_t)
__attribute__ ((__bounded__(__string__,1,3)));
char *strpbrk(const char *, const char *);
char *strrchr(const char *, int);
size_t strspn(const char *, const char *);
char *strstr(const char *, const char *);
char *strtok(char *, const char *);
char *strtok_r(char *, const char *, char **);
size_t strxfrm(char *, const char *, size_t)
__attribute__ ((__bounded__(__string__,1,3)));
void *memccpy(void *, const void *, int, size_t)
__attribute__ ((__bounded__(__buffer__,1,4)));
int bcmp(const void *, const void *, size_t);
void bcopy(const void *, void *, size_t)
__attribute__ ((__bounded__(__buffer__,1,3)))
__attribute__ ((__bounded__(__buffer__,2,3)));
void bzero(void *, size_t)
__attribute__ ((__bounded__(__buffer__,1,2)));
int ffs(int);
char *index(const char *, int);
char *rindex(const char *, int);
int strcasecmp(const char *, const char *);
int strncasecmp(const char *, const char *, size_t);
char *strdup(const char *);
int strerror_r(int, char *, size_t)
__attribute__ ((__bounded__(__string__,2,3)));
char *strndup(const char *, size_t);
size_t strnlen(const char *, size_t);
char *strcasestr(const char *, const char *);
size_t strlcat(char *, const char *, size_t)
__attribute__ ((__bounded__(__string__,1,3)));
size_t strlcpy(char *, const char *, size_t)
__attribute__ ((__bounded__(__string__,1,3)));
void strmode(int, char *);
char *strsep(char **, const char *);
char *strsignal(int);
int timingsafe_bcmp(const void *, const void *, size_t);
# 43 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c" 2
# 1 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/stdlib.h" 1 3
4
# 50 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/stdlib.h" 3
4
# 1 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/sys/types.h"
1 3 4
# 53 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/sys/types.h"
3 4
# 1 "/usr/include/sys/_types.h" 1 3 4
# 39 "/usr/include/sys/_types.h" 3 4
typedef unsigned long __cpuid_t;
typedef __int32_t __dev_t;
typedef __uint32_t __fixpt_t;
typedef __uint32_t __gid_t;
typedef __uint32_t __id_t;
typedef __uint32_t __in_addr_t;
typedef __uint16_t __in_port_t;
typedef __uint32_t __ino_t;
typedef long __key_t;
typedef __uint32_t __mode_t;
typedef __uint32_t __nlink_t;
typedef __int32_t __pid_t;
typedef __uint64_t __rlim_t;
typedef __uint8_t __sa_family_t;
typedef __int32_t __segsz_t;
typedef __uint32_t __socklen_t;
typedef __int32_t __swblk_t;
typedef __uint32_t __uid_t;
typedef __uint32_t __useconds_t;
typedef __int32_t __suseconds_t;
typedef __uint64_t __fsblkcnt_t;
typedef __uint64_t __fsfilcnt_t;
typedef union {
char __mbstate8[128];
__int64_t __mbstateL;
} __mbstate_t;
# 54 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/sys/types.h"
2 3 4
# 1 "/usr/include/machine/endian.h" 1 3 4
# 58 "/usr/include/machine/endian.h" 3 4
# 1 "/usr/include/sys/endian.h" 1 3 4
# 161 "/usr/include/sys/endian.h" 3 4
__uint64_t htobe64(__uint64_t);
__uint32_t htobe32(__uint32_t);
__uint16_t htobe16(__uint16_t);
__uint64_t betoh64(__uint64_t);
__uint32_t betoh32(__uint32_t);
__uint16_t betoh16(__uint16_t);
__uint64_t htole64(__uint64_t);
__uint32_t htole32(__uint32_t);
__uint16_t htole16(__uint16_t);
__uint64_t letoh64(__uint64_t);
__uint32_t letoh32(__uint32_t);
__uint16_t letoh16(__uint16_t);
# 59 "/usr/include/machine/endian.h" 2 3 4
# 55 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/sys/types.h"
2 3 4
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
typedef unsigned char unchar;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;
typedef __cpuid_t cpuid_t;
typedef __register_t register_t;
# 120
"/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/sys/types.h" 3 4
typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;
typedef __int64_t quad_t;
typedef __uint64_t u_quad_t;
typedef quad_t * qaddr_t;
typedef __vaddr_t vaddr_t;
typedef __paddr_t paddr_t;
typedef __vsize_t vsize_t;
typedef __psize_t psize_t;
typedef char * caddr_t;
typedef __int32_t daddr32_t;
typedef __int64_t daddr_t;
typedef __int64_t daddr64_t;
typedef __dev_t dev_t;
typedef __fixpt_t fixpt_t;
typedef __gid_t gid_t;
typedef __id_t id_t;
typedef __ino_t ino_t;
typedef __key_t key_t;
typedef __mode_t mode_t;
typedef __nlink_t nlink_t;
typedef __pid_t pid_t;
typedef __rlim_t rlim_t;
typedef __segsz_t segsz_t;
typedef __swblk_t swblk_t;
typedef __uid_t uid_t;
typedef __useconds_t useconds_t;
typedef __suseconds_t suseconds_t;
typedef __fsblkcnt_t fsblkcnt_t;
typedef __fsfilcnt_t fsfilcnt_t;
# 169
"/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/sys/types.h" 3 4
typedef __in_addr_t in_addr_t;
typedef __in_port_t in_port_t;
typedef __sa_family_t sa_family_t;
typedef __socklen_t socklen_t;
typedef __clock_t clock_t;
typedef __clockid_t clockid_t;
# 198
"/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/sys/types.h" 3 4
typedef __ssize_t ssize_t;
typedef __time_t time_t;
typedef __timer_t timer_t;
typedef __off_t off_t;
# 222
"/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/sys/types.h" 3 4
off_t lseek(int, off_t, int);
int ftruncate(int, off_t);
int truncate(const char *, off_t);
# 237
"/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/sys/types.h" 3 4
# 1 "/usr/include/sys/select.h" 1 3 4
# 38 "/usr/include/sys/select.h" 3 4
# 1 "/usr/include/sys/time.h" 1 3 4
# 39 "/usr/include/sys/time.h" 3 4
# 1 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/sys/types.h"
1 3 4
# 40 "/usr/include/sys/time.h" 2 3 4
# 49 "/usr/include/sys/time.h" 3 4
struct timeval {
long tv_sec;
long tv_usec;
};
struct timespec {
time_t tv_sec;
long tv_nsec;
};
# 74 "/usr/include/sys/time.h" 3 4
struct timezone {
int tz_minuteswest;
int tz_dsttime;
};
# 139 "/usr/include/sys/time.h" 3 4
struct bintime {
time_t sec;
uint64_t frac;
};
static __inline void
bintime_addx(struct bintime *bt, uint64_t x)
{
uint64_t u;
u = bt->frac;
bt->frac += x;
if (u > bt->frac)
bt->sec++;
}
static __inline void
bintime_add(struct bintime *bt, struct bintime *bt2)
{
uint64_t u;
u = bt->frac;
bt->frac += bt2->frac;
if (u > bt->frac)
bt->sec++;
bt->sec += bt2->sec;
}
static __inline void
bintime_sub(struct bintime *bt, struct bintime *bt2)
{
uint64_t u;
u = bt->frac;
bt->frac -= bt2->frac;
if (u < bt->frac)
bt->sec--;
bt->sec -= bt2->sec;
}
# 193 "/usr/include/sys/time.h" 3 4
static __inline void
bintime2timespec(struct bintime *bt, struct timespec *ts)
{
ts->tv_sec = bt->sec;
ts->tv_nsec = (long)(((uint64_t)1000000000 * (uint32_t)(bt->frac >> 32)) >>
32);
}
static __inline void
timespec2bintime(struct timespec *ts, struct bintime *bt)
{
bt->sec = ts->tv_sec;
bt->frac = (uint64_t)ts->tv_nsec * (uint64_t)18446744073ULL;
}
static __inline void
bintime2timeval(struct bintime *bt, struct timeval *tv)
{
tv->tv_sec = bt->sec;
tv->tv_usec = (long)(((uint64_t)1000000 * (uint32_t)(bt->frac >> 32)) >> 32);
}
static __inline void
timeval2bintime(struct timeval *tv, struct bintime *bt)
{
bt->sec = (time_t)tv->tv_sec;
bt->frac = (uint64_t)tv->tv_usec * (uint64_t)18446744073709ULL;
}
# 235 "/usr/include/sys/time.h" 3 4
struct itimerval {
struct timeval it_interval;
struct timeval it_value;
};
struct itimerspec {
struct timespec it_interval;
struct timespec it_value;
};
struct clockinfo {
int hz;
int tick;
int tickadj;
int stathz;
int profhz;
};
# 346 "/usr/include/sys/time.h" 3 4
# 1 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/time.h" 1 3 4
# 97 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/time.h" 3 4
struct tm {
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
long tm_gmtoff;
char *tm_zone;
};
struct timespec;
char *asctime(const struct tm *);
clock_t clock(void);
char *ctime(const time_t *);
double difftime(time_t, time_t);
struct tm *gmtime(const time_t *);
struct tm *localtime(const time_t *);
time_t mktime(struct tm *);
size_t strftime(char *, size_t, const char *, const struct tm *)
__attribute__ ((__bounded__(__string__,1,2)));
char *strptime(const char *, const char *, struct tm *);
time_t time(time_t *);
char *asctime_r(const struct tm *, char *)
__attribute__ ((__bounded__(__minbytes__,2,26)));
char *ctime_r(const time_t *, char *)
__attribute__ ((__bounded__(__minbytes__,2,26)));
struct tm *gmtime_r(const time_t *, struct tm *);
struct tm *localtime_r(const time_t *, struct tm *);
int nanosleep(const struct timespec *, struct timespec *);
extern char *tzname[2];
void tzset(void);
char *timezone(int, int);
void tzsetwall(void);
time_t timelocal(struct tm *);
time_t timegm(struct tm *);
time_t timeoff(struct tm *, const long);
# 347 "/usr/include/sys/time.h" 2 3 4
int adjtime(const struct timeval *, struct timeval *);
int adjfreq(const int64_t *, int64_t *);
int clock_getres(clockid_t, struct timespec *);
int clock_gettime(clockid_t, struct timespec *);
int clock_settime(clockid_t, const struct timespec *);
int futimes(int, const struct timeval *);
int getitimer(int, struct itimerval *);
int gettimeofday(struct timeval *, struct timezone *);
int setitimer(int, const struct itimerval *, struct itimerval *);
int settimeofday(const struct timeval *, const struct timezone *);
int utimes(const char *, const struct timeval *);
# 39 "/usr/include/sys/select.h" 2 3 4
# 55 "/usr/include/sys/select.h" 3 4
typedef int32_t __fd_mask;
typedef struct fd_set {
__fd_mask fds_bits[(((1024) + ((((unsigned)(sizeof(__fd_mask) * 8))) - 1)) /
(((unsigned)(sizeof(__fd_mask) * 8))))];
} fd_set;
# 89 "/usr/include/sys/select.h" 3 4
struct timeval;
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
# 238
"/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/sys/types.h" 2 3
4
# 51 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/stdlib.h" 2
3 4
# 67 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/stdlib.h" 3
4
typedef int wchar_t;
typedef struct {
int quot;
int rem;
} div_t;
typedef struct {
long quot;
long rem;
} ldiv_t;
typedef struct {
long long quot;
long long rem;
} lldiv_t;
typedef struct {
quad_t quot;
quad_t rem;
} qdiv_t;
# 110 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/stdlib.h" 3
4
extern size_t __mb_cur_max;
# 124 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/stdlib.h" 3
4
__attribute__((__noreturn__)) void abort(void);
int abs(int);
int atexit(void (*)(void));
double atof(const char *);
int atoi(const char *);
long atol(const char *);
void *bsearch(const void *, const void *, size_t, size_t,
int (*)(const void *, const void *));
void *calloc(size_t, size_t);
div_t div(int, int);
char *ecvt(double, int, int *, int *);
__attribute__((__noreturn__)) void exit(int);
__attribute__((__noreturn__)) void _Exit(int);
char *fcvt(double, int, int *, int *);
void free(void *);
char *gcvt(double, int, char *);
char *getenv(const char *);
long labs(long);
ldiv_t ldiv(long, long);
void *malloc(size_t);
int posix_memalign(void **, size_t, size_t);
void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
int rand(void);
void *realloc(void *, size_t);
void srand(unsigned);
double strtod(const char *, char **);
float strtof(const char *, char **);
long strtol(const char *, char **, int);
long double
strtold(const char *, char **);
unsigned long
strtoul(const char *, char **, int);
int system(const char *);
int mblen(const char *, size_t);
size_t mbstowcs(wchar_t *, const char *, size_t);
int wctomb(char *, wchar_t);
int mbtowc(wchar_t *, const char *, size_t);
size_t wcstombs(char *, const wchar_t *, size_t);
int rand_r(unsigned int *);
double drand48(void);
double erand48(unsigned short[3]);
long jrand48(unsigned short[3]);
void lcong48(unsigned short[7]);
long lrand48(void);
long mrand48(void);
long nrand48(unsigned short[3]);
unsigned short *seed48(unsigned short[3]);
void srand48(long);
int putenv(char *);
long a64l(const char *);
char *l64a(long);
char *initstate(unsigned int, char *, size_t)
__attribute__((__bounded__ (__string__,2,3)));
long random(void);
char *setstate(const char *);
void srandom(unsigned int);
int mkstemp(char *);
char *mktemp(char *);
char *realpath(const char *, char *);
int setkey(const char *);
int ttyslot(void);
void *valloc(size_t);
long long
atoll(const char *);
long long
llabs(long long);
lldiv_t
lldiv(long long, long long);
long long
strtoll(const char *, char **, int);
unsigned long long
strtoull(const char *, char **, int);
int setenv(const char *, const char *, int);
int unsetenv(const char *);
void *alloca(size_t);
char *getbsize(int *, long *);
char *cgetcap(char *, const char *, int);
int cgetclose(void);
int cgetent(char **, char **, const char *);
int cgetfirst(char **, char **);
int cgetmatch(char *, const char *);
int cgetnext(char **, char **);
int cgetnum(char *, const char *, long *);
int cgetset(const char *);
int cgetusedb(int);
int cgetstr(char *, const char *, char **);
int cgetustr(char *, const char *, char **);
int daemon(int, int);
char *devname(int, mode_t);
int getloadavg(double [], int);
void cfree(void *);
int getopt(int, char * const *, const char *);
extern char *optarg;
extern int opterr, optind, optopt, optreset;
int getsubopt(char **, char * const *, char **);
extern char *suboptarg;
char *mkdtemp(char *);
int mkstemps(char *, int);
int heapsort(void *, size_t, size_t, int (*)(const void *, const void *));
int mergesort(void *, size_t, size_t, int (*)(const void *, const void *));
int radixsort(const unsigned char **, int, const unsigned char *,
unsigned);
int sradixsort(const unsigned char **, int, const unsigned char *,
unsigned);
void srandomdev(void);
long long
strtonum(const char *, long long, long long, const char **);
void setproctitle(const char *, ...)
__attribute__((__format__ (__printf__, 1, 2)));
quad_t qabs(quad_t);
qdiv_t qdiv(quad_t, quad_t);
quad_t strtoq(const char *, char **, int);
u_quad_t strtouq(const char *, char **, int);
u_int32_t arc4random(void);
void arc4random_stir(void);
void arc4random_addrandom(unsigned char *, int)
__attribute__((__bounded__ (__string__,1,2)));
u_int32_t arc4random_uniform(u_int32_t);
void arc4random_buf(void *, size_t)
__attribute__((__bounded__ (__string__,1,2)));
# 44 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c" 2
# 1 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/stdio.h" 1 3
4
# 14 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/stdio.h" 3 4
# 1 "/usr/include/stdarg.h" 1 3 4
# 29 "/usr/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 41 "/usr/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 15 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/stdio.h" 2 3
4
# 82 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/stdio.h" 3 4
typedef off_t fpos_t;
# 91 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/stdio.h" 3 4
struct __sbuf {
unsigned char *_base;
int _size;
};
# 120 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/stdio.h" 3
4
typedef struct __sFILE {
unsigned char *_p;
int _r;
int _w;
short _flags;
short _file;
struct __sbuf _bf;
int _lbfsize;
void *_cookie;
int (*_close)(void *);
int (*_read)(void *, char *, int);
fpos_t (*_seek)(void *, fpos_t, int);
int (*_write)(void *, const char *, int);
struct __sbuf _ext;
unsigned char *_up;
int _ur;
unsigned char _ubuf[3];
unsigned char _nbuf[1];
struct __sbuf _lb;
int _blksize;
fpos_t _offset;
} FILE;
extern FILE __sF[];
# 225 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/stdio.h" 3
4
void clearerr(FILE *);
int fclose(FILE *);
int feof(FILE *);
int ferror(FILE *);
int fflush(FILE *);
int fgetc(FILE *);
int fgetpos(FILE *, fpos_t *);
char *fgets(char *, int, FILE *)
__attribute__((__bounded__ (__string__,1,2)));
FILE *fopen(const char *, const char *);
int fprintf(FILE *, const char *, ...);
int fputc(int, FILE *);
int fputs(const char *, FILE *);
size_t fread(void *, size_t, size_t, FILE *)
__attribute__((__bounded__ (__size__,1,3,2)));
FILE *freopen(const char *, const char *, FILE *);
int fscanf(FILE *, const char *, ...);
int fseek(FILE *, long, int);
int fseeko(FILE *, off_t, int);
int fsetpos(FILE *, const fpos_t *);
long ftell(FILE *);
off_t ftello(FILE *);
size_t fwrite(const void *, size_t, size_t, FILE *)
__attribute__((__bounded__ (__size__,1,3,2)));
int getc(FILE *);
int getchar(void);
char *gets(char *);
extern int sys_nerr;
extern char *sys_errlist[];
void perror(const char *);
int printf(const char *, ...);
int putc(int, FILE *);
int putchar(int);
int puts(const char *);
int remove(const char *);
int rename(const char *, const char *);
void rewind(FILE *);
int scanf(const char *, ...);
void setbuf(FILE *, char *);
int setvbuf(FILE *, char *, int, size_t);
int sprintf(char *, const char *, ...);
int sscanf(const char *, const char *, ...);
FILE *tmpfile(void);
char *tmpnam(char *);
int ungetc(int, FILE *);
int vfprintf(FILE *, const char *, __gnuc_va_list);
int vprintf(const char *, __gnuc_va_list);
int vsprintf(char *, const char *, __gnuc_va_list);
int snprintf(char *, size_t, const char *, ...)
__attribute__((__format__ (printf, 3, 4)))
__attribute__((__nonnull__ (3)))
__attribute__((__bounded__ (__string__,1,2)));
int vfscanf(FILE *, const char *, __gnuc_va_list)
__attribute__((__format__ (scanf, 2, 0)))
__attribute__((__nonnull__ (2)));
int vscanf(const char *, __gnuc_va_list)
__attribute__((__format__ (scanf, 1, 0)))
__attribute__((__nonnull__ (1)));
int vsnprintf(char *, size_t, const char *, __gnuc_va_list)
__attribute__((__format__ (printf, 3, 0)))
__attribute__((__nonnull__ (3)))
__attribute__((__bounded__(__string__,1,2)));
int vsscanf(const char *, const char *, __gnuc_va_list)
__attribute__((__format__ (scanf, 2, 0)))
__attribute__((__nonnull__ (2)));
# 309 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/stdio.h" 3
4
char *ctermid(char *);
char *cuserid(char *);
FILE *fdopen(int, const char *);
int fileno(FILE *);
int pclose(FILE *);
FILE *popen(const char *, const char *);
void flockfile(FILE *);
int ftrylockfile(FILE *);
void funlockfile(FILE *);
int getc_unlocked(FILE *);
int getchar_unlocked(void);
int putc_unlocked(int, FILE *);
int putchar_unlocked(int);
char *tempnam(const char *, const char *);
int asprintf(char **, const char *, ...)
__attribute__((__format__ (printf, 2, 3)))
__attribute__((__nonnull__ (2)));
char *fgetln(FILE *, size_t *);
int fpurge(FILE *);
int getw(FILE *);
int putw(int, FILE *);
void setbuffer(FILE *, char *, int);
int setlinebuf(FILE *);
int vasprintf(char **, const char *, __gnuc_va_list)
__attribute__((__format__ (printf, 2, 0)))
__attribute__((__nonnull__ (2)));
FILE *funopen(const void *,
int (*)(void *, char *, int),
int (*)(void *, const char *, int),
fpos_t (*)(void *, fpos_t, int),
int (*)(void *));
int __srget(FILE *);
int __swbuf(int, FILE *);
static __inline int __sputc(int _c, FILE *_p) {
if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
return (*_p->_p++ = _c);
else
return (__swbuf(_c, _p));
}
# 414 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/stdio.h" 3
4
extern int __isthreaded;
# 45 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c" 2
# 1 "/usr/include/inttypes.h" 1 3 4
# 22 "/usr/include/inttypes.h" 3 4
# 1 "/usr/include/sys/stdint.h" 1 3 4
# 23 "/usr/include/inttypes.h" 2 3 4
# 249 "/usr/include/inttypes.h" 3 4
typedef struct {
intmax_t quot;
intmax_t rem;
} imaxdiv_t;
intmax_t imaxabs(intmax_t);
imaxdiv_t imaxdiv(intmax_t, intmax_t);
intmax_t strtoimax(const char *, char **, int);
uintmax_t strtoumax(const char *, char **, int);
intmax_t wcstoimax(const __wchar_t * __restrict,
__wchar_t ** __restrict, int);
uintmax_t wcstoumax(const __wchar_t * __restrict,
__wchar_t ** __restrict, int);
# 46 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c" 2
# 1 "/usr/include/sys/stat.h" 1 3 4
# 86 "/usr/include/sys/stat.h" 3 4
struct stat {
dev_t st_dev;
ino_t st_ino;
mode_t st_mode;
nlink_t st_nlink;
uid_t st_uid;
gid_t st_gid;
dev_t st_rdev;
int32_t st_lspare0;
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
# 107 "/usr/include/sys/stat.h" 3 4
off_t st_size;
int64_t st_blocks;
u_int32_t st_blksize;
u_int32_t st_flags;
u_int32_t st_gen;
int32_t st_lspare1;
struct timespec __st_birthtim;
int64_t st_qspare[2];
};
# 225 "/usr/include/sys/stat.h" 3 4
int chmod(const char *, mode_t);
int fstat(int, struct stat *);
int mknod(const char *, mode_t, dev_t);
int mkdir(const char *, mode_t);
int mkfifo(const char *, mode_t);
int stat(const char *, struct stat *);
mode_t umask(mode_t);
int chflags(const char *, unsigned int);
int fchflags(int, unsigned int);
int fchmod(int, mode_t);
int lstat(const char *, struct stat *);
int isfdtype(int, int);
# 47 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c" 2
# 1 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/unistd.h" 1 3
4
# 49 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/unistd.h" 3
4
# 1 "/usr/include/sys/unistd.h" 1 3 4
# 50 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/unistd.h" 2
3 4
# 75 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/unistd.h" 3
4
__attribute__((__noreturn__)) void _exit(int);
int access(const char *, int);
unsigned int alarm(unsigned int);
int chdir(const char *);
int chown(const char *, uid_t, gid_t);
int close(int);
int dup(int);
int dup2(int, int);
int execl(const char *, const char *, ...)
__attribute__((sentinel));
int execle(const char *, const char *, ...);
int execlp(const char *, const char *, ...)
__attribute__((sentinel));
int execv(const char *, char * const *);
int execve(const char *, char * const *, char * const *);
int execvp(const char *, char * const *);
pid_t fork(void);
long fpathconf(int, int);
char *getcwd(char *, size_t)
__attribute__((__bounded__(__string__,1,2)))
__attribute__((__bounded__(__minbytes__,1,1024)));
gid_t getegid(void);
uid_t geteuid(void);
gid_t getgid(void);
int getgroups(int, gid_t *);
char *getlogin(void);
pid_t getpgrp(void);
pid_t getpid(void);
pid_t getppid(void);
uid_t getuid(void);
int isatty(int);
int link(const char *, const char *);
off_t lseek(int, off_t, int);
long pathconf(const char *, int);
int pause(void);
int pipe(int *);
ssize_t read(int, void *, size_t)
__attribute__((__bounded__(__buffer__,2,3)));
int rmdir(const char *);
int setgid(gid_t);
int setuid(uid_t);
unsigned int sleep(unsigned int);
long sysconf(int);
pid_t tcgetpgrp(int);
int tcsetpgrp(int, pid_t);
char *ttyname(int);
int unlink(const char *);
ssize_t write(int, const void *, size_t)
__attribute__((__bounded__(__buffer__,2,3)));
pid_t setsid(void);
int setpgid(pid_t, pid_t);
size_t confstr(int, char *, size_t)
__attribute__((__bounded__(__string__,2,3)));
# 146 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/unistd.h" 3
4
int fsync(int);
int ftruncate(int, off_t);
int getlogin_r(char *, size_t)
__attribute__((__bounded__(__string__,1,2)))
__attribute__((__bounded__(__minbytes__,1,32)));
char *crypt(const char *, const char *);
int encrypt(char *, int);
int fchdir(int);
int fchown(int, uid_t, gid_t);
long gethostid(void);
char *getwd(char *)
__attribute__ ((__bounded__(__minbytes__,1,1024)));
int lchown(const char *, uid_t, gid_t);
int mkstemp(char *);
char *mktemp(char *);
int nice(int);
int readlink(const char *, char *, size_t)
__attribute__ ((__bounded__(__string__,2,3)));
int setkey(const char *);
int setpgrp(pid_t pid, pid_t pgrp);
int setregid(gid_t, gid_t);
int setreuid(uid_t, uid_t);
void swab(const void *, void *, size_t);
void sync(void);
int truncate(const char *, off_t);
unsigned int ualarm(unsigned int, unsigned int);
int usleep(useconds_t);
pid_t vfork(void);
pid_t getpgid(pid_t);
pid_t getsid(pid_t);
ssize_t pread(int, void *, size_t, off_t);
ssize_t pwrite(int, const void *, size_t, off_t);
int ttyname_r(int, char *, size_t)
__attribute__((__bounded__(__string__,2,3)));
int brk(void *);
int chroot(const char *);
int getdtablesize(void);
int getpagesize(void);
char *getpass(const char *);
void *sbrk(int);
int lockf(int, int, off_t);
int symlink(const char *, const char *);
int gethostname(char *, size_t)
__attribute__ ((__bounded__(__string__,1,2)));
int setegid(gid_t);
int seteuid(uid_t);
int acct(const char *);
int closefrom(int);
int des_cipher(const char *, char *, int32_t, int);
int des_setkey(const char *);
void endusershell(void);
int exect(const char *, char * const *, char * const *);
char *fflagstostr(u_int32_t);
int getdomainname(char *, size_t)
__attribute__ ((__bounded__(__string__,1,2)));
int getgrouplist(const char *, gid_t, gid_t *, int *);
mode_t getmode(const void *, mode_t);
int getresgid(gid_t *, gid_t *, gid_t *);
int getresuid(uid_t *, uid_t *, uid_t *);
char *getusershell(void);
int initgroups(const char *, gid_t);
int iruserok(u_int32_t, int, const char *, const char *);
int iruserok_sa(const void *, int, int, const char *, const char *);
int issetugid(void);
char *mkdtemp(char *);
int mkstemps(char *, int);
int nfssvc(int, void *);
int profil(char *, size_t, unsigned long, unsigned int)
__attribute__ ((__bounded__(__string__,1,2)));
int quotactl(const char *, int, int, char *);
int rcmd(char **, int, const char *,
const char *, const char *, int *);
int rcmd_af(char **, int, const char *,
const char *, const char *, int *, int);
int rcmdsh(char **, int, const char *,
const char *, const char *, char *);
char *re_comp(const char *);
int re_exec(const char *);
int reboot(int);
int revoke(const char *);
int rfork(int opts);
int rresvport(int *);
int rresvport_af(int *, int);
int ruserok(const char *, int, const char *, const char *);
int setdomainname(const char *, size_t);
int setgroups(int, const gid_t *);
int sethostid(long);
int sethostname(const char *, size_t);
int setlogin(const char *);
void *setmode(const char *);
int setresgid(gid_t, gid_t, gid_t);
int setresuid(uid_t, uid_t, uid_t);
int setrgid(gid_t);
int setruid(uid_t);
void setusershell(void);
int strtofflags(char **, u_int32_t *, u_int32_t *);
int swapctl(int cmd, const void *arg, int misc);
int syscall(int, ...);
# 48 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c" 2
# 1 "/usr/include/fcntl.h" 1 3 4
# 174 "/usr/include/fcntl.h" 3 4
struct flock {
off_t l_start;
off_t l_len;
pid_t l_pid;
short l_type;
short l_whence;
};
# 193 "/usr/include/fcntl.h" 3 4
int open(const char *, int, ...);
int creat(const char *, mode_t);
int fcntl(int, int, ...);
int flock(int, int);
# 49 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c" 2
# 1 "/usr/include/sys/wait.h" 1 3 4
# 104 "/usr/include/sys/wait.h" 3 4
union wait {
int w_status;
struct {
unsigned int w_Termsig:7,
w_Coredump:1,
w_Retcode:8,
w_Filler:16;
} w_T;
struct {
unsigned int w_Stopval:8,
w_Stopsig:8,
w_Filler:16;
} w_S;
};
# 153 "/usr/include/sys/wait.h" 3 4
struct rusage;
pid_t wait(int *);
pid_t waitpid(pid_t, int *, int);
pid_t wait3(int *, int, struct rusage *);
pid_t wait4(pid_t, int *, int, struct rusage *);
# 52 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c" 2
# 1 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/libiberty.h" 1
# 43 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/libiberty.h"
# 1 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/ansidecl.h" 1
# 44 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/libiberty.h" 2
# 1 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/stddef.h" 1 3
4
# 54 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/stddef.h" 3
4
typedef long int ptrdiff_t;
# 80 "/home/mrichmon/gcc-4.7-20110430/g95/./prev-gcc/include-fixed/stddef.h" 3
4
typedef __wint_t wint_t;
typedef __mbstate_t mbstate_t;
# 47 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/libiberty.h" 2
# 56 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/libiberty.h"
extern void unlock_stream (FILE *);
extern void unlock_std_streams (void);
extern FILE *fopen_unlocked (const char *, const char *);
extern FILE *fdopen_unlocked (int, const char *);
extern FILE *freopen_unlocked (const char *, const char *, FILE *);
extern char **buildargv (const char *) __attribute__ ((__malloc__));
extern void freeargv (char **);
extern char **dupargv (char **) __attribute__ ((__malloc__));
extern void expandargv (int *, char ***);
extern int writeargv (char **, FILE *);
# 106 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/libiberty.h"
extern char *basename (const char *);
# 117 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/libiberty.h"
extern const char *lbasename (const char *);
extern const char *dos_lbasename (const char *);
extern const char *unix_lbasename (const char *);
extern char *lrealpath (const char *);
extern char *concat (const char *, ...) __attribute__ ((__malloc__))
__attribute__ ((__sentinel__));
# 147 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/libiberty.h"
extern char *reconcat (char *, const char *, ...) __attribute__ ((__malloc__))
__attribute__ ((__sentinel__));
extern unsigned long concat_length (const char *, ...) __attribute__
((__sentinel__));
extern char *concat_copy (char *, const char *, ...) __attribute__
((__sentinel__));
extern char *concat_copy2 (const char *, ...) __attribute__ ((__sentinel__));
extern char *libiberty_concat_ptr;
# 183 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/libiberty.h"
extern int fdmatch (int fd1, int fd2);
# 195 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/libiberty.h"
extern char * getpwd (void);
# 208 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/libiberty.h"
extern long get_run_time (void);
extern char *make_relative_prefix (const char *, const char *,
const char *) __attribute__ ((__malloc__));
extern char *make_relative_prefix_ignore_links (const char *, const char *,
const char *) __attribute__ ((__malloc__));
extern char *choose_temp_base (void) __attribute__ ((__malloc__));
extern char *make_temp_file (const char *) __attribute__ ((__malloc__));
extern int unlink_if_ordinary (const char *);
extern const char *spaces (int count);
extern int errno_max (void);
extern const char *strerrno (int);
extern int strtoerrno (const char *);
extern char *xstrerror (int);
extern int signo_max (void);
# 272 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/libiberty.h"
extern const char *strsigno (int);
extern int strtosigno (const char *);
extern int xatexit (void (*fn) (void));
extern void xexit (int status) __attribute__ ((__noreturn__));
extern void xmalloc_set_program_name (const char *);
extern void xmalloc_failed (size_t) __attribute__ ((__noreturn__));
extern void *xmalloc (size_t) __attribute__ ((__malloc__));
extern void *xrealloc (void *, size_t);
extern void *xcalloc (size_t, size_t) __attribute__ ((__malloc__));
extern char *xstrdup (const char *) __attribute__ ((__malloc__));
extern char *xstrndup (const char *, size_t) __attribute__ ((__malloc__));
extern void *xmemdup (const void *, size_t, size_t) __attribute__
((__malloc__));
extern double physmem_total (void);
extern double physmem_available (void);
extern unsigned int xcrc32 (const unsigned char *, int, unsigned int);
# 371 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/libiberty.h"
extern const unsigned char _hex_value[256];
extern void hex_init (void);
# 397 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/libiberty.h"
extern struct pex_obj *pex_init (int flags, const char *pname,
const char *tempbase);
# 492 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/libiberty.h"
extern const char *pex_run (struct pex_obj *obj, int flags,
const char *executable, char * const *argv,
const char *outname, const char *errname,
int *err);
# 507 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/libiberty.h"
extern const char *pex_run_in_environment (struct pex_obj *obj, int flags,
const char *executable,
char * const *argv,
char * const *env,
const char *outname,
const char *errname, int *err);
extern FILE *pex_input_file (struct pex_obj *obj, int flags,
const char *in_name);
extern FILE *pex_input_pipe (struct pex_obj *obj, int binary);
extern FILE *pex_read_output (struct pex_obj *, int binary);
extern FILE *pex_read_err (struct pex_obj *, int binary);
extern int pex_get_status (struct pex_obj *, int count, int *vector);
struct pex_time
{
unsigned long user_seconds;
unsigned long user_microseconds;
unsigned long system_seconds;
unsigned long system_microseconds;
};
extern int pex_get_times (struct pex_obj *, int count,
struct pex_time *vector);
extern void pex_free (struct pex_obj *);
# 582 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/libiberty.h"
extern const char *pex_one (int flags, const char *executable,
char * const *argv, const char *pname,
const char *outname, const char *errname,
int *status, int *err);
# 601 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/libiberty.h"
extern int pexecute (const char *, char * const *, const char *,
const char *, char **, char **, int);
extern int pwait (int, int *, int);
extern int asprintf (char **, const char *, ...) __attribute__ ((__format__
(__printf__, 2, 3))) __attribute__ ((__nonnull__ (2)));
extern int vasprintf (char **, const char *, va_list) __attribute__
((__format__ (__printf__, 2, 0))) __attribute__ ((__nonnull__ (2)));
# 638 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/libiberty.h"
extern void setproctitle (const char *name, ...);
# 648 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/libiberty.h"
extern void *C_alloca (size_t) __attribute__ ((__malloc__));
# 60 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c" 2
# 1 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/hashtab.h" 1
# 47 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/hashtab.h"
typedef unsigned int hashval_t;
typedef hashval_t (*htab_hash) (const void *);
typedef int (*htab_eq) (const void *, const void *);
typedef void (*htab_del) (void *);
typedef int (*htab_trav) (void **, void *);
typedef void *(*htab_alloc) (size_t, size_t);
typedef void (*htab_free) (void *);
typedef void *(*htab_alloc_with_arg) (void *, size_t, size_t);
typedef void (*htab_free_with_arg) (void *, void *);
# 100 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/hashtab.h"
struct htab {
htab_hash hash_f;
htab_eq eq_f;
htab_del del_f;
void ** entries;
size_t size;
size_t n_elements;
size_t n_deleted;
unsigned int searches;
unsigned int collisions;
htab_alloc alloc_f;
htab_free free_f;
void * alloc_arg;
htab_alloc_with_arg alloc_with_arg_f;
htab_free_with_arg free_with_arg_f;
unsigned int size_prime_index;
};
typedef struct htab *htab_t;
enum insert_option {NO_INSERT, INSERT};
extern htab_t htab_create_alloc (size_t, htab_hash,
htab_eq, htab_del,
htab_alloc, htab_free);
extern htab_t htab_create_alloc_ex (size_t, htab_hash,
htab_eq, htab_del,
void *, htab_alloc_with_arg,
htab_free_with_arg);
extern htab_t htab_create_typed_alloc (size_t, htab_hash, htab_eq, htab_del,
htab_alloc, htab_alloc, htab_free);
extern htab_t htab_create (size_t, htab_hash, htab_eq, htab_del);
extern htab_t htab_try_create (size_t, htab_hash, htab_eq, htab_del);
extern void htab_set_functions_ex (htab_t, htab_hash,
htab_eq, htab_del,
void *, htab_alloc_with_arg,
htab_free_with_arg);
extern void htab_delete (htab_t);
extern void htab_empty (htab_t);
extern void * htab_find (htab_t, const void *);
extern void ** htab_find_slot (htab_t, const void *, enum insert_option);
extern void * htab_find_with_hash (htab_t, const void *, hashval_t);
extern void ** htab_find_slot_with_hash (htab_t, const void *,
hashval_t, enum insert_option);
extern void htab_clear_slot (htab_t, void **);
extern void htab_remove_elt (htab_t, void *);
extern void htab_remove_elt_with_hash (htab_t, void *, hashval_t);
extern void htab_traverse (htab_t, htab_trav, void *);
extern void htab_traverse_noresize (htab_t, htab_trav, void *);
extern size_t htab_size (htab_t);
extern size_t htab_elements (htab_t);
extern double htab_collisions (htab_t);
extern htab_hash htab_hash_pointer;
extern htab_eq htab_eq_pointer;
extern hashval_t htab_hash_string (const void *);
extern hashval_t iterative_hash (const void *, size_t, hashval_t);
# 61 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c" 2
# 1 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../gcc/lto/common.h" 1
# 23 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../gcc/lto/common.h"
static const char *lto_resolution_str[9] =
{
"UNKNOWN",
"UNDEF",
"PREVAILING_DEF",
"PREVAILING_DEF_IRONLY",
"PREEMPTED_REG",
"PREEMPTED_IR",
"RESOLVED_IR",
"RESOLVED_EXEC",
"RESOLVED_DYN"
};
# 62 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c" 2
# 1 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/simple-object.h" 1
# 42 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/simple-object.h"
typedef struct simple_object_read_struct simple_object_read;
# 55 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/simple-object.h"
extern simple_object_read *
simple_object_start_read (int descriptor, off_t offset,
const char *segment_name, const char **errmsg,
int *err);
# 70 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/simple-object.h"
extern const char *
simple_object_find_sections (simple_object_read *simple_object,
int (*pfn) (void *data, const char *,
off_t offset, off_t length),
void *data,
int *err);
# 93 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/simple-object.h"
extern int
simple_object_find_section (simple_object_read *simple_object,
const char *name, off_t *offset, off_t *length,
const char **errmsg, int *err);
extern void
simple_object_release_read (simple_object_read *);
typedef struct simple_object_attributes_struct simple_object_attributes;
extern simple_object_attributes *
simple_object_fetch_attributes (simple_object_read *simple_object,
const char **errmsg, int *err);
extern const char *
simple_object_attributes_merge (simple_object_attributes *to,
simple_object_attributes *from,
int *err);
extern void
simple_object_release_attributes (simple_object_attributes *attrs);
typedef struct simple_object_write_struct simple_object_write;
# 149 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/simple-object.h"
extern simple_object_write *
simple_object_start_write (simple_object_attributes *attrs,
const char *segment_name,
const char **errmsg, int *err);
typedef struct simple_object_write_section_struct simple_object_write_section;
# 167 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/simple-object.h"
extern simple_object_write_section *
simple_object_write_create_section (simple_object_write *simple_object,
const char *name, unsigned int align,
const char **errmsg, int *err);
# 179 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/simple-object.h"
extern const char *
simple_object_write_add_data (simple_object_write *simple_object,
simple_object_write_section *section,
const void *buffer, size_t size,
int copy, int *err);
extern const char *
simple_object_write_to_file (simple_object_write *simple_object,
int descriptor, int *err);
extern void
simple_object_release_write (simple_object_write *);
# 63 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c" 2
# 1 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/plugin-api.h" 1
# 47 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/../include/plugin-api.h"
enum ld_plugin_status
{
LDPS_OK = 0,
LDPS_NO_SYMS,
LDPS_BAD_HANDLE,
LDPS_ERR
};
enum ld_plugin_api_version
{
LD_PLUGIN_API_VERSION = 1
};
enum ld_plugin_output_file_type
{
LDPO_REL,
LDPO_EXEC,
LDPO_DYN
};
struct ld_plugin_input_file
{
const char *name;
int fd;
off_t offset;
off_t filesize;
void *handle;
};
struct ld_plugin_symbol
{
char *name;
char *version;
int def;
int visibility;
uint64_t size;
char *comdat_key;
int resolution;
};
enum ld_plugin_symbol_kind
{
LDPK_DEF,
LDPK_WEAKDEF,
LDPK_UNDEF,
LDPK_WEAKUNDEF,
LDPK_COMMON
};
enum ld_plugin_symbol_visibility
{
LDPV_DEFAULT,
LDPV_PROTECTED,
LDPV_INTERNAL,
LDPV_HIDDEN
};
enum ld_plugin_symbol_resolution
{
LDPR_UNKNOWN = 0,
LDPR_UNDEF,
LDPR_PREVAILING_DEF,
LDPR_PREVAILING_DEF_IRONLY,
LDPR_PREEMPTED_REG,
LDPR_PREEMPTED_IR,
LDPR_RESOLVED_IR,
LDPR_RESOLVED_EXEC,
LDPR_RESOLVED_DYN
};
typedef
enum ld_plugin_status
(*ld_plugin_claim_file_handler) (
const struct ld_plugin_input_file *file, int *claimed);
typedef
enum ld_plugin_status
(*ld_plugin_all_symbols_read_handler) (void);
typedef
enum ld_plugin_status
(*ld_plugin_cleanup_handler) (void);
typedef
enum ld_plugin_status
(*ld_plugin_register_claim_file) (ld_plugin_claim_file_handler handler);
typedef
enum ld_plugin_status
(*ld_plugin_register_all_symbols_read) (
ld_plugin_all_symbols_read_handler handler);
typedef
enum ld_plugin_status
(*ld_plugin_register_cleanup) (ld_plugin_cleanup_handler handler);
typedef
enum ld_plugin_status
(*ld_plugin_add_symbols) (void *handle, int nsyms,
const struct ld_plugin_symbol *syms);
typedef
enum ld_plugin_status
(*ld_plugin_get_input_file) (const void *handle,
struct ld_plugin_input_file *file);
typedef
enum ld_plugin_status
(*ld_plugin_get_view) (const void *handle, const void **viewp);
typedef
enum ld_plugin_status
(*ld_plugin_release_input_file) (const void *handle);
typedef
enum ld_plugin_status
(*ld_plugin_get_symbols) (const void *handle, int nsyms,
struct ld_plugin_symbol *syms);
typedef
enum ld_plugin_status
(*ld_plugin_add_input_file) (const char *pathname);
typedef
enum ld_plugin_status
(*ld_plugin_add_input_library) (const char *libname);
typedef
enum ld_plugin_status
(*ld_plugin_set_extra_library_path) (const char *path);
typedef
enum ld_plugin_status
(*ld_plugin_message) (int level, const char *format, ...);
enum ld_plugin_level
{
LDPL_INFO,
LDPL_WARNING,
LDPL_ERROR,
LDPL_FATAL
};
enum ld_plugin_tag
{
LDPT_NULL = 0,
LDPT_API_VERSION,
LDPT_GOLD_VERSION,
LDPT_LINKER_OUTPUT,
LDPT_OPTION,
LDPT_REGISTER_CLAIM_FILE_HOOK,
LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK,
LDPT_REGISTER_CLEANUP_HOOK,
LDPT_ADD_SYMBOLS,
LDPT_GET_SYMBOLS,
LDPT_ADD_INPUT_FILE,
LDPT_MESSAGE,
LDPT_GET_INPUT_FILE,
LDPT_RELEASE_INPUT_FILE,
LDPT_ADD_INPUT_LIBRARY,
LDPT_OUTPUT_NAME,
LDPT_SET_EXTRA_LIBRARY_PATH,
LDPT_GNU_LD_VERSION,
LDPT_GET_VIEW
};
struct ld_plugin_tv
{
enum ld_plugin_tag tv_tag;
union
{
int tv_val;
const char *tv_string;
ld_plugin_register_claim_file tv_register_claim_file;
ld_plugin_register_all_symbols_read tv_register_all_symbols_read;
ld_plugin_register_cleanup tv_register_cleanup;
ld_plugin_add_symbols tv_add_symbols;
ld_plugin_get_symbols tv_get_symbols;
ld_plugin_add_input_file tv_add_input_file;
ld_plugin_message tv_message;
ld_plugin_get_input_file tv_get_input_file;
ld_plugin_get_view tv_get_view;
ld_plugin_release_input_file tv_release_input_file;
ld_plugin_add_input_library tv_add_input_library;
ld_plugin_set_extra_library_path tv_set_extra_library_path;
} tv_u;
};
typedef
enum ld_plugin_status
(*ld_plugin_onload) (struct ld_plugin_tv *tv);
# 64 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c" 2
# 85 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c"
struct sym_aux
{
uint32_t slot;
unsigned id;
unsigned next_conflict;
};
struct plugin_symtab
{
int nsyms;
struct sym_aux *aux;
struct ld_plugin_symbol *syms;
unsigned id;
};
struct plugin_objfile
{
int found;
simple_object_read *objfile;
struct plugin_symtab *out;
const struct ld_plugin_input_file *file;
};
struct plugin_file_info
{
char *name;
void *handle;
struct plugin_symtab symtab;
struct plugin_symtab conflicts;
};
enum symbol_style
{
ss_none,
ss_win32,
ss_uscore,
};
static char *arguments_file_name;
static ld_plugin_register_claim_file register_claim_file;
static ld_plugin_register_all_symbols_read register_all_symbols_read;
static ld_plugin_get_symbols get_symbols;
static ld_plugin_register_cleanup register_cleanup;
static ld_plugin_add_input_file add_input_file;
static ld_plugin_add_input_library add_input_library;
static ld_plugin_message message;
static ld_plugin_add_symbols add_symbols;
static struct plugin_file_info *claimed_files = 0;
static unsigned int num_claimed_files = 0;
static char **output_files = 0;
static unsigned int num_output_files = 0;
static char **lto_wrapper_argv;
static int lto_wrapper_num_args;
static char **pass_through_items = 0;
static unsigned int num_pass_through_items;
static char debug;
static char nop;
static char *resolution_file = 0;
static int gold_version = -1;
static enum symbol_style sym_style = ss_none;
static void
check_1 (int gate, enum ld_plugin_level level, const char *text)
{
if (gate)
return;
if (message)
message (level, text);
else
{
fprintf ((&__sF[2]), "%s\n", text);
if (level == LDPL_FATAL)
abort ();
}
}
# 190 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c"
static char *
parse_table_entry (char *p, struct ld_plugin_symbol *entry,
struct sym_aux *aux)
{
unsigned char t;
enum ld_plugin_symbol_kind translate_kind[] =
{
LDPK_DEF,
LDPK_WEAKDEF,
LDPK_UNDEF,
LDPK_WEAKUNDEF,
LDPK_COMMON
};
enum ld_plugin_symbol_visibility translate_visibility[] =
{
LDPV_DEFAULT,
LDPV_PROTECTED,
LDPV_INTERNAL,
LDPV_HIDDEN
};
switch (sym_style)
{
case ss_win32:
if (p[0] == '@')
{
case ss_none:
entry->name = xstrdup (p);
break;
}
case ss_uscore:
entry->name = concat ("_", p, 0);
break;
default:
check_1 (((0) != 0), (LDPL_FATAL), ("invalid symbol style requested"));
break;
}
while (*p)
p++;
p++;
entry->version = 0;
entry->comdat_key = p;
while (*p)
p++;
p++;
if (strlen (entry->comdat_key) == 0)
entry->comdat_key = 0;
else
entry->comdat_key = xstrdup (entry->comdat_key);
t = *p;
check_1 (((t <= 4) != 0), (LDPL_FATAL), ("invalid symbol kind found"));
entry->def = translate_kind[t];
p++;
t = *p;
check_1 (((t <= 3) != 0), (LDPL_FATAL), ("invalid symbol visibility found"));
entry->visibility = translate_visibility[t];
p++;
memcpy (&entry->size, p, sizeof (uint64_t));
p += 8;
memcpy (&aux->slot, p, sizeof (uint32_t));
p += 4;
entry->resolution = LDPR_UNKNOWN;
aux->next_conflict = -1;
return p;
}
static void
translate (char *data, char *end, struct plugin_symtab *out)
{
struct sym_aux *aux;
struct ld_plugin_symbol *syms = 0;
int n, len;
len = (end - data)/8 + out->nsyms + 1;
syms = xrealloc (out->syms, len * sizeof (struct ld_plugin_symbol));
aux = xrealloc (out->aux, len * sizeof (struct sym_aux));
for (n = out->nsyms; data < end; n++)
{
aux[n].id = out->id;
data = parse_table_entry (data, &syms[n], &aux[n]);
}
((n < len) ? (void)0 :
__assert2("/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c", 292,
__func__, "n < len"));
out->nsyms = n;
out->syms = syms;
out->aux = aux;
}
static void
free_1 (void)
{
unsigned int i;
for (i = 0; i < num_claimed_files; i++)
{
struct plugin_file_info *info = &claimed_files[i];
struct plugin_symtab *symtab = &info->symtab;
unsigned int j;
for (j = 0; j < symtab->nsyms; j++)
{
struct ld_plugin_symbol *s = &symtab->syms[j];
free (s->name);
free (s->comdat_key);
}
free (symtab->syms);
symtab->syms = 0;
}
}
static void
free_2 (void)
{
unsigned int i;
for (i = 0; i < num_claimed_files; i++)
{
struct plugin_file_info *info = &claimed_files[i];
struct plugin_symtab *symtab = &info->symtab;
free (symtab->aux);
free (info->name);
}
for (i = 0; i < num_output_files; i++)
free (output_files[i]);
free (output_files);
free (claimed_files);
claimed_files = 0;
num_claimed_files = 0;
free (arguments_file_name);
arguments_file_name = 0;
}
static void
dump_symtab (FILE *f, struct plugin_symtab *symtab)
{
unsigned j;
for (j = 0; j < symtab->nsyms; j++)
{
uint32_t slot = symtab->aux[j].slot;
unsigned int resolution = symtab->syms[j].resolution;
((resolution != LDPR_UNKNOWN) ? (void)0 :
__assert2("/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c", 360,
__func__, "resolution != LDPR_UNKNOWN"));
fprintf (f, "%u %x %s %s\n", (unsigned int) slot, symtab->aux[j].id,
lto_resolution_str[resolution],
symtab->syms[j].name);
}
}
static void
finish_conflict_resolution (struct plugin_symtab *symtab,
struct plugin_symtab *conflicts)
{
int i, j;
if (conflicts->nsyms == 0)
return;
for (i = 0; i < symtab->nsyms; i++)
{
int resolution = LDPR_UNKNOWN;
if (symtab->aux[i].next_conflict == -1)
continue;
switch (symtab->syms[i].def)
{
case LDPK_DEF:
case LDPK_COMMON:
resolution = LDPR_RESOLVED_IR;
break;
case LDPK_WEAKDEF:
resolution = LDPR_PREEMPTED_IR;
break;
case LDPK_UNDEF:
case LDPK_WEAKUNDEF:
resolution = symtab->syms[i].resolution;
break;
default:
((0) ? (void)0 :
__assert2("/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c", 401,
__func__, "0"));
}
((resolution != LDPR_UNKNOWN) ? (void)0 :
__assert2("/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c", 404,
__func__, "resolution != LDPR_UNKNOWN"));
for (j = symtab->aux[i].next_conflict;
j != -1;
j = conflicts->aux[j].next_conflict)
conflicts->syms[j].resolution = resolution;
}
}
static void
free_symtab (struct plugin_symtab *symtab)
{
free (symtab->syms);
symtab->syms = 0;
free (symtab->aux);
symtab->aux = 0;
}
static void
write_resolution (void)
{
unsigned int i;
FILE *f;
check_1 (((resolution_file) != 0), (LDPL_FATAL), ("resolution file not
specified"));
f = fopen (resolution_file, "w");
check_1 (((f) != 0), (LDPL_FATAL), ("could not open file"));
fprintf (f, "%d\n", num_claimed_files);
for (i = 0; i < num_claimed_files; i++)
{
struct plugin_file_info *info = &claimed_files[i];
struct plugin_symtab *symtab = &info->symtab;
struct ld_plugin_symbol *syms = symtab->syms;
get_symbols (info->handle, symtab->nsyms, syms);
finish_conflict_resolution (symtab, &info->conflicts);
fprintf (f, "%s %d\n", info->name, symtab->nsyms +
info->conflicts.nsyms);
dump_symtab (f, symtab);
if (info->conflicts.nsyms)
{
dump_symtab (f, &info->conflicts);
free_symtab (&info->conflicts);
}
}
fclose (f);
}
static void
add_output_files (FILE *f)
{
for (;;)
{
const unsigned piece = 32;
char *buf, *s = xmalloc (piece);
size_t len;
buf = s;
cont:
if (!fgets (buf, piece, f))
{
free (s);
break;
}
len = strlen (s);
if (s[len - 1] != '\n')
{
s = xrealloc (s, len + piece);
buf = s + len;
goto cont;
}
s[len - 1] = '\0';
num_output_files++;
output_files
= xrealloc (output_files, num_output_files * sizeof (char *));
output_files[num_output_files - 1] = s;
add_input_file (output_files[num_output_files - 1]);
}
}
static void
exec_lto_wrapper (char *argv[])
{
int t, i;
int status;
char *at_args;
FILE *args;
FILE *wrapper_output;
char *new_argv[3];
struct pex_obj *pex;
const char *errmsg;
arguments_file_name = make_temp_file ("");
check_1 (((arguments_file_name) != 0), (LDPL_FATAL), ("Failed to generate a
temorary file name"))
;
args = fopen (arguments_file_name, "w");
check_1 (((args) != 0), (LDPL_FATAL), ("could not open arguments file"));
t = writeargv (&argv[1], args);
check_1 (((t == 0) != 0), (LDPL_FATAL), ("could not write arguments"));
t = fclose (args);
check_1 (((t == 0) != 0), (LDPL_FATAL), ("could not close arguments file"));
at_args = concat ("@", arguments_file_name, 0);
check_1 (((at_args) != 0), (LDPL_FATAL), ("could not allocate"));
for (i = 1; argv[i]; i++)
{
char *a = argv[i];
if (a[0] == '-' && a[1] == 'v' && a[2] == '\0')
{
for (i = 0; argv[i]; i++)
fprintf ((&__sF[2]), "%s ", argv[i]);
fprintf ((&__sF[2]), "\n");
break;
}
}
new_argv[0] = argv[0];
new_argv[1] = at_args;
new_argv[2] = 0;
if (debug)
{
for (i = 0; new_argv[i]; i++)
fprintf ((&__sF[2]), "%s ", new_argv[i]);
fprintf ((&__sF[2]), "\n");
}
pex = pex_init (0x2, "lto-wrapper", 0);
check_1 (((pex != 0) != 0), (LDPL_FATAL), ("could not pex_init
lto-wrapper"));
errmsg = pex_run (pex, 0, new_argv[0], new_argv, 0, 0, &t);
check_1 (((errmsg == 0) != 0), (LDPL_FATAL), ("could not run lto-wrapper"));
check_1 (((t == 0) != 0), (LDPL_FATAL), ("could not run lto-wrapper"));
wrapper_output = pex_read_output (pex, 0);
check_1 (((wrapper_output) != 0), (LDPL_FATAL), ("could not read lto-wrapper
output"));
add_output_files (wrapper_output);
t = pex_get_status (pex, 1, &status);
check_1 (((t == 1) != 0), (LDPL_FATAL), ("could not get lto-wrapper exit
status"));
check_1 ((((((*(int *)&(status)) & 0177) == 0) && (int)(((unsigned)(*(int
*)&(status)) >> 8) & 0xff) == 0) != 0), (LDPL_FATAL), ("lto-wrapper failed"))
;
pex_free (pex);
free (at_args);
}
static void
use_original_files (void)
{
unsigned i;
for (i = 0; i < num_claimed_files; i++)
{
struct plugin_file_info *info = &claimed_files[i];
add_input_file (info->name);
}
}
static enum ld_plugin_status
all_symbols_read_handler (void)
{
unsigned i;
unsigned num_lto_args = num_claimed_files + lto_wrapper_num_args + 1;
char **lto_argv;
const char **lto_arg_ptr;
if (num_claimed_files == 0)
return LDPS_OK;
if (nop)
{
use_original_files ();
return LDPS_OK;
}
lto_argv = (char **) xcalloc (sizeof (char *), num_lto_args);
lto_arg_ptr = (const char **) lto_argv;
((lto_wrapper_argv) ? (void)0 :
__assert2("/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c", 606,
__func__, "lto_wrapper_argv"));
write_resolution ();
free_1 ();
for (i = 0; i < lto_wrapper_num_args; i++)
*lto_arg_ptr++ = lto_wrapper_argv[i];
for (i = 0; i < num_claimed_files; i++)
{
struct plugin_file_info *info = &claimed_files[i];
*lto_arg_ptr++ = info->name;
}
*lto_arg_ptr++ = 0;
exec_lto_wrapper (lto_argv);
free (lto_argv);
if (pass_through_items && gold_version < 111)
{
unsigned int i;
for (i = 0; i < num_pass_through_items; i++)
{
if (strncmp (pass_through_items[i], "-l", 2) == 0)
add_input_library (pass_through_items[i] + 2);
else
add_input_file (pass_through_items[i]);
free (pass_through_items[i]);
pass_through_items[i] = 0;
}
free (pass_through_items);
pass_through_items = 0;
}
return LDPS_OK;
}
static enum ld_plugin_status
cleanup_handler (void)
{
unsigned int i;
int t;
if (debug)
return LDPS_OK;
if (arguments_file_name)
{
t = unlink (arguments_file_name);
check_1 (((t == 0) != 0), (LDPL_FATAL), ("could not unlink arguments
file"));
}
for (i = 0; i < num_output_files; i++)
{
t = unlink (output_files[i]);
check_1 (((t == 0) != 0), (LDPL_FATAL), ("could not unlink output
file"));
}
free_2 ();
return LDPS_OK;
}
static int eq_sym (const void *a, const void *b)
{
const struct ld_plugin_symbol *as = (const struct ld_plugin_symbol *)a;
const struct ld_plugin_symbol *bs = (const struct ld_plugin_symbol *)b;
return !strcmp (as->name, bs->name);
}
static hashval_t hash_sym (const void *a)
{
const struct ld_plugin_symbol *as = (const struct ld_plugin_symbol *)a;
return htab_hash_string (as->name);
}
static int symbol_strength (struct ld_plugin_symbol *s)
{
switch (s->def)
{
case LDPK_UNDEF:
case LDPK_WEAKUNDEF:
return 0;
case LDPK_WEAKDEF:
return 1;
default:
return 2;
}
}
# 730 "/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c"
static void
resolve_conflicts (struct plugin_symtab *t, struct plugin_symtab *conflicts)
{
htab_t symtab = htab_create (t->nsyms, hash_sym, eq_sym, 0);
int i;
int out;
int outlen;
outlen = t->nsyms;
conflicts->syms = xmalloc (sizeof (struct ld_plugin_symbol) * outlen);
conflicts->aux = xmalloc (sizeof (struct sym_aux) * outlen);
out = 0;
for (i = 0; i < t->nsyms; i++)
{
struct ld_plugin_symbol *s = &t->syms[i];
struct sym_aux *aux = &t->aux[i];
void **slot;
slot = htab_find_slot (symtab, s, INSERT);
if (*slot != 0)
{
int cnf;
struct ld_plugin_symbol *orig = (struct ld_plugin_symbol *)*slot;
struct sym_aux *orig_aux = &t->aux[orig - t->syms];
if (symbol_strength (orig) < symbol_strength (s))
{
do { struct ld_plugin_symbol tmp_; tmp_ = (*orig); (*orig) = (*s); (*s)
= tmp_; } while(0);
do { uint32_t tmp_; tmp_ = (orig_aux->slot); (orig_aux->slot) =
(aux->slot); (aux->slot) = tmp_; } while(0);
do { unsigned tmp_; tmp_ = (orig_aux->id); (orig_aux->id) = (aux->id);
(aux->id) = tmp_; } while(0);
}
cnf = conflicts->nsyms++;
conflicts->syms[cnf] = *s;
conflicts->aux[cnf] = *aux;
aux = &conflicts->aux[cnf];
aux->next_conflict = orig_aux->next_conflict;
orig_aux->next_conflict = cnf;
continue;
}
if (out < i)
{
t->syms[out] = *s;
t->aux[out] = *aux;
}
*slot = &t->syms[out];
out++;
}
((conflicts->nsyms <= outlen) ? (void)0 :
__assert2("/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c", 791,
__func__, "conflicts->nsyms <= outlen"));
((conflicts->nsyms + out == t->nsyms) ? (void)0 :
__assert2("/home/mrichmon/gcc-4.7-20110430/lto-plugin/lto-plugin.c", 792,
__func__, "conflicts->nsyms + out == t->nsyms"));
t->nsyms = out;
htab_delete (symtab);
}
static int
process_symtab (void *data, const char *name, off_t offset, off_t length)
{
struct plugin_objfile *obj = (struct plugin_objfile *)data;
char *s;
char *secdata;
if (strncmp (name, ".gnu.lto_.symtab", (sizeof (".gnu.lto_.symtab") - 1)) !=
0)
return 1;
^ permalink raw reply [flat|nested] 27+ messages in thread