diff options
author | Robert de Bath <rdebath@poboxes.com> | 2002-07-24 21:00:16 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2013-10-23 23:48:47 +0200 |
commit | 2060b4f4cc1c13975e495d088344825f7700181b (patch) | |
tree | 5efd3dbb269b09d4b3351fdb6b50d6dca0291d47 /bcc/bcc.c | |
parent | 673f690a37f6673a3262e933709c79de8a66f48c (diff) | |
download | dev86-0.16.5.tar.gz |
Import Dev86src-0.16.5.tar.gzv0.16.5
Diffstat (limited to 'bcc/bcc.c')
-rw-r--r-- | bcc/bcc.c | 58 |
1 files changed, 58 insertions, 0 deletions
@@ -141,6 +141,7 @@ void command_arch P((void)); void command_opts P((int opykey)); void newfilename P((struct file_list * file, int last_stage, int new_extn, int use_o)); void run_unlink P((void)); +void validate_link_opts P((void)); void append_file P((char * filename, int ftype)); void append_option P((char * option, int otype)); void prepend_option P((char * option, int otype)); @@ -200,6 +201,7 @@ char ** argv; reset_localprefix(); #endif getargs(argc, argv); + validate_link_opts(); default_include = expand_tilde(default_include); default_libdir0 = expand_tilde(default_libdir0); @@ -447,6 +449,60 @@ run_link() } void +validate_link_opt(char * option) +{ + int err = 0; + if (option[0] != '-') return; + + switch(option[1]) { + default: + err = 1; + break; + case '0': /* use 16-bit libraries */ + case '3': /* use 32-bit libraries */ + case 'M': /* print symbols linked */ + case 'i': /* separate I & D output */ + case 'm': /* print modules linked */ + case 's': /* strip symbols */ + case 't': /* trace modules linked */ + case 'z': /* unmapped zero page */ + case 'N': /* Native format a.out */ + case 'd': /* Make a headerless outfile */ + case 'c': /* Write header in CP/M-86 format */ + case 'y': /* Use a newer symbol table */ + if (option[2] != 0 && option[2] != '-') + err = 1; + break; + case 'C': /* startfile name */ + case 'L': /* library path */ + case 'O': /* library file name */ + case 'T': /* text base address */ + case 'D': /* data base address */ + case 'H': /* heap top address */ + case 'l': /* library name */ + case 'o': /* output file name */ + break; + } + if (err) + fprintf(stderr, "warning: linker option %s not unrecognised.\n", option); +} + +void +validate_link_opts() +{ + struct opt_list * ol; + struct file_list * next_file; + if (opt_arch>1) return; /* Only check ld86 options */ + + for(ol=options; ol; ol=ol->next) + if (ol->opttype == 'l') + validate_link_opt(ol->opt); + + for(next_file = files; next_file; next_file = next_file->next) + validate_link_opt(next_file->file); +} + +void command_reset() { #ifndef MAXPATHLEN @@ -868,6 +924,8 @@ char ** argv; opt_x = 1; append_option("/lib/crt0.o", 'l'); break; + default: + fatal("Unknown model specifier for -M"); } if (do_optim) |