* ecoff.c (ecoff_write_object_contents): Set the text_start and

data_start entries in the optional header correctly even if a text
	or data section starts at location zero.
This commit is contained in:
Ian Lance Taylor
1994-03-31 19:44:10 +00:00
parent e9c6595dd4
commit 1788b1bd01
2 changed files with 18 additions and 4 deletions

View File

@ -1,5 +1,9 @@
Thu Mar 31 11:52:15 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Thu Mar 31 11:52:15 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* ecoff.c (ecoff_write_object_contents): Set the text_start and
data_start entries in the optional header correctly even if a text
or data section starts at location zero.
* reloc.c (bfd_reloc_code_real_type): Added BFD_RELOC_26 (from sef * reloc.c (bfd_reloc_code_real_type): Added BFD_RELOC_26 (from sef
and raeburn). and raeburn).
* bfd-in2.h: Rebuilt. * bfd-in2.h: Rebuilt.

View File

@ -2492,8 +2492,10 @@ ecoff_write_object_contents (abfd)
bfd_size_type reloc_size; bfd_size_type reloc_size;
bfd_size_type text_size; bfd_size_type text_size;
bfd_vma text_start; bfd_vma text_start;
boolean set_text_start;
bfd_size_type data_size; bfd_size_type data_size;
bfd_vma data_start; bfd_vma data_start;
boolean set_data_start;
bfd_size_type bss_size; bfd_size_type bss_size;
PTR buff = NULL; PTR buff = NULL;
PTR reloc_buff = NULL; PTR reloc_buff = NULL;
@ -2521,8 +2523,10 @@ ecoff_write_object_contents (abfd)
else else
text_size = 0; text_size = 0;
text_start = 0; text_start = 0;
set_text_start = false;
data_size = 0; data_size = 0;
data_start = 0; data_start = 0;
set_data_start = false;
bss_size = 0; bss_size = 0;
/* Write section headers to the file. */ /* Write section headers to the file. */
@ -2615,8 +2619,11 @@ ecoff_write_object_contents (abfd)
|| strcmp (current->name, _PDATA) == 0) || strcmp (current->name, _PDATA) == 0)
{ {
text_size += bfd_get_section_size_before_reloc (current); text_size += bfd_get_section_size_before_reloc (current);
if (text_start == 0 || text_start > vma) if (! set_text_start || text_start > vma)
text_start = vma; {
text_start = vma;
set_text_start = true;
}
} }
else if ((section.s_flags & STYP_RDATA) != 0 else if ((section.s_flags & STYP_RDATA) != 0
|| (section.s_flags & STYP_DATA) != 0 || (section.s_flags & STYP_DATA) != 0
@ -2627,8 +2634,11 @@ ecoff_write_object_contents (abfd)
|| strcmp (current->name, _XDATA) == 0) || strcmp (current->name, _XDATA) == 0)
{ {
data_size += bfd_get_section_size_before_reloc (current); data_size += bfd_get_section_size_before_reloc (current);
if (data_start == 0 || data_start > vma) if (! set_data_start || data_start > vma)
data_start = vma; {
data_start = vma;
set_data_start = true;
}
} }
else if ((section.s_flags & STYP_BSS) != 0 else if ((section.s_flags & STYP_BSS) != 0
|| (section.s_flags & STYP_SBSS) != 0) || (section.s_flags & STYP_SBSS) != 0)