* relax.c (build_it): re-enable the processing of data_statements

in scripts, makes counted contructor lists work again.
This commit is contained in:
Steve Chamberlain 1992-11-05 19:35:38 +00:00
parent cd98a82fc1
commit 85c838d613
2 changed files with 91 additions and 85 deletions

View File

@ -1,3 +1,8 @@
Thu Nov 5 11:33:57 1992 Steve Chamberlain (sac@thepub.cygnus.com)
* relax.c (build_it): re-enable the processing of data_statements
in scripts, makes counted contructor lists work again.
Thu Nov 5 05:43:01 1992 John Gilmore (gnu@cygnus.com) Thu Nov 5 05:43:01 1992 John Gilmore (gnu@cygnus.com)
* ldemul.h: Remove uses of SDEF and PROTO macros (use PARAMS). * ldemul.h: Remove uses of SDEF and PROTO macros (use PARAMS).

View File

@ -28,116 +28,117 @@ DEFUN(build_it,(statement),
{ {
switch (statement->header.type) { switch (statement->header.type) {
#if 0 #if 0
{ {
bfd_byte play_area[SHORT_SIZE]; bfd_byte play_area[SHORT_SIZE];
unsigned int i; unsigned int i;
bfd_putshort(output_bfd, statement->fill_statement.fill, play_area); bfd_putshort(output_bfd, statement->fill_statement.fill, play_area);
/* Write out all entire shorts */ /* Write out all entire shorts */
for (i = 0; for (i = 0;
i < statement->fill_statement.size - SHORT_SIZE + 1; i < statement->fill_statement.size - SHORT_SIZE + 1;
i+= SHORT_SIZE) i+= SHORT_SIZE)
{ {
bfd_set_section_contents(output_bfd, bfd_set_section_contents(output_bfd,
statement->fill_statement.output_section, statement->fill_statement.output_section,
play_area, play_area,
statement->data_statement.output_offset +i, statement->data_statement.output_offset +i,
SHORT_SIZE); SHORT_SIZE);
} }
/* Now write any remaining byte */ /* Now write any remaining byte */
if (i < statement->fill_statement.size) if (i < statement->fill_statement.size)
{ {
bfd_set_section_contents(output_bfd, bfd_set_section_contents(output_bfd,
statement->fill_statement.output_section, statement->fill_statement.output_section,
play_area, play_area,
statement->data_statement.output_offset +i, statement->data_statement.output_offset +i,
1); 1);
} }
abort(); abort();
} }
break; break;
#endif #endif
case lang_data_statement_enum: case lang_data_statement_enum:
#if 0
{
bfd_vma value = statement->data_statement.value; {
bfd_byte play_area[LONG_SIZE];
unsigned int size = 0; bfd_vma value = statement->data_statement.value;
switch (statement->data_statement.type) { bfd_byte play_area[LONG_SIZE];
unsigned int size = 0;
asection * output_section = statement->data_statement.output_section;
switch (statement->data_statement.type) {
case LONG: case LONG:
bfd_put_32(output_bfd, value, play_area); bfd_put_32(output_section->owner, value, play_area);
size = LONG_SIZE; size = LONG_SIZE;
break; break;
case SHORT: case SHORT:
bfd_put_16(output_bfd, value, play_area); bfd_put_16(output_section->owner, value, play_area);
size = SHORT_SIZE; size = SHORT_SIZE;
break; break;
case BYTE: case BYTE:
bfd_put_8(output_bfd, value, play_area); bfd_put_8(output_section->owner, value, play_area);
size = BYTE_SIZE; size = BYTE_SIZE;
break; break;
} }
bfd_set_section_contents(output_bfd, bfd_set_section_contents(output_section->owner,
statement->data_statement.output_section, statement->data_statement.output_section,
play_area, play_area,
statement->data_statement.output_vma, statement->data_statement.output_vma,
size); size);
} }
#endif
break;
case lang_input_section_enum:
{
/* Create a new seclet in the output section with this
attached */
if (statement->input_section.ifile->just_syms_flag == false)
{
asection *i = statement->input_section.section;
asection *output_section = i->output_section;
bfd_seclet_type *seclet = bfd_new_seclet(output_section->owner,output_section);
seclet->type = bfd_indirect_seclet;
seclet->u.indirect.section = i;
seclet->u.indirect.symbols = statement->input_section.ifile->asymbols;
seclet->size = i->_cooked_size;
seclet->offset = i->output_offset;
seclet->next = 0;
}
}
break; break;
case lang_padding_statement_enum: case lang_input_section_enum:
{
/* Create a new seclet in the output section with this
attached */
if (statement->input_section.ifile->just_syms_flag == false)
{
asection *i = statement->input_section.section;
asection *output_section = i->output_section;
bfd_seclet_type *seclet = bfd_new_seclet(output_section->owner,output_section);
seclet->type = bfd_indirect_seclet;
seclet->u.indirect.section = i;
seclet->u.indirect.symbols = statement->input_section.ifile->asymbols;
seclet->size = i->_cooked_size;
seclet->offset = i->output_offset;
seclet->next = 0;
}
}
break;
case lang_padding_statement_enum:
/* Make a new seclet with the right filler */ /* Make a new seclet with the right filler */
{ {
/* Create a new seclet in the output section with this /* Create a new seclet in the output section with this
attached */ attached */
bfd_seclet_type *seclet = bfd_seclet_type *seclet =
bfd_new_seclet(statement->padding_statement.output_section->owner, bfd_new_seclet(statement->padding_statement.output_section->owner,
statement->padding_statement.output_section); statement->padding_statement.output_section);
seclet->type = bfd_fill_seclet; seclet->type = bfd_fill_seclet;
seclet->size = statement->padding_statement.size; seclet->size = statement->padding_statement.size;
seclet->offset = statement->padding_statement.output_offset; seclet->offset = statement->padding_statement.output_offset;
seclet->u.fill.value = statement->padding_statement.fill; seclet->u.fill.value = statement->padding_statement.fill;
seclet->next = 0; seclet->next = 0;
} }
break; break;
break; break;
default: default:
/* All the other ones fall through */ /* All the other ones fall through */
; ;