Makefile.in (tlink.o): Don't depend on toplev.h.
* Makefile.in (tlink.o): Don't depend on toplev.h. * collect2.c (c_file, o_file, export_file, import_file, ldout, output_file, nm_file_name, ldd_file_name, strip_file_name, c_file_name, prefix_list, libexts, is_ctor_dtor, find_a_file, add_prefix, prefix_from_env, prefix_from_string, do_wait, fork_execute, maybe_unlink, add_to_list, extract_init_priority, write_list, dump_list, dump_prefix_list, write_list_with_asm, write_c_file, write_c_file_stat, write_c_file_glob, scan_prog_file, scan_libraries, is_in_list, resolve_lib_name, use_import_list, ignore_library, extract_string, notice, dump_file, target_machine, collect_wait, collect_execute, libname, locatelib, aix_std_libs, read_file, print_load_command): Constify a char*. (fdopen, error, fatal, fatal_perror): Don't prototype. (my_strerror): Remove. All callers use xstrerror instead. (xcalloc, xmalloc, xrealloc, xstrdup, putenv): Remove definitions. (main): Add prototype. Constify lots of char* ptrs. Change calls to xcalloc/strcpy/strcat/... to one call to concat. (main, scan_prog_file, scan_libraries): Use an intermediate `const char **' to build an argv array. (mapfile, libselect, libcompare, locatelib): Add prototypes. * collect2.h (collect_execute, collect_wait, dump_file, file_exists): Constify a char*. (ldout, c_file_name, temporary_obstack, permanent_obstack, temporary_firstobj, vflag, debug): Add extern declarations. (fancy_abort, error, notice, fatal, fatal_perror): Add prototypes. * tlink.c: Don't include toplev.h. (vflag, debug, ldout, c_file_name, temporary_obstack, permanent_obstack, temporary_firstobj): Don't declare. (tlink_execute, frob_extension, symbol_hash_lookup, file_hash_lookup, demangled_hash_lookup, tlink_init, freadsym, recompile_files, read_repo_files, demangle_new_symbols, scan_linker_output): Constify a char*. (symbol_hash_newfunc, file_hash_newfunc, demangled_hash_newfunc, do_tlink): Mark parameters with ATTRIBUTE_UNUSED. From-SVN: r29087
This commit is contained in:
parent
2f11d4079a
commit
d4058195bd
5 changed files with 254 additions and 337 deletions
|
@ -1,3 +1,44 @@
|
|||
Fri Sep 3 15:10:20 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
* Makefile.in (tlink.o): Don't depend on toplev.h.
|
||||
|
||||
* collect2.c (c_file, o_file, export_file, import_file, ldout,
|
||||
output_file, nm_file_name, ldd_file_name, strip_file_name,
|
||||
c_file_name, prefix_list, libexts, is_ctor_dtor, find_a_file,
|
||||
add_prefix, prefix_from_env, prefix_from_string, do_wait,
|
||||
fork_execute, maybe_unlink, add_to_list,
|
||||
extract_init_priority, write_list, dump_list,
|
||||
dump_prefix_list, write_list_with_asm, write_c_file,
|
||||
write_c_file_stat, write_c_file_glob, scan_prog_file,
|
||||
scan_libraries, is_in_list, resolve_lib_name, use_import_list,
|
||||
ignore_library, extract_string, notice, dump_file, target_machine,
|
||||
collect_wait, collect_execute, libname, locatelib, aix_std_libs,
|
||||
read_file, print_load_command): Constify a char*.
|
||||
(fdopen, error, fatal, fatal_perror): Don't prototype.
|
||||
(my_strerror): Remove. All callers use xstrerror instead.
|
||||
(xcalloc, xmalloc, xrealloc, xstrdup, putenv): Remove definitions.
|
||||
(main): Add prototype. Constify lots of char* ptrs. Change calls
|
||||
to xcalloc/strcpy/strcat/... to one call to concat.
|
||||
(main, scan_prog_file, scan_libraries): Use an intermediate
|
||||
`const char **' to build an argv array.
|
||||
(mapfile, libselect, libcompare, locatelib): Add prototypes.
|
||||
|
||||
* collect2.h (collect_execute, collect_wait, dump_file,
|
||||
file_exists): Constify a char*.
|
||||
(ldout, c_file_name, temporary_obstack, permanent_obstack,
|
||||
temporary_firstobj, vflag, debug): Add extern declarations.
|
||||
(fancy_abort, error, notice, fatal, fatal_perror): Add prototypes.
|
||||
|
||||
* tlink.c: Don't include toplev.h.
|
||||
(vflag, debug, ldout, c_file_name, temporary_obstack,
|
||||
permanent_obstack, temporary_firstobj): Don't declare.
|
||||
(tlink_execute, frob_extension, symbol_hash_lookup,
|
||||
file_hash_lookup, demangled_hash_lookup, tlink_init, freadsym,
|
||||
recompile_files, read_repo_files, demangle_new_symbols,
|
||||
scan_linker_output): Constify a char*.
|
||||
(symbol_hash_newfunc, file_hash_newfunc, demangled_hash_newfunc,
|
||||
do_tlink): Mark parameters with ATTRIBUTE_UNUSED.
|
||||
|
||||
Fri Sep 3 18:09:24 1999 Andrew Haley <aph@cygnus.com>
|
||||
|
||||
* config/m68k/m68kelf.h: Set USE_GAS; this makes gcc generate jbsr
|
||||
|
|
|
@ -1356,7 +1356,7 @@ collect2.o : collect2.c $(CONFIG_H) system.h gstab.h intl.h \
|
|||
-DTARGET_MACHINE=\"$(target_alias)\" $(MAYBE_USE_COLLECT2) \
|
||||
-c `echo $(srcdir)/collect2.c | sed 's,^\./,,'`
|
||||
|
||||
tlink.o: tlink.c $(DEMANGLE_H) hash.h $(CONFIG_H) system.h toplev.h collect2.h
|
||||
tlink.o: tlink.c $(DEMANGLE_H) hash.h $(CONFIG_H) system.h collect2.h
|
||||
hash.o: hash.c hash.h system.h toplev.h
|
||||
|
||||
vfprintf.o: $(srcdir)/../libiberty/vfprintf.c $(CONFIG_H) system.h
|
||||
|
|
478
gcc/collect2.c
478
gcc/collect2.c
File diff suppressed because it is too large
Load diff
|
@ -23,14 +23,29 @@ Boston, MA 02111-1307, USA. */
|
|||
|
||||
extern void do_tlink PARAMS ((char **, char **));
|
||||
|
||||
extern void collect_execute PARAMS ((char *, char **, char *));
|
||||
extern void collect_execute PARAMS ((const char *, char **, const char *));
|
||||
|
||||
extern void collect_exit PARAMS ((int)) ATTRIBUTE_NORETURN;
|
||||
|
||||
extern int collect_wait PARAMS ((char *));
|
||||
extern int collect_wait PARAMS ((const char *));
|
||||
|
||||
extern void dump_file PARAMS ((char *));
|
||||
extern void dump_file PARAMS ((const char *));
|
||||
|
||||
extern int file_exists PARAMS ((char *));
|
||||
extern int file_exists PARAMS ((const char *));
|
||||
|
||||
extern const char *ldout;
|
||||
extern const char *c_file_name;
|
||||
extern struct obstack temporary_obstack;
|
||||
extern struct obstack permanent_obstack;
|
||||
extern char *temporary_firstobj;
|
||||
extern int vflag, debug;
|
||||
|
||||
extern void fancy_abort PARAMS ((void)) ATTRIBUTE_NORETURN;
|
||||
extern void error PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1;
|
||||
extern void notice PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1;
|
||||
extern void fatal PARAMS ((const char *, ...))
|
||||
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
|
||||
extern void fatal_perror PARAMS ((const char *, ...))
|
||||
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
|
||||
|
||||
#endif /* ! __COLLECT2_H__ */
|
||||
|
|
47
gcc/tlink.c
47
gcc/tlink.c
|
@ -25,7 +25,6 @@ Boston, MA 02111-1307, USA. */
|
|||
#include "system.h"
|
||||
#include "hash.h"
|
||||
#include "demangle.h"
|
||||
#include "toplev.h"
|
||||
#include "collect2.h"
|
||||
|
||||
#define MAX_ITERATIONS 17
|
||||
|
@ -34,14 +33,6 @@ Boston, MA 02111-1307, USA. */
|
|||
#define obstack_chunk_alloc xmalloc
|
||||
#define obstack_chunk_free free
|
||||
|
||||
/* Defined in collect2.c. */
|
||||
extern int vflag, debug;
|
||||
extern char *ldout;
|
||||
extern char *c_file_name;
|
||||
extern struct obstack temporary_obstack;
|
||||
extern struct obstack permanent_obstack;
|
||||
extern char * temporary_firstobj;
|
||||
|
||||
/* Defined in the automatically-generated underscore.c. */
|
||||
extern int prepends_underscore;
|
||||
|
||||
|
@ -95,8 +86,8 @@ static symbol * symbol_pop PARAMS ((void));
|
|||
static void file_push PARAMS ((file *));
|
||||
static file * file_pop PARAMS ((void));
|
||||
static void tlink_init PARAMS ((void));
|
||||
static int tlink_execute PARAMS ((char *, char **, char *));
|
||||
static char * frob_extension PARAMS ((char *, const char *));
|
||||
static int tlink_execute PARAMS ((const char *, char **, const char *));
|
||||
static char * frob_extension PARAMS ((const char *, const char *));
|
||||
static char * obstack_fgets PARAMS ((FILE *, struct obstack *));
|
||||
static char * tfgets PARAMS ((FILE *));
|
||||
static char * pfgets PARAMS ((FILE *));
|
||||
|
@ -115,7 +106,7 @@ static struct hash_entry *
|
|||
symbol_hash_newfunc (entry, table, string)
|
||||
struct hash_entry *entry;
|
||||
struct hash_table *table;
|
||||
hash_table_key string;
|
||||
hash_table_key string ATTRIBUTE_UNUSED;
|
||||
{
|
||||
struct symbol_hash_entry *ret = (struct symbol_hash_entry *) entry;
|
||||
if (ret == NULL)
|
||||
|
@ -140,7 +131,7 @@ symbol_hash_lookup (string, create)
|
|||
boolean create;
|
||||
{
|
||||
return ((struct symbol_hash_entry *)
|
||||
hash_lookup (&symbol_table, (hash_table_key) string,
|
||||
hash_lookup (&symbol_table, (const hash_table_key) string,
|
||||
create, string_copy));
|
||||
}
|
||||
|
||||
|
@ -153,7 +144,7 @@ static struct hash_entry *
|
|||
file_hash_newfunc (entry, table, string)
|
||||
struct hash_entry *entry;
|
||||
struct hash_table *table;
|
||||
hash_table_key string;
|
||||
hash_table_key string ATTRIBUTE_UNUSED;
|
||||
{
|
||||
struct file_hash_entry *ret = (struct file_hash_entry *) entry;
|
||||
if (ret == NULL)
|
||||
|
@ -177,7 +168,7 @@ file_hash_lookup (string)
|
|||
const char *string;
|
||||
{
|
||||
return ((struct file_hash_entry *)
|
||||
hash_lookup (&file_table, (hash_table_key) string, true,
|
||||
hash_lookup (&file_table, (const hash_table_key) string, true,
|
||||
string_copy));
|
||||
}
|
||||
|
||||
|
@ -190,7 +181,7 @@ static struct hash_entry *
|
|||
demangled_hash_newfunc (entry, table, string)
|
||||
struct hash_entry *entry;
|
||||
struct hash_table *table;
|
||||
hash_table_key string;
|
||||
hash_table_key string ATTRIBUTE_UNUSED;
|
||||
{
|
||||
struct demangled_hash_entry *ret = (struct demangled_hash_entry *) entry;
|
||||
if (ret == NULL)
|
||||
|
@ -212,7 +203,7 @@ demangled_hash_lookup (string, create)
|
|||
boolean create;
|
||||
{
|
||||
return ((struct demangled_hash_entry *)
|
||||
hash_lookup (&demangled_table, (hash_table_key) string,
|
||||
hash_lookup (&demangled_table, (const hash_table_key) string,
|
||||
create, string_copy));
|
||||
}
|
||||
|
||||
|
@ -296,7 +287,7 @@ file_pop ()
|
|||
static void
|
||||
tlink_init ()
|
||||
{
|
||||
char *p;
|
||||
const char *p;
|
||||
|
||||
hash_table_init (&symbol_table, symbol_hash_newfunc, string_hash,
|
||||
string_compare);
|
||||
|
@ -322,9 +313,9 @@ tlink_init ()
|
|||
|
||||
static int
|
||||
tlink_execute (prog, argv, redir)
|
||||
char *prog;
|
||||
const char *prog;
|
||||
char **argv;
|
||||
char *redir;
|
||||
const char *redir;
|
||||
{
|
||||
collect_execute (prog, argv, redir);
|
||||
return collect_wait (prog);
|
||||
|
@ -332,10 +323,10 @@ tlink_execute (prog, argv, redir)
|
|||
|
||||
static char *
|
||||
frob_extension (s, ext)
|
||||
char *s;
|
||||
const char *s;
|
||||
const char *ext;
|
||||
{
|
||||
char *p = rindex (s, '/');
|
||||
const char *p = rindex (s, '/');
|
||||
if (! p)
|
||||
p = s;
|
||||
p = rindex (p, '.');
|
||||
|
@ -391,7 +382,7 @@ freadsym (stream, f, chosen)
|
|||
symbol *sym;
|
||||
|
||||
{
|
||||
char *name = tfgets (stream);
|
||||
const char *name = tfgets (stream);
|
||||
sym = symbol_hash_lookup (name, true);
|
||||
}
|
||||
|
||||
|
@ -507,7 +498,7 @@ recompile_files ()
|
|||
{
|
||||
char *line, *command;
|
||||
FILE *stream = fopen ((char*) f->root.key, "r");
|
||||
char *outname = frob_extension ((char*) f->root.key, ".rnw");
|
||||
const char *outname = frob_extension ((char*) f->root.key, ".rnw");
|
||||
FILE *output = fopen (outname, "w");
|
||||
|
||||
while ((line = tfgets (stream)) != NULL)
|
||||
|
@ -559,7 +550,7 @@ read_repo_files (object_lst)
|
|||
|
||||
for (; *object; object++)
|
||||
{
|
||||
char *p = frob_extension (*object, ".rpo");
|
||||
const char *p = frob_extension (*object, ".rpo");
|
||||
file *f;
|
||||
|
||||
if (! file_exists (p))
|
||||
|
@ -586,7 +577,7 @@ demangle_new_symbols ()
|
|||
while ((sym = symbol_pop ()) != NULL)
|
||||
{
|
||||
demangled *dem;
|
||||
char *p = cplus_demangle ((char*) sym->root.key,
|
||||
const char *p = cplus_demangle ((char*) sym->root.key,
|
||||
DMGL_PARAMS | DMGL_ANSI);
|
||||
|
||||
if (! p)
|
||||
|
@ -635,7 +626,7 @@ scan_linker_output (fname)
|
|||
if (! sym && ! end)
|
||||
/* Try a mangled name in quotes. */
|
||||
{
|
||||
char *oldq = q+1;
|
||||
const char *oldq = q+1;
|
||||
demangled *dem = 0;
|
||||
q = 0;
|
||||
|
||||
|
@ -694,7 +685,7 @@ scan_linker_output (fname)
|
|||
|
||||
void
|
||||
do_tlink (ld_argv, object_lst)
|
||||
char **ld_argv, **object_lst;
|
||||
char **ld_argv, **object_lst ATTRIBUTE_UNUSED;
|
||||
{
|
||||
int exit = tlink_execute ("ld", ld_argv, ldout);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue