From: Ian Lance Taylor Date: Mon, 16 Jun 1997 16:56:22 +0000 (+0000) Subject: Mon Jun 16 12:49:36 1997 H.J. Lu X-Git-Tag: gdb-4_18~5365 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f4ae97e1bdfeddfb9ea2f006f1b6e18bc94ecbad;p=external%2Fbinutils.git Mon Jun 16 12:49:36 1997 H.J. Lu * ldlang.c (lang_place_undefineds): Add \n in einfo call. (lang_size_sections): Likewise. * ldlex.l: Likewise. * emultempl/aix.em (gld${EMULATION_NAME}_read_file): Likewise. * emultempl/mipsecoff.em (gld${EMULATION_NAME}_after_open): Likewise. (check_sections): Likewise. (gld${EMULATION_NAME}_after_allocation): Likewise. * emultempl/pe.em (gld_$${EMULATION_NAME}_before_allocation): Likewise. * mpw-eppcmac.c (gldppcmacos_read_file): Likewise. * mpw-idtmips.c (gldmipsidt_after_open): Likewise. (check_sections): Likewise. (gldmipsidt_after_allocation): Likewise. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 42f9557..2301d88 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,20 @@ Mon Jun 16 12:49:36 1997 H.J. Lu + * ldlang.c (lang_place_undefineds): Add \n in einfo call. + (lang_size_sections): Likewise. + * ldlex.l: Likewise. + * emultempl/aix.em (gld${EMULATION_NAME}_read_file): Likewise. + * emultempl/mipsecoff.em (gld${EMULATION_NAME}_after_open): + Likewise. + (check_sections): Likewise. + (gld${EMULATION_NAME}_after_allocation): Likewise. + * emultempl/pe.em (gld_$${EMULATION_NAME}_before_allocation): + Likewise. + * mpw-eppcmac.c (gldppcmacos_read_file): Likewise. + * mpw-idtmips.c (gldmipsidt_after_open): Likewise. + (check_sections): Likewise. + (gldmipsidt_after_allocation): Likewise. + * ldemul.c (ldemul_choose_mode): Remove unused einfo argument. Fri Jun 6 23:47:42 1997 Ian Lance Taylor diff --git a/ld/ldlex.l b/ld/ldlex.l index 681988d..e821494 100644 --- a/ld/ldlex.l +++ b/ld/ldlex.l @@ -1,6 +1,6 @@ %{ -/* Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -89,6 +89,9 @@ static void lex_warn_invalid PARAMS ((char *where, char *what)); BOTH either EXPRESSION or SCRIPT DEFSYMEXP in an argument to -defsym MRI in an MRI script + VERS_START starting a Sun style mapfile + VERS_SCRIPT a Sun style mapfile + VERS_NODE a node within a Sun style mapfile */ #define RTOKEN(x) { yylval.token = x; return x; } @@ -104,19 +107,24 @@ int yywrap () { return 1; } CMDFILENAMECHAR [_a-zA-Z0-9\/\.\\_\+\$\:\[\]\\\,\=\&\!\<\>\-\~] CMDFILENAMECHAR1 [_a-zA-Z0-9\/\.\\_\+\$\:\[\]\\\,\=\&\!\<\>\~] FILENAMECHAR1 [_a-zA-Z\/\.\\\$\_\~] -SYMBOLCHARN [_a-zA-Z\/\.\\0-9] +SYMBOLCHARN [_a-zA-Z\/\.\\\$\_\~0-9] FILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~] WILDCHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~\?\*] WHITE [ \t\n\r]+ NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~] +V_TAG [.$_a-zA-Z][._a-zA-Z0-9]* +V_IDENTIFIER [*?$_a-zA-Z][*?_a-zA-Z0-9]* %s SCRIPT %s EXPRESSION %s BOTH %s DEFSYMEXP %s MRI +%s VERS_START +%s VERS_SCRIPT +%s VERS_NODE %% if (parser_input != input_selected) @@ -128,6 +136,7 @@ NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~] { case input_script: return INPUT_SCRIPT; break; case input_mri_script: return INPUT_MRI_SCRIPT; break; + case input_version_script: return INPUT_VERSION_SCRIPT; break; case input_defsym: return INPUT_DEFSYM; break; default: abort (); } @@ -223,12 +232,15 @@ NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~] ";" { RTOKEN(';');} "MEMORY" { RTOKEN(MEMORY);} "ORIGIN" { RTOKEN(ORIGIN);} +"VERSION" { RTOKEN(VERSION);} "BLOCK" { RTOKEN(BLOCK);} "BIND" { RTOKEN(BIND);} "LENGTH" { RTOKEN(LENGTH);} "ALIGN" { RTOKEN(ALIGN_K);} "ADDR" { RTOKEN(ADDR);} "LOADADDR" { RTOKEN(LOADADDR);} +"MAX" { RTOKEN(MAX); } +"MIN" { RTOKEN(MIN); } "ENTRY" { RTOKEN(ENTRY);} "NEXT" { RTOKEN(NEXT);} "sizeof_headers" { RTOKEN(SIZEOF_HEADERS);} @@ -253,11 +265,13 @@ NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~] "SYSLIB" { RTOKEN(SYSLIB);} "FLOAT" { RTOKEN(FLOAT);} "QUAD" { RTOKEN( QUAD);} +"SQUAD" { RTOKEN( SQUAD);} "LONG" { RTOKEN( LONG);} "SHORT" { RTOKEN( SHORT);} "BYTE" { RTOKEN( BYTE);} "NOFLOAT" { RTOKEN(NOFLOAT);} -"NOCROSSREFS" { RTOKEN(NOCROSSREFS);} +"NOCROSSREFS" { RTOKEN(NOCROSSREFS);} +"OVERLAY" { RTOKEN(OVERLAY); } "NOLOAD" { RTOKEN(NOLOAD);} "DSECT" { RTOKEN(DSECT);} "COPY" { RTOKEN(COPY);} @@ -341,6 +355,29 @@ NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~] "\r" { lineno++;} [ \t] +[:,;] { return *yytext; } + +global { RTOKEN(GLOBAL); } + +local { RTOKEN(LOCAL); } + +{V_IDENTIFIER} { yylval.name = buystring (yytext); + return VERS_IDENTIFIER; } + +{V_TAG} { yylval.name = buystring (yytext); + return VERS_TAG; } + +"{" { BEGIN(VERS_SCRIPT); return *yytext; } + +"{" { BEGIN(VERS_NODE); return *yytext; } +"}" { BEGIN(VERS_SCRIPT); return *yytext; } + +[\n\r] { lineno++; } + +#.* { /* Eat up comments */ } + +[ \t]+ { /* Eat up whitespace */ } + <> { include_stack_ptr--; @@ -360,7 +397,7 @@ NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~] return END; } -. lex_warn_invalid(" in script", yytext); +. lex_warn_invalid(" in script", yytext); . lex_warn_invalid(" in expression", yytext); %% @@ -469,6 +506,20 @@ ldlex_mri_script () } void +ldlex_version_script () +{ + *(state_stack_p)++ = yy_start; + BEGIN (VERS_START); +} + +void +ldlex_version_file () +{ + *(state_stack_p)++ = yy_start; + BEGIN (VERS_SCRIPT); +} + +void ldlex_defsym () { *(state_stack_p)++ = yy_start; @@ -512,7 +563,7 @@ yy_input (buf, result, max_size) { *result = read (fileno (yyin), (char *) buf, max_size); if (*result < 0) - einfo ("%F%P: read in flex scanner failed"); + einfo ("%F%P: read in flex scanner failed\n"); } } } diff --git a/ld/mpw-eppcmac.c b/ld/mpw-eppcmac.c index 007d265..3df5a02 100644 --- a/ld/mpw-eppcmac.c +++ b/ld/mpw-eppcmac.c @@ -731,7 +731,7 @@ gldppcmacos_read_file (filename, import) obstack_free (o, obstack_base (o)); } else if (*s == '(') - einfo ("%F%s%d: #! ([member]) is not supported in import files", + einfo ("%F%s%d: #! ([member]) is not supported in import files\n", filename, lineno); else { diff --git a/ld/mpw-idtmips.c b/ld/mpw-idtmips.c index 554f9a8..b8450e0 100644 --- a/ld/mpw-idtmips.c +++ b/ld/mpw-idtmips.c @@ -90,7 +90,7 @@ gldmipsidt_after_open () || ! bfd_set_section_alignment (abfd, relsec, 2) || ! bfd_set_section_size (abfd, relsec, datasec->reloc_count * 4)) - einfo ("%F%B: can not create .rel.sdata section: %E"); + einfo ("%F%B: can not create .rel.sdata section: %E\n"); } /* Double check that all other data sections are empty, as is @@ -111,7 +111,7 @@ check_sections (abfd, sec, sdatasec) if ((bfd_get_section_flags (abfd, sec) & SEC_CODE) == 0 && sec != (asection *) sdatasec && sec->reloc_count != 0) - einfo ("%F%X: section %s has relocs; can not use --embedded-relocs", + einfo ("%F%X: section %s has relocs; can not use --embedded-relocs\n", abfd, bfd_get_section_name (abfd, sec)); } @@ -146,10 +146,10 @@ gldmipsidt_after_allocation () &errmsg)) { if (errmsg == NULL) - einfo ("%B%X: can not create runtime reloc information: %E", + einfo ("%B%X: can not create runtime reloc information: %E\n", abfd); else - einfo ("%X%B: can not create runtime reloc information: %s", + einfo ("%X%B: can not create runtime reloc information: %s\n", abfd, errmsg); } }