diff options
author | Ian Lance Taylor <ian@airs.com> | 1994-06-22 19:13:55 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1994-06-22 19:13:55 +0000 |
commit | 0630aba528b4af093887608509158013cfbc1aeb (patch) | |
tree | 8f6261787a803de722247729a22ef2815619db42 /bfd/aoutx.h | |
parent | f579270bb50d4c02c45334a99b76cd2b1a6508a8 (diff) | |
download | gdb-0630aba528b4af093887608509158013cfbc1aeb.zip gdb-0630aba528b4af093887608509158013cfbc1aeb.tar.gz gdb-0630aba528b4af093887608509158013cfbc1aeb.tar.bz2 |
Linux ZMAGIC support from Eric Youngdale <ericy@cais.cais.com>.
* libaout.h (struct aoutdata): Add field zmagic_disk_block_size.
* aout-target.h (MY(callback)): Only set alignment according to
architecture if the section sizes are aligned to that alignment,
for backward compatibility.
(MY(set_sizes)): Initialize zmagic_disk_block_size field.
* aoutx.h (adjust_z_magic): Set ztih if using q_magic_format. Set
text section filepos to zmagic_disk_block_size if not ztih. Use a
different padding algorithm if not ztih.
* i386linux.c (MY_text_includes_header): Don't define.
Diffstat (limited to 'bfd/aoutx.h')
-rw-r--r-- | bfd/aoutx.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/bfd/aoutx.h b/bfd/aoutx.h index 923d49c..42ec797 100644 --- a/bfd/aoutx.h +++ b/bfd/aoutx.h @@ -805,10 +805,12 @@ adjust_z_magic (abfd, execp) abdp = aout_backend_info (abfd); /* Text. */ - ztih = abdp && abdp->text_includes_header; + ztih = (abdp != NULL + && (abdp->text_includes_header + || obj_aout_subformat (abfd) == q_magic_format)); obj_textsec(abfd)->filepos = (ztih ? adata(abfd).exec_bytes_size - : adata(abfd).page_size); + : adata(abfd).zmagic_disk_block_size); if (! obj_textsec(abfd)->user_set_vma) /* ?? Do we really need to check for relocs here? */ obj_textsec(abfd)->vma = ((abfd->flags & HAS_RELOC) @@ -820,8 +822,20 @@ adjust_z_magic (abfd, execp) /* Could take strange alignment of text section into account here? */ /* Find start of data. */ - text_end = obj_textsec(abfd)->filepos + obj_textsec(abfd)->_raw_size; - text_pad = BFD_ALIGN (text_end, adata(abfd).page_size) - text_end; + if (ztih) + { + text_end = obj_textsec (abfd)->filepos + obj_textsec (abfd)->_raw_size; + text_pad = BFD_ALIGN (text_end, adata (abfd).page_size) - text_end; + } + else + { + /* Note that if page_size == zmagic_disk_block_size, then + filepos == page_size, and this case is the same as the ztih + case. */ + text_end = obj_textsec (abfd)->_raw_size; + text_pad = BFD_ALIGN (text_end, adata (abfd).page_size) - text_end; + text_end += obj_textsec (abfd)->filepos; + } obj_textsec(abfd)->_raw_size += text_pad; text_end += text_pad; |