From 0630aba528b4af093887608509158013cfbc1aeb Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 22 Jun 1994 19:13:55 +0000 Subject: [PATCH] Linux ZMAGIC support from Eric Youngdale . * 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. --- bfd/ChangeLog | 11 +++++++++++ bfd/aoutx.h | 22 ++++++++++++++++++---- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 00f07f6160e..119c03d302f 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,16 @@ Wed Jun 22 10:52:47 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + Linux ZMAGIC support from Eric Youngdale . + * 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. + * aoutx.h (aout_link_check_ar_symbols): Just skip N_STAB and N_FN symbols; don't look them up in the hash table. From ralphc@pyramid.com (Ralph Campbell). diff --git a/bfd/aoutx.h b/bfd/aoutx.h index 923d49c8e32..42ec7977f0a 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; -- 2.30.2