From e6af3a53b1740fb6554ac582fd7ac74022dff8c2 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 10 Dec 2002 16:15:27 +0000 Subject: Allow an otherwise unrepresentable read-only section that lies after .text and before .data to be written into the output file and included in a_text. --- bfd/aoutx.h | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'bfd/aoutx.h') diff --git a/bfd/aoutx.h b/bfd/aoutx.h index 9b87de9..d8b465c 100644 --- a/bfd/aoutx.h +++ b/bfd/aoutx.h @@ -1287,11 +1287,17 @@ NAME(aout,set_section_contents) (abfd, section, location, offset, count) if (section != obj_textsec (abfd) && section != obj_datasec (abfd)) { - (*_bfd_error_handler) - (_("%s: can not represent section `%s' in a.out object file format"), - bfd_get_filename (abfd), bfd_get_section_name (abfd, section)); - bfd_set_error (bfd_error_nonrepresentable_section); - return FALSE; + if (aout_section_merge_with_text_p (abfd, section)) + section->filepos = obj_textsec (abfd)->filepos + + (section->vma - obj_textsec (abfd)->vma); + else + { + (*_bfd_error_handler) + (_("%s: can not represent section `%s' in a.out object file format"), + bfd_get_filename (abfd), bfd_get_section_name (abfd, section)); + bfd_set_error (bfd_error_nonrepresentable_section); + return FALSE; + } } if (count != 0) @@ -1703,11 +1709,16 @@ translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer) sym_pointer->e_type[0] = N_UNDF | N_EXT; else { - (*_bfd_error_handler) - (_("%s: can not represent section `%s' in a.out object file format"), - bfd_get_filename (abfd), bfd_get_section_name (abfd, sec)); - bfd_set_error (bfd_error_nonrepresentable_section); - return FALSE; + if (aout_section_merge_with_text_p (abfd, sec)) + sym_pointer->e_type[0] |= N_TEXT; + else + { + (*_bfd_error_handler) + (_("%s: can not represent section `%s' in a.out object file format"), + bfd_get_filename (abfd), bfd_get_section_name (abfd, sec)); + bfd_set_error (bfd_error_nonrepresentable_section); + return FALSE; + } } /* Turn the symbol from section relative to absolute again. */ -- cgit v1.1