Fri Jan 7 10:27:27 1994 David J. Mackenzie (djm@rtl.cygnus.com)
+ * aoutx.h (adjust_z_magic): Don't merge the start of bss with the
+ end of data if they are not contiguous.
+
* aoutf1.h (sunos4_aout_backend): Comment the fields' meanings.
Fri Jan 7 15:40:16 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
if (ztih && (!abdp || (abdp && !abdp->exec_header_not_counted)))
execp->a_text += adata(abfd).exec_bytes_size;
N_SET_MAGIC (*execp, ZMAGIC);
+
/* Spec says data section should be rounded up to page boundary. */
- /* If extra space in page is left after data section, fudge data
- in the header so that the bss section looks smaller by that
- amount. We'll start the bss section there, and lie to the OS. */
obj_datasec(abfd)->_raw_size
= align_power (obj_datasec(abfd)->_raw_size,
obj_bsssec(abfd)->alignment_power);
if (!obj_bsssec(abfd)->user_set_vma)
obj_bsssec(abfd)->vma = (obj_datasec(abfd)->vma
+ obj_datasec(abfd)->_raw_size);
- execp->a_bss = (data_pad > obj_bsssec(abfd)->_raw_size) ? 0 :
- obj_bsssec(abfd)->_raw_size - data_pad;
+ /* If the BSS immediately follows the data section and extra space
+ in the page is left after the data section, fudge data
+ in the header so that the bss section looks smaller by that
+ amount. We'll start the bss section there, and lie to the OS.
+ (Note that a linker script, as well as the above assignment,
+ could have explicitly set the BSS vma to immediately follow
+ the data section.) */
+ if (align_power (obj_bsssec(abfd)->vma, obj_bsssec(abfd)->alignment_power)
+ == obj_datasec(abfd)->vma + obj_datasec(abfd)->_raw_size)
+ execp->a_bss = (data_pad > obj_bsssec(abfd)->_raw_size) ? 0 :
+ obj_bsssec(abfd)->_raw_size - data_pad;
+ else
+ execp->a_bss = obj_bsssec(abfd)->_raw_size;
}
static void