Linux ZMAGIC support from Eric Youngdale <ericy@cais.cais.com>.
authorIan Lance Taylor <ian@airs.com>
Wed, 22 Jun 1994 19:13:55 +0000 (19:13 +0000)
committerIan Lance Taylor <ian@airs.com>
Wed, 22 Jun 1994 19:13:55 +0000 (19:13 +0000)
* 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
bfd/aoutx.h

index 00f07f6160e306ccda2da4c31f7c86f778d55a4d..119c03d302f991207260bb4163d6877b6d45f0b8 100644 (file)
@@ -1,5 +1,16 @@
 Wed Jun 22 10:52:47 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
 
+       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.
+
        * 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).
index 923d49c8e322b018fa801575c2f29bd120623795..42ec7977f0af433e943b31548bc3e61866d914eb 100644 (file)
@@ -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;
 
This page took 0.031269 seconds and 4 git commands to generate.