Xref: utzoo comp.unix.i386:7649 comp.sources.bugs:2468 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!mips!daver!tscs!tct!chip From: chip@tct.uucp (Chip Salzenberg) Newsgroups: comp.unix.i386,comp.sources.bugs Subject: Patches for GNU G++ 1.37.1 collect on SCO Unix 3.2 Message-ID: <26BEEBA0.2A8B@tct.uucp> Date: 7 Aug 90 16:26:08 GMT Organization: ComDev/TCT, Sarasota, FL Lines: 70 These changes allow G++ 1.37.1 "collect" to work with the SCO Unix assembler. The primary change is that the ".text" section number is two instead of one. In addition, this patch implements a feature that collect is supposed to have: Destructors are now called in reverse order of constructors. Index: collect.c *************** *** 315,320 **** } else { ! new->next = dtor_chain; ! dtor_chain = new; dtor_chain_length++; } --- 315,328 ---- } else { ! new -> next = NULL; ! if ( dtor_chain == NULL ) ! dtor_chain = new; ! else { ! struct ctor_dtor_list_elem *last = dtor_chain; ! ! while ( last -> next ) ! last = last -> next; ! last -> next = new; ! } dtor_chain_length++; } *************** *** 356,360 **** } ASM_OUTPUT_INT_CONST (outfile, 0); - ASM_OUTPUT_INT_CONST (outfile, 0); fclose (outfile); --- 364,367 ---- *************** *** 382,385 **** --- 389,400 ---- #endif + #ifndef TEXT_SECTION + # ifdef M_UNIX + # define TEXT_SECTION 2 + # else + # define TEXT_SECTION 1 + # endif + #endif + #if defined(EXTENDED_COFF) # define GCC_SYMBOLS(X) (SYMHEADER(X).isymMax+SYMHEADER(X).iextMax) *************** *** 393,397 **** # define GCC_OK_SYMBOL(X) (!(((X).n_type & N_TMASK) != (DT_NON << N_BTSHFT))) #else ! # define GCC_OK_SYMBOL(X) ((X).n_scnum == 1 && (X).n_sclass == C_EXT) #endif # define GCC_SYMINC(X) ((X).n_numaux+1) --- 408,413 ---- # define GCC_OK_SYMBOL(X) (!(((X).n_type & N_TMASK) != (DT_NON << N_BTSHFT))) #else ! # define GCC_OK_SYMBOL(X) \ ! ((X).n_scnum == TEXT_SECTION && (X).n_sclass == C_EXT) #endif # define GCC_SYMINC(X) ((X).n_numaux+1) -- Chip Salzenberg at ComDev/TCT ,