aboutsummaryrefslogtreecommitdiff
path: root/bfd/aoutx.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2002-12-10 16:15:27 +0000
committerNick Clifton <nickc@redhat.com>2002-12-10 16:15:27 +0000
commite6af3a53b1740fb6554ac582fd7ac74022dff8c2 (patch)
tree09d4f42842deb6b836c677b03fcb6622449eb299 /bfd/aoutx.h
parente06d9b458937264621d6ec81ccf9a6bab3337cac (diff)
downloadgdb-e6af3a53b1740fb6554ac582fd7ac74022dff8c2.zip
gdb-e6af3a53b1740fb6554ac582fd7ac74022dff8c2.tar.gz
gdb-e6af3a53b1740fb6554ac582fd7ac74022dff8c2.tar.bz2
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.
Diffstat (limited to 'bfd/aoutx.h')
-rw-r--r--bfd/aoutx.h31
1 files changed, 21 insertions, 10 deletions
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. */