summaryrefslogtreecommitdiff
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
commit28eeb9d5f8b7e22f729277cb88c3623d6a03bdd2 (patch)
tree115debc3832052b5ad22751e280ed97a3d702e84 /bfd/aoutx.h
parent521ac5c5f822decb8de47d69535cfefa11ee4588 (diff)
downloadgdb-28eeb9d5f8b7e22f729277cb88c3623d6a03bdd2.tar.gz
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 9b87de9528b..d8b465c47b8 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. */