* relax.c: added handling for new "padding" seclet type, used to

fill out gaps between section.
	* ldgram.y, ldlex.l: now -defsym on the command line is done
	properly.
This commit is contained in:
Steve Chamberlain
1992-04-17 15:59:37 +00:00
parent b0c8c72688
commit 0d3e45eab0
3 changed files with 50 additions and 6 deletions

View File

@ -46,10 +46,14 @@ genscripts.sh
gld.1 gld.1
gld960.em gld960.em
gld960.sh gld960.sh
go32.sh
hp300bsd.sh hp300bsd.sh
h8300hms.em h8300hms.em
h8300hms.sc-sh h8300hms.sc-sh
h8300hms.sh h8300hms.sh
h8300xray.em
h8300xray.sc-sh
h8300xray.sh
i386aout.sh i386aout.sh
i960.sc-sh i960.sc-sh
ld.h ld.h
@ -107,6 +111,12 @@ echo Done in `pwd`.
# #
# #
# $Log$ # $Log$
# Revision 1.35 1992/04/17 15:59:22 sac
# * relax.c: added handling for new "padding" seclet type, used to
# fill out gaps between section.
# * ldgram.y, ldlex.l: now -defsym on the command line is done
# properly.
#
# Revision 1.34 1992/04/15 23:11:53 sac # Revision 1.34 1992/04/15 23:11:53 sac
# added mri.c # added mri.c
# #

View File

@ -1,4 +1,5 @@
%{ %{
/* Copyright (C) 1991 Free Software Foundation, Inc. /* Copyright (C) 1991 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker. This file is part of GLD, the Gnu Linker.
@ -65,7 +66,8 @@ unsigned int include_stack_ptr = 0;
%a 4000 %a 4000
%o 5000 %o 5000
FILENAMECHAR1 [_a-zA-Z\/\.\\] FILENAMECHAR1 [_a-zA-Z\/\.\\]
FILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\] SYMBOLCHARN [_a-zA-Z\/\.\\0-9]
FILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\]
FILENAME {FILENAMECHAR}+ FILENAME {FILENAMECHAR}+
WHITE [ \t\n]+ WHITE [ \t\n]+
@ -74,10 +76,16 @@ WHITE [ \t\n]+
%x EXPRESSION %x EXPRESSION
%x COMMENT %x COMMENT
%x BOTH %x BOTH
%x DEFSYMEXP
%x MRI %x MRI
%% %%
<COMMAND>"-defsym" { return OPTION_defsym; } <DEFSYMEXP>"-" { RTOKEN('-');}
<DEFSYMEXP>"+" { RTOKEN('+');}
<DEFSYMEXP>{FILENAMECHAR1}{SYMBOLCHARN}* { yylval.name = buystring(yytext); return NAME; }
<DEFSYMEXP>[ \t] { RTOKEN(DEFSYMEND); }
<DEFSYMEXP>"=" { RTOKEN('='); }
<COMMAND>"-defsym"{WHITE}* { return OPTION_defsym; }
<COMMAND>"-noinhibit_exec" { return OPTION_noinhibit_exec; } <COMMAND>"-noinhibit_exec" { return OPTION_noinhibit_exec; }
<COMMAND>"-noinhibit-exec" { return OPTION_noinhibit_exec; } <COMMAND>"-noinhibit-exec" { return OPTION_noinhibit_exec; }
<COMMAND>"-sort_common" { return OPTION_sort_common;} <COMMAND>"-sort_common" { return OPTION_sort_common;}
@ -441,8 +449,15 @@ BEGIN(SCRIPT);
void void
DEFUN_VOID(ldlex_mri_script) DEFUN_VOID(ldlex_mri_script)
{ {
*(state_stack_p)++ = yy_start; *(state_stack_p)++ = yy_start;
BEGIN(MRI); BEGIN(MRI);
}
void
DEFUN_VOID(ldlex_defsym)
{
*(state_stack_p)++ = yy_start;
BEGIN(DEFSYMEXP);
} }
void void

View File

@ -27,7 +27,6 @@ DEFUN(build_it,(statement),
lang_statement_union_type *statement) lang_statement_union_type *statement)
{ {
switch (statement->header.type) { switch (statement->header.type) {
case lang_fill_statement_enum:
{ {
#if 0 #if 0
bfd_byte play_area[SHORT_SIZE]; bfd_byte play_area[SHORT_SIZE];
@ -113,7 +112,27 @@ DEFUN(build_it,(statement),
} }
break; break;
case lang_padding_statement_enum:
/* Make a new seclet with the right filler */
{
/* Create a new seclet in the output section with this
attached */
bfd_seclet_type *seclet =
bfd_new_seclet(statement->padding_statement.output_section->owner,
statement->padding_statement.output_section);
seclet->type = bfd_fill_seclet;
seclet->size = statement->padding_statement.size;
seclet->offset = statement->padding_statement.output_offset;
seclet->u.fill.value = statement->padding_statement.fill;
seclet->next = 0;
}
break;
break;
default: default:
/* All the other ones fall through */ /* All the other ones fall through */
; ;