diff --recursive --new-file -c orig/gcc-2.7.0/collect2.c gcc-2.7.0/collect2.c *** orig/gcc-2.7.0/collect2.c Thu Jun 15 07:17:35 1995 --- gcc-2.7.0/collect2.c Sun Jun 18 23:13:24 1995 *************** *** 72,82 **** #endif /* Add prototype support. */ ! #ifndef PROTO #if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__) ! #define PROTO(ARGS) ARGS #else ! #define PROTO(ARGS) () #endif #endif --- 72,82 ---- #endif /* Add prototype support. */ ! #ifndef PPROTO #if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__) ! #define PPROTO(ARGS) ARGS #else ! #define PPROTO(ARGS) () #endif #endif *************** *** 132,137 **** --- 132,140 ---- #define OBJECT_FORMAT_NONE #endif + #ifdef USE_BFD + #include "bfd.h" + #else #ifdef OBJECT_FORMAT_COFF #include *************** *** 186,191 **** --- 189,195 ---- #endif #endif /* OBJECT_FORMAT_NONE */ + #endif /* USE_BFD */ /* Some systems use __main in a way incompatible with its use in gcc, in these cases use the macros NAME__MAIN to give a quoted symbol and SYMBOL__MAIN to *************** *** 291,317 **** char *name; /* Name of this list (used in config stuff) */ }; ! void collect_exit PROTO((int)); ! void collect_execute PROTO((char *, char **, char *)); ! void dump_file PROTO((char *)); ! static void handler PROTO((int)); ! static int is_ctor_dtor PROTO((char *)); ! static void choose_temp_base PROTO((void)); ! static int is_in_prefix_list PROTO((struct path_prefix *, char *, int)); ! static char *find_a_file PROTO((struct path_prefix *, char *)); ! static void add_prefix PROTO((struct path_prefix *, char *)); ! static void prefix_from_env PROTO((char *, struct path_prefix *)); ! static void prefix_from_string PROTO((char *, struct path_prefix *)); ! static void do_wait PROTO((char *)); ! static void fork_execute PROTO((char *, char **)); ! static void maybe_unlink PROTO((char *)); ! static void add_to_list PROTO((struct head *, char *)); ! static void write_list PROTO((FILE *, char *, struct id *)); ! static void write_list_with_asm PROTO((FILE *, char *, struct id *)); ! static void write_c_file PROTO((FILE *, char *)); ! static void write_export_file PROTO((FILE *)); ! static void scan_prog_file PROTO((char *, enum pass)); ! static void scan_libraries PROTO((char *)); char *xcalloc (); char *xmalloc (); --- 295,321 ---- char *name; /* Name of this list (used in config stuff) */ }; ! void collect_exit PPROTO((int)); ! void collect_execute PPROTO((char *, char **, char *)); ! void dump_file PPROTO((char *)); ! static void handler PPROTO((int)); ! static int is_ctor_dtor PPROTO((char *)); ! static void choose_temp_base PPROTO((void)); ! static int is_in_prefix_list PPROTO((struct path_prefix *, char *, int)); ! static char *find_a_file PPROTO((struct path_prefix *, char *)); ! static void add_prefix PPROTO((struct path_prefix *, char *)); ! static void prefix_from_env PPROTO((char *, struct path_prefix *)); ! static void prefix_from_string PPROTO((char *, struct path_prefix *)); ! static void do_wait PPROTO((char *)); ! static void fork_execute PPROTO((char *, char **)); ! static void maybe_unlink PPROTO((char *)); ! static void add_to_list PPROTO((struct head *, char *)); ! static void write_list PPROTO((FILE *, char *, struct id *)); ! static void write_list_with_asm PPROTO((FILE *, char *, struct id *)); ! static void write_c_file PPROTO((FILE *, char *)); ! static void write_export_file PPROTO((FILE *)); ! static void scan_prog_file PPROTO((char *, enum pass)); ! static void scan_libraries PPROTO((char *)); char *xcalloc (); char *xmalloc (); *************** *** 2465,2470 **** --- 2469,2475 ---- constructor functions, terminated with a null pointer. The destructor table has the same format, and begins at __DTOR_LIST__. */ + #ifndef USE_BFD static void scan_prog_file (prog_name, which_pass) char *prog_name; *************** *** 2545,2551 **** --- 2550,2637 ---- (void) ldclose(ldptr); } + #else + #include "bfd.h" + static void + scan_prog_file (prog_name, which_pass) + char *prog_name; + enum pass which_pass; + { + bfd *curr_bfd; + long storage_needed; + asymbol **symbol_table; + long number_of_symbols; + long i; + char **matching; + + if (which_pass != PASS_FIRST && which_pass != PASS_OBJ) + return; + curr_bfd=bfd_openr(prog_name,NULL); + if(curr_bfd==NULL) { + fatal("%s: can't open with BFD", prog_name); + } + + if (!bfd_check_format_matches (curr_bfd, bfd_object, &matching)) + { + fatal("invalid object type"); + } + + storage_needed = bfd_get_symtab_upper_bound (curr_bfd); + + if (storage_needed < 0) { + fatal("couldn't get needed storage for processing symbols"); + } + + if (storage_needed == 0) { + fprintf(stderr,"no symbols in %s??\n",prog_name); + return ; + } + symbol_table = (asymbol **) xmalloc (storage_needed); + + number_of_symbols = bfd_canonicalize_symtab (curr_bfd, symbol_table); + + if (number_of_symbols < 0) { + fatal("bfd_canonicalize_symtab failed"); + } + + for (i = 0; i < number_of_symbols; i++) { + symbol_info syminfo; + + bfd_get_symbol_info(curr_bfd,symbol_table[i],&syminfo); + if(syminfo.type=='T') { + char *name=symbol_table[i]->name; + switch(is_ctor_dtor(symbol_table[i]->name)) { + case 1: + { + add_to_list(&constructors, name); + if (which_pass == PASS_OBJ) { + add_to_list (&exports, name); + } + } + break; + + case 2: + { + add_to_list (&destructors, name); + if (which_pass == PASS_OBJ) { + add_to_list (&exports, name); + } + break; + } + default: + { + if (which_pass == PASS_OBJ && auto_export) { + add_to_list (&exports, name); + } + } + } + } + } + bfd_close(curr_bfd); + } + #endif /* USE_BFD */ + #endif /* OBJECT_FORMAT_COFF */ *************** *** 2596,2608 **** extern int decode_mach_o_hdr (); extern int encode_mach_o_hdr (); ! static void add_func_table PROTO((mo_header_t *, load_all_t *, symbol_info_t *, int)); ! static void print_header PROTO((mo_header_t *)); ! static void print_load_command PROTO((load_union_t*, size_t, int)); ! static void bad_header PROTO((int)); ! static struct file_info *read_file PROTO((char *, int, int)); ! static void end_file PROTO((struct file_info *)); /* OSF/rose specific version to scan the name list of the loaded program for the symbols g++ uses for static constructors and --- 2682,2694 ---- extern int decode_mach_o_hdr (); extern int encode_mach_o_hdr (); ! static void add_func_table PPROTO((mo_header_t *, load_all_t *, symbol_info_t *, int)); ! static void print_header PPROTO((mo_header_t *)); ! static void print_load_command PPROTO((load_union_t*, size_t, int)); ! static void bad_header PPROTO((int)); ! static struct file_info *read_file PPROTO((char *, int, int)); ! static void end_file PPROTO((struct file_info *)); /* OSF/rose specific version to scan the name list of the loaded program for the symbols g++ uses for static constructors and diff --recursive --new-file -c orig/gcc-2.7.0/config/alpha/alpha.c gcc-2.7.0/config/alpha/alpha.c *** orig/gcc-2.7.0/config/alpha/alpha.c Fri Jun 16 06:57:32 1995 --- gcc-2.7.0/config/alpha/alpha.c Wed Jun 21 01:41:27 1995 *************** *** 1362,1367 **** --- 1362,1372 ---- We never need a GP for Windows/NT. */ alpha_function_needs_gp = 0; + #ifdef __linux__ + if(profile_flag) { + alpha_function_needs_gp = 1; + } + #endif for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) if ((GET_CODE (insn) == CALL_INSN) || (GET_RTX_CLASS (GET_CODE (insn)) == 'i' diff --recursive --new-file -c orig/gcc-2.7.0/config/alpha/alpha.h gcc-2.7.0/config/alpha/alpha.h *** orig/gcc-2.7.0/config/alpha/alpha.h Thu Jun 15 09:08:45 1995 --- gcc-2.7.0/config/alpha/alpha.h Sun Jun 18 23:22:27 1995 *************** *** 114,120 **** --- 114,122 ---- {"gas", MASK_GAS}, \ {"", TARGET_DEFAULT | TARGET_CPU_DEFAULT} } + #ifndef TARGET_DEFAULT #define TARGET_DEFAULT 3 + #endif #ifndef TARGET_CPU_DEFAULT #define TARGET_CPU_DEFAULT 0 diff --recursive --new-file -c orig/gcc-2.7.0/config/alpha/linux-64.h gcc-2.7.0/config/alpha/linux-64.h *** orig/gcc-2.7.0/config/alpha/linux-64.h Wed Dec 31 19:00:00 1969 --- gcc-2.7.0/config/alpha/linux-64.h Tue Jun 20 23:10:01 1995 *************** *** 0 **** --- 1,69 ---- + /* Definitions of target machine for GNU compiler, for Alpha Linux, + using ECOFF. + Copyright (C) 1995 Free Software Foundation, Inc. + Contributed by Bob Manson. + Derived from work contributed by Cygnus Support, + (c) 1993 Free Software Foundation. + + This file is part of GNU CC. + + GNU CC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU CC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU CC; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + #define TARGET_DEFAULT (3 | MASK_GAS) + + #include "alpha/alpha.h" + + #undef TARGET_VERSION + #define TARGET_VERSION fprintf (stderr, " (Alpha Linux 4 64bit)"); + + #undef CPP_PREDEFINES + #define CPP_PREDEFINES "\ + -D__alpha -D__alpha__ -D__linux__ -D__linux -D_LONGLONG -Dlinux \ + -Asystem(linux) -Acpu(alpha) -Amachine(alpha)" + + /* We don't actually need any of these; the MD_ vars are ignored + anyway for cross-compilers, and the other specs won't get picked up + 'coz the user is supposed to do ld -r (hmm, perhaps that should be + the default). In any case, setting them thus will catch some + common user errors. */ + + #undef MD_EXEC_PREFIX + #undef MD_STARTFILE_PREFIX + + #undef LIB_SPEC + #define LIB_SPEC "%{pg:-lgmon} %{pg:-lc_p} %{!pg:-lc}" + + #undef LINK_SPEC + #define LINK_SPEC \ + "-G 8 %{O*:-O3} %{!O*:-O1}" + + #undef ASM_SPEC + #define ASM_SPEC "-nocpp" + + /* Can't do stabs */ + #undef SDB_DEBUGGING_INFO + + /* Prefer dbx. */ + #undef PREFERRED_DEBUGGING_TYPE + #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG + + #undef FUNCTION_PROFILER + + #define FUNCTION_PROFILER(FILE, LABELNO) \ + do { \ + fputs ("\tlda $27,_mcount\n", (FILE)); \ + fputs ("\tjsr $26,($27),_mcount\n", (FILE)); \ + fputs ("\tldgp $29,0($26)\n", (FILE)); \ + } while (0); diff --recursive --new-file -c orig/gcc-2.7.0/config/alpha/t-linux gcc-2.7.0/config/alpha/t-linux *** orig/gcc-2.7.0/config/alpha/t-linux Wed Dec 31 19:00:00 1969 --- gcc-2.7.0/config/alpha/t-linux Mon Jun 19 00:58:50 1995 *************** *** 0 **** --- 1,7 ---- + # This file is CYGNUS LOCAL in order to not build libgcc1.a. + LIBGCC1 = libgcc1.null + CROSS_LIBGCC1 = libgcc1.null + + # Our header files are supposed to be correct, nein? + FIXINCLUDES = + STMP_FIXPROTO = diff --recursive --new-file -c orig/gcc-2.7.0/config/alpha/x-linux gcc-2.7.0/config/alpha/x-linux *** orig/gcc-2.7.0/config/alpha/x-linux Wed Dec 31 19:00:00 1969 --- gcc-2.7.0/config/alpha/x-linux Tue Jun 20 23:00:23 1995 *************** *** 0 **** --- 1 ---- + CLIB=-lbfd diff --recursive --new-file -c orig/gcc-2.7.0/config/alpha/xm-linux.h gcc-2.7.0/config/alpha/xm-linux.h *** orig/gcc-2.7.0/config/alpha/xm-linux.h Wed Dec 31 19:00:00 1969 --- gcc-2.7.0/config/alpha/xm-linux.h Sun Jun 18 23:21:47 1995 *************** *** 0 **** --- 1,8 ---- + #ifndef _XM_LINUX_H + #define _XM_LINUX_H + + #include "xm-alpha.h" + + #define DONT_DECLARE_SYS_SIGLIST + #define USE_BFD + #endif diff --recursive --new-file -c orig/gcc-2.7.0/config.guess gcc-2.7.0/config.guess *** orig/gcc-2.7.0/config.guess Thu Jun 15 18:11:14 1995 --- gcc-2.7.0/config.guess Wed Jun 21 01:51:48 1995 *************** *** 61,66 **** --- 61,69 ---- exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 + exit 0 ;; + alpha:Linux:*:*) + echo alpha-dec-linux exit 0 ;; amiga:NetBSD:*:*) echo m68k-cbm-netbsd${UNAME_RELEASE} diff --recursive --new-file -c orig/gcc-2.7.0/configure gcc-2.7.0/configure *** orig/gcc-2.7.0/configure Thu Jun 15 17:54:14 1995 --- gcc-2.7.0/configure Wed Jun 21 01:53:39 1995 *************** *** 583,588 **** --- 583,596 ---- broken_install=yes use_collect2=yes ;; + alpha-*-linux*) + tm_file=alpha/linux-64.h + tmake_file=alpha/t-linux + use_collect2=yes + xmake_file=alpha/x-linux + fixincludes=Makefile.in + xm_file=alpha/xm-linux.h + ;; alpha-*-winnt3*) tm_file=alpha/winnt.h xm_file=alpha/xm-winnt.h diff --recursive --new-file -c orig/gcc-2.7.0/fold-const.c gcc-2.7.0/fold-const.c *** orig/gcc-2.7.0/fold-const.c Thu Jun 15 07:35:19 1995 --- gcc-2.7.0/fold-const.c Wed Jun 21 01:15:23 1995 *************** *** 2633,2640 **** int modesize = GET_MODE_BITSIZE (TYPE_MODE (type)); tree temp; ! if (p == modesize || unsignedp) return c; if (TREE_UNSIGNED (type)) c = convert (signed_type (type), c); --- 2633,2647 ---- int modesize = GET_MODE_BITSIZE (TYPE_MODE (type)); tree temp; ! if (unsignedp) return c; + + if(p == modesize) { + if(!TREE_UNSIGNED(type)) { + c = convert (unsigned_type (type),c); + } + return c; + } if (TREE_UNSIGNED (type)) c = convert (signed_type (type), c); diff --recursive --new-file -c orig/gcc-2.7.0/glimits.h gcc-2.7.0/glimits.h *** orig/gcc-2.7.0/glimits.h Wed Sep 29 17:30:54 1993 --- gcc-2.7.0/glimits.h Wed Jun 21 01:54:58 1995 *************** *** 60,70 **** #undef UINT_MAX #define UINT_MAX (INT_MAX * 2U + 1) /* Minimum and maximum values a `signed long int' can hold. (Same as `int'). */ - #ifndef __LONG_MAX__ #define __LONG_MAX__ 2147483647L #endif #undef LONG_MIN #define LONG_MIN (-LONG_MAX-1) #undef LONG_MAX --- 60,75 ---- #undef UINT_MAX #define UINT_MAX (INT_MAX * 2U + 1) + #ifndef __LONG_MAX__ + #ifdef __alpha__ + #define __LONG_MAX__ 9223372036854775807LL + #else /* Minimum and maximum values a `signed long int' can hold. (Same as `int'). */ #define __LONG_MAX__ 2147483647L #endif + #endif + #undef LONG_MIN #define LONG_MIN (-LONG_MAX-1) #undef LONG_MAX diff --recursive --new-file -c orig/gcc-2.7.0/libgcc2.c gcc-2.7.0/libgcc2.c *** orig/gcc-2.7.0/libgcc2.c Thu Jun 15 07:48:01 1995 --- gcc-2.7.0/libgcc2.c Mon Jun 19 00:51:45 1995 *************** *** 2108,2121 **** /* We declare the lists here with two elements each, so that they are valid empty lists if no other definition is loaded. */ #if !defined(INIT_SECTION_ASM_OP) && !defined(CTOR_LISTS_DEFINED_EXTERNALLY) - #ifdef __NeXT__ /* After 2.3, try this definition on all systems. */ func_ptr __CTOR_LIST__[2] = {0, 0}; func_ptr __DTOR_LIST__[2] = {0, 0}; - #else - func_ptr __CTOR_LIST__[2]; - func_ptr __DTOR_LIST__[2]; - #endif #endif /* no INIT_SECTION_ASM_OP and not CTOR_LISTS_DEFINED_EXTERNALLY */ #endif /* L_ctors */ --- 2108,2116 ----