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.
This commit is contained in:
Ian Lance Taylor 1994-06-22 19:13:55 +00:00
parent f579270bb5
commit 0630aba528
2 changed files with 29 additions and 4 deletions

View 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).

View 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;