From f651733a12b1e147ba33a32fdbe5e9ad299a38a0 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 1 Dec 1993 17:22:03 +0000 Subject: * ldgram.y (OPTION_call_shared, OPTION_non_shared): New tokens. (command_line_option): Accept and ignore them (for now). * ldlex.l (): Handle -non_shared and -call_shared. --- ld/ChangeLog | 12 ++++++++++++ ld/ldgram.y | 62 +++++++++++++++++++++++++++++++++++++++++++++++++----------- ld/ldlex.l | 10 +++++++--- 3 files changed, 70 insertions(+), 14 deletions(-) (limited to 'ld') diff --git a/ld/ChangeLog b/ld/ChangeLog index 41627d1..f24f69b 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,15 @@ +Wed Dec 1 12:19:55 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ldgram.y (OPTION_call_shared, OPTION_non_shared): New tokens. + (command_line_option): Accept and ignore them (for now). + * ldlex.l (): Handle -non_shared and -call_shared. + +Mon Nov 22 14:14:29 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ldmain.c (subfile_wanted_p): If merging a common symbol which is + not in bfd_com_section, create the section in the BFD so that it + can be placed in the right output section. + Fri Nov 19 14:12:39 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * configure.in (mips*-sgi-irix5*): New target. Use mipsb-elf32. diff --git a/ld/ldgram.y b/ld/ldgram.y index 739a2c9..3ff91d7 100644 --- a/ld/ldgram.y +++ b/ld/ldgram.y @@ -43,11 +43,12 @@ extern boolean trace_file_tries; extern boolean trace_files; extern boolean write_map; extern int g_switch_value; -boolean hex_mode; +extern int hex_mode; static int typebits; strip_symbols_type strip_symbols=STRIP_NONE; discard_locals_type discard_locals=DISCARD_NONE; +static char *dirlist_ptr; lang_memory_region_type *region; @@ -137,7 +138,7 @@ static int error_index; %token MEMORY DEFSYMEND %token NOLOAD DSECT COPY INFO OVERLAY %token NAME DEFINED TARGET_K SEARCH_DIR MAP ENTRY -%token OPTION_e OPTION_c OPTION_noinhibit_exec OPTION_s OPTION_S OPTION_sort_common +%token OPTION_e OPTION_c OPTION_noinhibit_exec OPTION_s OPTION_S OPTION_sort_common OPTION_warn_common %token OPTION_EB OPTION_EL OPTION_G OPTION_Gval OPTION_help %token OPTION_format OPTION_oformat OPTION_F OPTION_u OPTION_Bstatic OPTION_N %token SIZEOF NEXT ADDR @@ -151,6 +152,8 @@ static int error_index; %token ORIGIN FILL OPTION_g %token LENGTH CREATE_OBJECT_SYMBOLS INPUT OUTPUT CONSTRUCTORS %token OPTION_RETAIN_SYMBOLS_FILE ALIGNMOD AT +%token OPTION_Qy OPTION_Y OPTION_dn OPTION_call_shared OPTION_non_shared +%token OPTION_YP %type assign_op @@ -161,7 +164,7 @@ static int error_index; %token FORMAT PUBLIC DEFSYMEND BASE ALIAS TRUNCATE %{ -ld_config_type config; +extern ld_config_type config; %} %% @@ -249,7 +252,7 @@ command_line_option: } | OPTION_o filename { - lang_add_output($2); + lang_add_output($2, 0); } | OPTION_e NAME { lang_add_entry($2); @@ -269,6 +272,10 @@ command_line_option: { config.sort_common = true; } + | OPTION_warn_common + { + config.warn_common = true; + } | OPTION_d { command_line.force_common_definition = true; } @@ -380,6 +387,40 @@ command_line_option: { g_switch_value = yylval.integer; } + | OPTION_Qy + | OPTION_dn + | OPTION_non_shared + | OPTION_call_shared + | OPTION_YP + { + dirlist_ptr = $1; + goto set_default_dirlist; + } + | OPTION_Y NAME + { + if (strncmp ($2, "P,", 2)) + einfo ("%P%F: unknown -Y option -- %s\n", $2); + else + { + char *p = ""; + dirlist_ptr = $2; + set_default_dirlist: + while (p != 0) + { + p = strchr (dirlist_ptr, ':'); + if (p) + *p = 0; + if (*dirlist_ptr) + ldfile_add_library_path (dirlist_ptr); + if (p) + { + *p = ':'; + dirlist_ptr = p + 1; + } + } + } + } + | '{' script_file '}' { /* This parses compiled-in scripts. */ } | NAME { if (*$1 == '-') @@ -503,10 +544,10 @@ ifile_p1: | SEARCH_DIR '(' filename ')' { ldfile_add_library_path($3); } | OUTPUT '(' filename ')' - { lang_add_output($3); } - | OUTPUT_FORMAT '(' NAME ')' + { lang_add_output($3, 1); } + | OUTPUT_FORMAT '(' NAME ')' { lang_add_output_format($3, 1); } - | OUTPUT_ARCH '(' NAME ')' + | OUTPUT_ARCH '(' NAME ')' { ldfile_set_output_arch($3); } | FORCE_COMMON_ALLOCATION { command_line.force_common_definition = true ; } @@ -519,14 +560,13 @@ ifile_p1: input_list: NAME - { lang_add_input_file($1,lang_input_file_is_file_enum, + { lang_add_input_file($1,lang_input_file_is_search_file_enum, (char *)NULL); } | input_list ',' NAME - { lang_add_input_file($3,lang_input_file_is_file_enum, + { lang_add_input_file($3,lang_input_file_is_search_file_enum, (char *)NULL); } | input_list NAME - { lang_add_input_file($2, -lang_input_file_is_file_enum, + { lang_add_input_file($2,lang_input_file_is_search_file_enum, (char *)NULL); } ; diff --git a/ld/ldlex.l b/ld/ldlex.l index 29445c7..19ded41 100644 --- a/ld/ldlex.l +++ b/ld/ldlex.l @@ -212,9 +212,11 @@ NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~] yylval.name = buystring (yytext+4); return OPTION_YP; } +"-non_shared" { return OPTION_non_shared; } +"-call_shared" { return OPTION_call_shared; } "$"([0-9A-Fa-f])+ { - yylval.integer = strtoul(yytext+1, 0,16); + yylval.integer = bfd_scan_vma (yytext+1, 0,16); return INT; } @@ -234,11 +236,13 @@ NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~] default: base = 10; } - yylval.integer = strtoul(yytext+1, 0, base); + yylval.integer = bfd_scan_vma (yytext+1, 0, + base); return INT; } "$"?"0x"?([0-9A-Fa-f])+(M|K|m|k)? { - yylval.integer = strtoul(yytext,0,hex_mode); + yylval.integer = bfd_scan_vma (yytext, 0, + hex_mode); if (yytext[yyleng-1]=='M' || yytext[yyleng-1] == 'm') { yylval.integer *= 1024*1024; -- cgit v1.1